Added gameEnd() function