cleaned up code

- defined new function to generate one set of numbers
- function now called number of sets times