nedded distance function in list 10