basic code generator implemented