polynomial library done

still need refactoring