docstring for poly2beta