modified local_diff.cc