sample for piecewise