function [BEST,FuncBEST] = Crow_Search_Algorithm1(Func_name,Lower,Upper,Maxiter)
N=length(Lower);
D=length(Lower);
X=zeros(N,D);
MEM=zeros(N,D);
XNEW=zeros(N,D);
fitness=zeros(1,N);
fitmem=zeros(1,N);
BEST=zeros(1,D);
AP=0.1;
fl=2.0;

for i=1:N
  for j=1:D
    X(i,j)=Lower(j)+(Upper(j)-Lower(j))*rand;
  end
  fitness(i)=fobj(X(i,:));
end

MEM=X;
fitmem=fitness;

iter=1;

while(iter <= Maxiter)
    
    for i=1:N
       num(i)=ceil(rand*N); 
    end
  
   for i=1:N
     if(rand>0.1)
        XNEW(i,:)=X(i,:)+fl.*rand.*(MEM(num(i),:) - X(i,:)); 
     else
        XNEW(i,:)=Lower+(Upper-Lower).*rand;
     end
   end

   XNEW = boundary (XNEW, Lower,Upper,N,D);
   for i=1:N
      fitness(i)=fobj(XNEW(i,:));
      if (fitness(i)<fitmem(i))
        fitmem(i)=fitness(i);
        MEM(i,:)=XNEW(i,:);
        X(i,:)=XNEW(i,:);
      end
   end  
   
   [mival, mindex]=min(fitmem);
   BEST=MEM(mindex,:);
   FuncBEST=fobj(BEST);
   
   iter=iter+1;
end


   
endfunction
