changing various functions to work with new coeff ordering.