greatly simplified union function
further simplified union operation
fixed kruskals algorithm and other small bugs. Implemented some kruskal tests