script to calculate tree to tree distance
function moved to a seperate script