Minor refactoring

-Implemented a recursive function inside simGeneration so that fewer
arguments have to be passed around