new function to compute spline coeffs