made util/kruskal simpler