adds distances