Implemented QuickUnion