det_distance added