added code generation base
added base for memory management