private int miniMax(NodeLVL7 node, int depth, int alpha, int beta, 
            boolean player) throws AIStoppedException {
        DraughtsState ds = node.getState();
        if (stopped){
            stopped = false;
            throw new AIStoppedException();
        }
        
        if (depth == 0 || ds.isEndState()) {
            if (white) {
                return node.getValue();
            } else {
                return -node.getValue();
            }
        }
        if (player) {
            for (Move move : ds.getMoves()) {
                ds.doMove(move);
                // Maximize
                alpha = max(alpha, miniMax(new NodeLVL7(ds.clone()), 
                        depth - 1, alpha, beta, false));

                if (alpha >= beta) {
                    return beta;
                }
                ds.undoMove(move);
            }
            return alpha;
        } else {
            for (Move move : ds.getMoves()) {
                ds.doMove(move);
                //Minimize
                beta = min(beta, miniMax(new NodeLVL7(ds.clone()), depth - 1, alpha, beta, true));

                if (alpha >= beta) {
                    return alpha;
                }
                ds.undoMove(move);
            }
            return beta;
        }
    }