changed cdf to improve reliability