new distance functions.  additional lines of testing.