lots of signs are wrong in bspline, not sure why
added first bit of bspline function