working minspantree

the data structure isn't actually a tree, but it's going to be built
into one so it shouldn't matter