Added generator.c [provided]