Working on map reduce functionality