added diff function