function Links3(varargin)
nlevel = 4;
fprintf('Link ChemPlugin instance into a %d bifurcating tree\n', nlevel);

ninst = 2^nlevel - 1;
cp = cell(ninst,1);
for i = 1:ninst
    cp{i} = ChemPlugin();
end

% link instances into a tree
for level = 1:nlevel-1
    for i = 2^(level-1):2^level-1
       Link(cp{2*i}, cp{i});
       Link(cp{2*i+1}, cp{i});
    end
end

for i  = 1:ninst
    fprintf('Instance %d is linked to %d instances\n', i,  nLinks(cp{i}));
end
end
