change distance functions to be floats