add len(diff) instead of diff.size