Clearer binary search implementation.