Revisited distance_add function
Revisited distance_add function
Added some more tests