implemented game ending