A new implementation of the algorithm.