Add cumulative sum.

@avibryant is this even the right place for this?