Various updates to functions.

Mainly working on union and unionAcc