develop search algorithm