B-splines implementation