matching pennies: refactor payoff code