Dynamic Tree Macro