fix calculating cdf and applying the equalized values