Implementation of new search algorithm