function B_1 = expand(B,r)

[~,n] = size(B);

Bneg = [B < 0];
b = sum(Bneg);

[~,v] = sort(b,'descend');
d = v(n);
Bnew = B;
Bnew(:,d) = 1/sqrt(r-n+1)*B(:,d);
B_1 = [Bnew repmat(1/sqrt(r-n+1)*B(:,d),1,r-n)];
   
   
   
    

