implement distance calculation in Elevator