fixed arithmetic precedence issue