implemented check for winner, stalemate, game over condition, smarter AI