if values list was set, minval and maxval should be its min and max
just indentation for prettier code <3