adjusted the random number generator