Add native mask code