Adding partial code for doing masking; note: code doesn't run yet!