changed to use consistent RNG