Add depth information to nodes