using a random number generator