added mask funcs and iterate paradigm