had to fix the comparator function in the kruskal's method. it's finished! :)