added Enumerate() method to DynamicTree