changed calculation of cBar to be more intuitive

Hi,

it was not clear to me why cBar was being calculated the way it was. I have made a proposal for a different implementation and added some comments to clarify. The implementation is correct as far as I know but it does NOT give the same results as the previous implementation. 

Filip