Union find with integer values