change distance ret value to float
add algo framework