Implemented a random number generator with a range