Masklist small fix
Improved masklist code