added detection of minimal polynomials