Changed TagUnion to take the count of tags

To make it a little more efficient in memory consumption.