save hierarchy