calculation Bug fix