newTable.xsort=function(b,W)local H=newTable.keys(b)table.sort(H,W)return function()if#H==0 then return nil end local W=table.remove(H,1)return W,b[W]end end

newTable.xsort = function(tbl, sort)
	local keys = newTable.keys(tbl)
	
	table.sort(keys, sort)
	
	return function()
		if #keys == 0 then
			return nil
		end
		
		local nextValue = table.remove(keys, 1)
		
		return nextValue, tbl[nextValue]
	end
end
