Simplify the algorithm.