Simplied fuzzy matching code