[na] distance algorithm