Just a TypeError in clipping the end of the algorithm