added spline drawing function