small clean-ups and ability to set pseudo-random numbers