new distance measure & output for d3