updated CDF function