add distance calculation