Added exception to getDistance() prototype