you have to scan in a controlled way, not ask for Pow from wherever they may be. Do you want the `x**2` power from `x**(x**2)*y` to help you make the decision here? If factor can be written as `x**n*y` it already *is* in that form since powers of x are collected automatically. So can you give an example of an example of what you are intending to do her?