Add process_file function