- changed function::diff() to be more tolerant by checking first if the