fixed reduction, added a working reduction example