fixed up functors in mask.ml