Working border distance metric except for distance matrix functions.