set segment length