+EOF
+}
+
+sub print_footer {
+ my $dbh = shift;
+ wloh_common::output_last_sync($dbh);
+
+ print <<"EOF";
+ </body>
+</html>
+EOF
+}
+
+my $aux_parms = get_auxillary_parameters($dbh);
+my $match_stddev = $aux_parms->{-2} * sqrt(2.0);
+
+my $season;
+my $division = $cgi->param('divisjon') // -1;
+my $subdivision = $cgi->param('avdeling') // -1;
+
+my $season = get_max_season($dbh);
+my @divisions = get_divisions($dbh, $season);
+$division = 1 if (!grep { $_ == $division } @divisions);
+my @subdivisions = get_subdivisions($dbh, $season, $division);
+$subdivision = 1 if (!grep { $_ == $subdivision } @subdivisions);
+
+get_players_and_ratings($dbh, $season, $division, $subdivision);
+my @matches = get_matches($dbh, $season, $division, $subdivision);
+my $cov = get_covariance_matrix($dbh, keys %players);
+
+print_header($cgi, 'WLoH-plasseringsannsynlighetsberegning');
+
+POSIX::setlocale(&POSIX::LC_ALL, 'nb_NO.UTF-8');
+printf <<"EOF", $match_stddev;