debugging: cumulative sum and cdf