Add Calculate Difference Function