fixed it replacing distance with d
distance
d
edit: also did the sorting as i want! thanks alot @mark-piller