working on code generation functions for AST traversal