reimplement polynomial type