Made endGame work