created a way to end the game