MapReduce code