moved measure name matching to separate function
first code for distance substitution kernel