function U = DFLMT(T)
[n dump] = size(T);
root = string(T.Properties.RowNames{n});
U = [root];
T.done = zeros(n,1);
for c = T{root,"Children"}{1}
    [T U2] = DFLMTsub(T,c);
    U = [U U2];
end
U = [U root];
end

function [T U2] = DFLMTsub(T,c)
U2 = [c];
if T{c,"done"} == 0
    list = T{c,"Children"}{1};
    for c2 = list
        [T U3] = DFLMTsub(T,c2);
        U2 = [U2 U3];
    end
    if T{c,"Type"} ~= "BAS"
        U2 = [U2 c];
    end
    T{c,"done"} = 1;
end
end