refactored spline algorithm

This will improve your app's efficiency by 1000%