When I manage to replace 200 lines of the algorithm by only 10 lines