begin first search implementation