added scripts for computing dtance