Implemented accumulators
Merge accumulators and minor cleanups.