1) implementing the MapReduce algorithm