reduce implemented based on new mapreduce