Modify the algorithm