I would call the nameMatches something with 'indexOfName' or something and then you can rename 'i' to index. Then it is quite clear that it involves the index of a name.