private int miniMax(Board board, char mark, int depth, int color, boolean max, int alpha, int beta) {
        char oppMark = getOppMark(mark);
        gameLogic = new BoardLogic(board);

        if(gameLogic.isOver() || depth == 7) return getGameScore(board, depth, mark) * color;
        else if(max) {
            ArrayList<Integer> emptySlots = board.getEmptySlots();
            for (Integer emptySlot : emptySlots) {
                board.setMove(mark, emptySlot);
                alpha = Math.max(alpha, miniMax(board, oppMark, depth + 1, -color, !max, alpha, beta));
                board.undoMove(emptySlot);
                if (alpha >= beta) break;
            }
            return alpha;
        } else {
            ArrayList<Integer> emptySlots = board.getEmptySlots();
            for (Integer emptySlot : emptySlots) {
                board.setMove(mark, emptySlot);
                beta = Math.min(beta, miniMax(board, oppMark, depth + 1, -color, !max, alpha, beta));
                board.undoMove(emptySlot);
                if (alpha >= beta) break;
            }
            return beta;
        }
    }