Added a function to get the mask