Added some algorithm improvements
Merge pull request #4 from jeremyprice/statistical_algorithm_improvement

Added some algorithm improvements