Added a loop for random digits

I substituted the for loop to our more familiar while loop.