revised distances with clearer type signatures