Rewrote reduce.