after sorting the data, calculate the cumulative sum and cdf to a file.