Add MinMax implementation