function retval=add(A,a)
  n=length(A);
  B=zeros(n,n);
  for i=1:n
    for j=1:n
      if i!=j
        B(i,j)=A(i,j);
      else
        B(i,j)=A(i,j)+a;
      endif
    endfor
  endfor
retval=B;	
endfunction
