Update mask.js

Increasing performance, less code