debugged codegen main file