for loop implement(midway2)

i found an algo
1. pop FOR
2. scan LOOP from bigger number
3. (LOOP>FOR) && minimum(abs(LOOP-FOR)) is the one