Change run_function, add print_csv