Added AI to check for winners.