function module.CloseGaps(g,E)if not E then E=table.maxn(g)end local X=1 for E=1,E,1 do if g[E]~=nil then if E>X then g[X]=g[E]g[E]=nil end X=X+1 end end end

function module.CloseGaps(t, maxn)
	if not maxn then maxn = table.maxn(t); end
	local j = 1;
	for i = 1, maxn do
		if t[i] ~= nil then
			if i > j then
				t[j] = t[i];
				t[i] = nil;
			end
			j = j + 1;
		end
	end
end
