Debugged Kruskal.