Implemented the union find structure