fixed the final bug, reduce when a node only has one child which is the same operation