Added minimax algorithm