Bugfix/cs840 fix calc

addresses #840