got minmax working