change rng references to ptr