Shortened methods useAlgorithm and iterate to 7 and 17 lines of code.
Added a few private methods..