partial implementation of mapred