added spline fitting capability