Add last max move
Add break in the cycle
Add logs for max and min moves