for loop in metod searchByWords