Fix not exactly using the algorithm