added min/max function overloads. fixed setting function modifications
Fixed S-Shaped min/max
updated version