comment I made before: should `n` be `notmask_int.sum()` in the `deal_with_masked` case ?