• Number the rows in the StartPoint CTE using ROW_NUMBER().  Then, instead of using LEAD in the StartPointsandNext CTE, join StartPoint to itself on RowNo = RowNo + 1.

    John