Table.sort isn't sorting my parts?

I haven’t used table.sort before so excuse my lack of understanding, but I am trying to sort parts by their name, and it isn’t sorting them for some reason. I just need a bit of help understanding how table.sort works.
here’s my code

local parts = game.Workspace:FindFirstChild("epicparts"):GetChildren()
table.sort(parts, function(a,b)
	print("folder a:"..a.Name.." folder b:"..b.Name)
	return a.Name < b.Name
end)
while wait(1) do
	if game.Workspace:FindFirstChild("epicparts") ~= nil then
		local folder = game.Workspace:FindFirstChild("epicparts"):GetChildren()
		table.sort(folder, function(a,b)
			print("folder a:"..a.Name.." folder b:"..b.Name)
			return a.Name < b.Name
		end)
		for i, v in ipairs(parts) do
			for b, e in ipairs(folder) do
				if v ~= e then
					print(v.Name .." is not ".. e.Name)
				end
			end
		end
	else
		game.Players.LocalPlayer:Kick()
	end
end

here are the parts im trying to sort
image
here is the outcome
image
it says it sorted them, but they arent sorted

This block is checking all items in folder for each item in parts. Since the script is only outputting if there is a problem, you are only seeing when it evaluates for the incorrect part.

Running this block:

for i, v in ipairs(parts) do
	print(v.Name .. (v.Name == folder[i].Name and " matches " or " is not ") .. folder[i].Name)
end

Shows that your sort is working just fine.

thank you! I didn’t realize that I should only run 1 for loop!