better support for external distances