finish recursive bsearch.