function for sparse distance sorter, some renamning and refactoring
function for sparse distance sorter, some renamning and refactoring

tumblr/collins,byxorna/collins,tumblr/collins,tumblr/collins,defect/collins,box/collins,discordianfish/collins,byxorna/collins,box/collins,funzoneq/collins,funzoneq/collins,defect/collins,defect/collins,discordianfish/collins,byxorna/collins,byxorna/collins,funzoneq/collins,funzoneq/collins,defect/collins,discordianfish/collins,box/collins,tumblr/collins,tumblr/collins,funzoneq/collins,defect/collins,tumblr/collins,funzoneq/collins,discordianfish/collins,byxorna/collins,discordianfish/collins,discordianfish/collins,box/collins,defect/collins,byxorna/collins