Improve the masking gradient