Calculate cxc properly
Merge pull request #737 from achamely/master

Calculate cxc properly