main search alogirutm