A lot better implementation of nextSquare