breaking of the ties, storing action visit count, terminal states have value 0