more of an object oriented approach to lagrange interpolation