most of intial work required for implementing masking issue #4