HierarchyFix function

Change the hierarchy table to follow the standard