Add patience algorithm for diff.