added random number generator