untested kernel for doing the max-min reduction