added calc_cdf