add the diff function