total calculation error fixed