Updated binarySearch() and added two tests