Trying to get the game to end gracefully