fixed a small calculation error