Simplify the algorithm