Wrote and tested map_reduce.