Implementation of random numbers