Method outperformed ratio test finished

Implemented an improved ratio matching function which considered the 2nd
ratio and give a weight to the 1st ratio and the 2nd.