Improvement: closest square is now used for looping