move polynomial related stuff to new Polynomial class