implemented find-first-index