- moved along-profile axis distance calculation outside function, after where duplicates are removed