Added estimatedDistance function