now uses inverse cdf