minor changes to binary search code