tidied up the spline interpolation