do not use sum applied to carray
back to cum_sum
sum slightly faster