add another method of calling random function depending on the
parameters specified.