renamed fun to rename_function