begin the code generation for running function