Implementing the QuickFind.union and .find methods