added WeightedUnion class