Changed min and max to single extrema selected by user.