Tic Tac Toe with working minimax algorithm