initial generate code