Old distance function now obsolete