there is lots of copying of SplinePackages going on here...
It might be worth considering usage of just an index into packages_
or a pointer.