implemented bitmap masking