Using visitCounter to solve ties.