added quadratic interpolation