Add code to check whether the game is won