return int for the Lua function