Added implementation of QuickUnion