MapReduce code works