adding indexing for tree nodes