Working endGame and pause