moved distance computation from cbu.js to distance.js