Wrote winnerCheck function.