binary search: add non-recursive version