added getBestMatch method and cosmetics