“…when (CLOCK increases) (11) if (statei = 1) then colori ← the first color in 0, 1... which is not in d1colorsi ∪ d2colors i; (12) broadcast CORRECT(senderi, idi, colori, d1colorsi); statei ← 0 (13) end if; (14) if (statei = 2) then color f or child ← the first color in 0, 1.. which is not in d1colors i ∪ colori; (15) next ← any id k ∈ to colori; (16) broadcast COLOR(next, idi, colori, color f or child, d1colors i); statei ← 0 (17) end if; (18) if (statei = 3) then broadcast TERM(parenti, colori, idi); statei ← 0 end if; (19) if (statei = 4) then broadcast CORRECTED COLOR (senderi, parenti, idi, colori); statei ← 0 end if; (20) if (statei = 5) then broadcast RESUME COLORING (senderi, idi); statei ← 0 end if; (21) if (statei = 6) then broadcast CORRECTED COLOR (−1, −1, idi, corrected cli) ; statei ← 0 end if. when TERM(dest, id, color) is received do (22) if (dest = idi) then discard the message (do not execute lines 23-28) end if; (23) to colori ← to colori \ {id}; (24) if (to colori = ∅) % the neighbors of pi are properly colored % (25) then if (parenti = idi) then the root claims the graph is colored else statei ← 3 end if (26) else d1colorsi ← d1colors i ∪ {color}; next ← any id k ∈ to colori; (27) color to child ← the first color in 0, 1.. which is not in d1colorsi ∪ colori; statei ← 2 (28) end if.…”