Added getDistance() member function