conditional in Main based on highest degree of fx and gx