updated end of the game part