write output in new function
compute distance matrix
need to include distances within same chain
removed unused variable. docstring