Turned spline into a library to make solving additional problems and bug fixes easier.