Changed linear congruential generator function for RNG.