maybe the algorithm is wrong