Fixed the sorting of the distances
Merge remote-tracking branch 'origin/master'