make sure to create N masks