My implementations of binarySearch