function [out,outsize]=contour0(lset);

c=contour(lset,[0 0]);
csize=size(c,2); tmp=[]; cur=1;
while cur<csize,
        if c(2,cur)>6,
                tmp=[tmp c(:,(cur+1):(c(2,cur)+cur))];
        end
        cur=cur+c(2,cur)+1;
end
out=fliplr(tmp');
k=size(out,1);

if mod(k,3)==1,
        out(k+1,:)=out(2,:); out(k+2,:)=out(3,:);
        outsize=k+2;
elseif mod(k,3)==2,
        out(k+1,:)=out(2,:);
        outsize=k+1;
else
        outsize=k;
end

