working rough draft of masking routine