function U = Modules(T)
seq = DFLMT(T);
[n dump] = size(T);
T.First = zeros(n,1);
T.Second = zeros(n,1);
T.Last = zeros(n,1);
m = length(seq);
for i = 1:m
    c = seq(i);
    if T{c,"First"} == 0
        T{c,"First"} = i;
        if T{c,"Type"} == "BAS"
            T{c,"Second"} = i;
        end
    elseif T{c,"Second"} == 0
        T{c,"Second"} = i;
    end
    T{c,"Last"} = i;
end
T.DMax = zeros(n,1);
T.DMin = m*ones(n,1);
for i = 1:n
    p = string(T.Properties.RowNames{i});
    for c = T{p,"Children"}{1}
        T{p,"DMax"} = max([T{p,"DMax"} T{c,"DMax"} T{c,"Last"}]);
        T{p,"DMin"} = min([T{p,"DMin"} T{c,"DMin"} T{c,"First"}]);
    end
end
U = [];
for i = 1:n
    p = string(T.Properties.RowNames{i});
    if T{p,"First"} < T{p,"DMin"} && T{p,"Last"} > T{p,"DMax"} && T{p,"Type"} ~= "BAS"
        U = [U p];
    end
end
end