added mask functionality to interaction.py