modify generate.c