recursive segment