added option to save spline parameters to a text file