Added the CoT calculation