finished union() and implemented find() with path compression