move everything around
kruskal's algorithm for realz