fixed math error with constant term