docstring for poly2beta_B