even though it is implicit, I would change this to `S.cumsum(axis=i)`