Add cubic spline code