Update enhance algorithm 2.

We only consider lowest target in swap so that we can reduce the number
of loops.