Ratio test in matching alg