Added Barry's bsearch function