Mayor Vote timer (Perp)

Hello, I want to make it so it counts down 5 seconds then players are allowed to choose who they want for mayor.

Code blew


ocal function MayorElectionStart ( UMsg )
	local numNominees = UMsg:ReadShort();
	
	GAMEMODE.VotePanel = vgui.Create("perp2_mayor_election");
	
	for i = 1, numNominees do
		local nominee = UMsg:ReadEntity();
		
		timer.Simple(1, function ( ) notification.AddLegacy("5 Seconds till the mayor is picked!", NOTIFY_GENERIC, 0 ); end);
		timer.Simple(2, function ( ) notification.AddLegacy("4 Seconds till the mayor is picked!", NOTIFY_GENERIC, 0 ); end);
		timer.Simple(3, function ( ) notification.AddLegacy("3 Seconds till the mayor is picked!", NOTIFY_GENERIC, 0 ); end);
		timer.Simple(4, function ( ) notification.AddLegacy("2 Seconds till the mayor is picked!", NOTIFY_GENERIC, 0 ); end);
		timer.Simple(5, function ( ) notification.AddLegacy("1 seconds till the mayor is picked!", NOTIFY_GENERIC, 0 ); end);

			
		if (nominee && IsValid(nominee)) then
			GAMEMODE.VotePanel:AddPlayer(nominee);
		end
	end
end
usermessage.Hook("perp_mayor_election", MayorElectionStart);

local function MayorElectionFinish ( UMsg )
	local ent = UMsg:ReadEntity();
	local numVotes = UMsg:ReadShort();
	
	
	
	if (ent == LocalPlayer()) then
		LocalPlayer():Notify("You won mayordom with " .. numVotes .. " votes.");
	elseif (ent && IsValid(ent)) then
		LocalPlayer():Notify(ent:GetRPName() .. " won mayordom with " .. numVotes .. " votes.");
	end
	
	if (GAMEMODE.VotePanel) then
		GAMEMODE.VotePanel:Remove();
		GAMEMODE.VotePanel = nil;
	end
	
	GAMEMODE.IsRunningForMayor = nil;
end
usermessage.Hook("perp_mayor_end", MayorElectionFinish);

What’s wrong with the code?

I want it too countdown then, they will be able to choose who they want for mayor.