#11 New getDistance function