some spline code