made a method instead of a constructor to read in spline data