some progress on mapreduce functions