Initial implementation of findHitIndex