function L = subsets(lst)
% generates all subsets of lst
if length(lst) == 0
    L = {[]};
% elseif length(lst) == 1
 %  L = {[lst(1)],[]}; 
else
    L1 = subsets(lst(2:end));
    L2 = insert(lst(1), L1);
    L = [L1, L2];
end;