add function to output code file