Added dif function

Added dif function