Added the saveHierarchy() method and all calls to it