Implemented polynomial interpolation algorithm