corridor_end_points function

Find the corridor end points.