added return types to methods, minor cleanup, implemented lexicon.estimate, converted while to foreach