fixed a math error