search working with repetitions