unless (exists $$dataref{$eid}{"ALL"}{"MatchesPeopleEnded"}){
my %a :shared;
$$dataref{$sid}{"ALL"}{"MatchesEnded"}=\%a;
}
####
$$dataref{$sid}{"ALL"}{"MatchesStarted"}++;
$$dataref{$sid}{"ALL"}{"MatchesPeopleStarted"} += $tn;
$$dataref{$sid}{$whichco}{"MatchesPeopleStarted"} += $tn;
$$dataref{$sid}{$whichco}{"MatchesStarted"}++;
$$dataref{$eid}{"ALL"}{"MatchesEnded"}++;
$$dataref{$eid}{"ALL"}{"MatchesPeopleEnded"} += $tn;
$$dataref{$eid}{$whichco}{"MatchesPeopleEnded"} += $tn;
$$dataref{$eid}{$whichco}{"MatchesEnded"}++;
####
$$dataref{$sid} //= &shared({});
$$dataref{$sid}{"ALL"} //= &shared({});
$$dataref{$sid}{"ALL"}{"MatchesStarted"}++;
$$dataref{$sid}{"ALL"}{"MatchesPeopleStarted"} += $tn;
$$dataref{$sid}{$whichco} //= &shared({});
$$dataref{$sid}{$whichco}{"MatchesPeopleStarted"} += $tn;
$$dataref{$sid}{$whichco}{"MatchesStarted"}++;
$$dataref{$eid} //= &shared({});
$$dataref{$eid}{"ALL"} //= &shared({});
$$dataref{$eid}{"ALL"}{"MatchesEnded"}++;
$$dataref{$eid}{"ALL"}{"MatchesPeopleEnded"} += $tn;
$$dataref{$eid}{$whichco} //= &shared({});
$$dataref{$eid}{$whichco}{"MatchesPeopleEnded"} += $tn;
$$dataref{$eid}{$whichco}{"MatchesEnded"}++;