Fixed the functional model of the map reduce code