added prefix-word index to handle skipped words