mostly tournament.c