the mid should be lower + (upper-lower)/2+1