diff function added