incorporate EMD into distance calculation