complete Lua module implement (need test)