add z-index variables to tree structure