added cubic spline class and distfunc