Renaming: using "depth" throughout for the distance to the root.