mask1 and mask2 added