worked on hasWon functionality