added AI logic for blocks and winning the game