function module.Sum(P,l)local L=0 if l then for l=1,l,1 do L=L+P[l>#P and#P or l]or 0 end else for P,l in pairs(P)do L=L+l end end return L end

function module.Sum(t, n)
	local sum = 0;
	if n then
		for i = 1, n do
			sum = sum + t[i>#t and #t or i] or 0;
		end
	else
		for i, v in pairs(t) do
			sum = sum + v;
		end
	end
	return sum;
end
