functional kruskal added