code generation recursion