finished kruskal.cpp