Changed to NC way doing binary search