mplemented distance