added more code into code generator