Update gen.c

Stripped comments, changed formatting