End of game working