working on mapper and reducer functions