Add some logic for the end of the game