Use parent ids instead of recursive calls to inInheritanceChain()