Refactored number generator to accomodate distribution.