Added b-spline algorithm