Added a way to check if the game is over