Added more code to overall structure of generator.c