Remove extraneous periods
Calculate random number only once