added new random function and updated perturb function, 42.8p