fixed search algorithm