complete prototype of minmax