fixed arithmetic error