finished affinityMatrix, improved MST