private float move(float p, int index, Float max, Float min) {
        float value = 0f;
        
        if((min != null && max != null) && allowed[index]) {
            if(isInRange(p, max, min)) {
                value = p;
            } else if(p > max) {
                value = max;
            } else {
                value = min;
            } 
        } else if(allowed[index]) {
            value = p;
        }
        
        return value;
    }