added doReduce()