diff and calculate