Starting search algorithm