add ancestor pattern