unfold recursive Lagrange polynoial implementation to interation