revised code for winning_diags