moved Lua global scope function into iterator library