Replaced rand.