Wrote the winnerCheck() function.