MapReduce functions tested and working