Implemented analytic solution for determining number of mixtures in data. Code cleanup.