minor cleanup of random number generator