added depth function on Tree