implemented game end