Added lme method for invest. Minor code improvements.