I reimplemented kruskal's algo, but it's not really working :(