Courtney's bsearch