New diff function for ESG