private node minValue(node localHead, double alpha, double beta) {
        ArrayList<node> ch = localHead.getChildren();
        double temp = Double.MAX_VALUE;

        //terminating state
        if (localHead.getValue() == 5 || localHead.getValue() == -5) {
            return localHead;
        }

        //leaf node
        if (ch.size() < 1) {
            return localHead;
        }

        node ret = null;
        for (int i = 0; i < ch.size(); i++) {

            if (temp > maxValue(ch.get(i), alpha, beta).getValue()) {
                ret = ch.get(i);
                temp = ret.getValue();
            }

            if (temp <= alpha) {
                for (int j = 0; j < ch.size(); j++) {
                    if (j != i && ch.get(j).getValue() != 0) {
                        ch.get(j).prunned = true;
                    }
                }
                return ret;
            }
            beta = Math.min(beta, temp);
        }
        return ret;
    }