enforcing monotonicity of matchIndex