fixed nsd.distance