first version of copy-hierarchy