public double[] maxmin(String op, double[] max, int[] numberOfValues, NodeVariable x, int xIndex, HashMap<NodeVariable, MessageQ> modifierTable){
        double cost;
        if (op.equals("max")){
            cost = Double.NEGATIVE_INFINITY;
        }
        else if (op.equals("min")){
            cost = Double.POSITIVE_INFINITY;
        }

        for (int xParamIndex = 0; xParamIndex  < x.size(); xParamIndex ++) {
            numberOfValues[xIndex] = xParamIndex;
            // NOW it's pretty ready
            // this is the part where it is maximized
            if (modifierTable == null){
                //System.out.println("la modifiertable è vuota");
                cost =  this.evaluate(this.functionArgument(numberOfValues));
            }
            else {
                cost = ( this.evaluateMod(this.functionArgument(numberOfValues), modifierTable));
            }

            if (op.equals("max")){
                if (max[xParamIndex] < cost ){
                    max[xParamIndex] = ( cost );
                }
            }
            else if (op.equals("min")){
                if (max[xParamIndex] > cost ){
                    max[xParamIndex] = ( cost );
                }
            }
        }
        return max;
    }