Modify N4 to accept external mask