pretty crap pseudocode for Kruskal's - i'll clean it up and try to implement the missing classes