make maskpart array global because the % operator is very very slow. I'll think about a better solution than a global