refactored first_larger_index