classifying polynomials by degree