Made a class which generates random valus from the cumulative distribution.