updated logic for checkIfWon()