Add ancestry to categories