function mminsert(tbl, key, value) if tbl[key] == nil then tbl[key] = {} end table.insert(tbl[key], value) end function mmcontains(tbl, key, value) if tbl[key] ~= nil then for _, v in ipairs(tbl[key]) do if v == value then return true end end end return false end