sum functions implemented based on new mapreduce