First implementtion of random number generator.