added minmax