Added 2 functions to mask generic arrays