modified process_diff