Applymask now does the masking and shifting for us