modify the random number method