changed compoundDoc to richDoc