added min max, tests