minmax working