Overhaul of random number generator.