Added get mask function