implementing functions of cumulative distribution