Implemented random number generator