maximum/minimum functions implemented based on new mapreduce