Added findbestmatching method