added mapreduce code