properly compute the sign of the coefficents