function Gau=Gauss(B)
     [m,n]=size(B);
     if (m<2)
       s=1;
       while s<=n && B(1,s)<0.0001 && B(1,s)>-0.0001
         s=s+1;
       end
       if s==n+1 
         Gau=B;
       else 
         Gau=B/B(1,s);
       end
     else
       Gau=B;
       t=1;
       while(t<=m && B(t,1)<0.0001 && B(t,1)>-0.0001) 
         t=t+1;
       end
       if(t~=m+1) 
         v=Gau(1,:);
         u=Gau(t,:)/Gau(t,1);
         Gau(t,:)=v;
         Gau(1,:)=u;
         for j=2:m
           Gau(j,:)=Gau(j,:)-(Gau(1,:)*Gau(j,1));
         end
         Gau=[Gau(1,:); Gauss(Gau(2:m,:))];
       else
         if n>1
           Gau=[Gau(:,1) Gauss(Gau(:,2:n))];
         end
       end
     end
end


