renamed rand to randrange