Improved the distances finder