Fixed incorrect line clearing

Also made the while loop run until the game is finished