added min, max, midValue and nextValue