implemented mask functionality