Finding the right segment