quadratic splines semi working, still getting unusual behavior