fixed matrix math for spline calculation