function A = TransClose(B)
A = B;
[n dump] = size(B);
Aold = zeros(n);
while min(min(A == Aold)) == 0
    Aold = A;
    for i = 1:n
        for j = 1:n
            for k = 1:n
                if Aold(i,j) >= 1 && Aold(j,k) >= 1
                    A(i,j) = 1;
                    A(j,k) = 1;
                    A(i,k) = 1;
                end
            end
        end
    end
end
end