created naive implementation of Lagrange polynomial approximation