distance measure added