function module.Incorporate(m,b)for b,R in pairs(b)do if m[b]==nil then m[b]=R end end return m end function module.StableSort(m,b)for R=1,#m,1 do local k=1 while k<R and not b(m[R],m[k])do k=k+1 end for b=R-1,k,-1 do m[b],m[b+1]=m[b+1],m[b]end end end function module.ConvertArrayToMap(m)local b={}for R=1,#m,1 do b[m[R]]=true end return b end return module

function module.Incorporate(origin, draw)
	for i, v in pairs(draw) do
		if origin[i] == nil then
			origin[i] = v;
		end
	end
	return origin;
end

function module.StableSort(t, compare)
	for i = 1, #t do
		local j = 1;
		while j < i and not compare(t[i], t[j]) do
			j = j + 1;
		end
		for k = i - 1, j, -1 do
			t[k], t[k+1] = t[k+1], t[k];
		end
	end
end

function module.ConvertArrayToMap(t)
	local s = {};
	for i = 1, #t do
		s[t[i]] = true;
	end
	return s;
end

return module
