refactored first_larger_index method
refactored first_larger_index