Added infrastructure to detect whether the game has been won