fixing vals2coeffs to work with the new coeff ordering.