WIP use TreeDefinition instead of index to make trees