Added more of the algorithm.