Mid-searching logic