included distance function