Fix all algorithm