added the cdf function (without size parameters)