new simple function with pathetic perf to generate cum sum of an array