Implemented non-recursive binary search