Implemented hierarchy traversal.