add weighted quick union and path compreesion