Implemented end of game checking for 2 flags