added rounding to the random number generation