corrected UnionFind, added some more helper methods to Graph and fixed some small bugs.