execute as @e[tag=ToKill,tag=Red] run tag @s remove Red
execute as @e[tag=ToKill] run tag @s remove Alive
execute as @e[tag=ToSacrifice,tag=Red] run tag @s remove Red
execute as @e[tag=ToSacrifice] run tag @s remove Alive
execute as @e[tag=ToBirth] run tag @s add Alive
execute if score P Game = 1 Integer as @e[tag=ToBirth] run tag @s add Red
function main:updateboard
scoreboard players set RenderTimer Timer -20
execute if score InGame Game = 1 Integer if score TOM Game <= 1 Integer if score TurnOrder Game = 0 Integer run scoreboard players add P Game 1
execute if score InGame Game = 1 Integer if score TOM Game <= 1 Integer if score TurnOrder Game = 1 Integer run scoreboard players remove P Game 1
execute if score InGame Game = 1 Integer if score TOM Game > 1 Integer run scoreboard players add P Game 1
execute if score InGame Game = 1 Integer if score TOM Game <= 1 Integer if score P Game = 2 Integer run scoreboard players set TurnOrder Game 1
execute if score InGame Game = 1 Integer if score TOM Game <= 1 Integer if score P Game = 2 Integer run scoreboard players set DoIteration Game 1
execute if score InGame Game = 1 Integer if score TOM Game <= 1 Integer if score P Game = 2 Integer run scoreboard players set P Game 1
execute if score InGame Game = 1 Integer if score TOM Game > 1 Integer if score P Game = 2 Integer run scoreboard players set P Game 0
execute if score InGame Game = 1 Integer if score TOM Game <= 1 Integer if score P Game = -1 Integer run scoreboard players set TurnOrder Game 0
execute if score InGame Game = 1 Integer if score TOM Game <= 1 Integer if score P Game = -1 Integer run scoreboard players set DoIteration Game 1
execute if score InGame Game = 1 Integer if score TOM Game <= 1 Integer if score P Game = -1 Integer run scoreboard players set P Game 0
execute if score InGame Game = 1 Integer if score TOM Game = 2 Integer if score P Game = 0 Integer run scoreboard players set DoIteration Game 1
execute if score InGame Game = 1 Integer if score TOM Game = 3 Integer if score P Game = 1 Integer run scoreboard players set DoIteration Game 1
execute if score InGame Game = 1 Integer if score TOM Game > 3 Integer run scoreboard players set DoIteration Game 1
execute if score InGame Game = 2 Integer run scoreboard players set DoIteration Game 1
tag @e remove ToKill
tag @e remove ToSacrifice
tag @e remove ToBirth
execute at @e[tag=Board] run setblock ~ ~2 ~ air