implemented background masking