add parameter for lower and upper box constraints
decascade if clauses