Fixed the union find - just need to make sure it prints right.