change masking to patchNaNs