added reduceByTag and reduceByTagM