Modified FindMedianBounded