If `j` is just one more than `i` it might make more sense to do `= matches[i + 1]` instead.