Starting codegen method
Fixed merge conflicts