Imported from https://github.com/mathski/LFM
