adds a distance function
rm path.* and use node instead