added functionality for masking