Sort by distance added, showed in list

Algorithm of sorting by Mingheng