changed random number generator