Clean up difference calculation