the ugliest possible binary search