2d version infinite loop