adjusted to deal with type sets in type sets.