generalize min/max
such progres