Added binarySearch function