function beginGame() public payable
            gameIsRunning
            gameNotInProgress(msg.sender) {

        address player = msg.sender;
        uint bet = msg.value;

        require(bet >= minBet && bet <= getMaxBet());

        Game memory game = Game({
            id:         uint(keccak256(block.number, block.timestamp, player, bet)),
            player:     player,
            bet:        bet,
            firstRoll:  0,
            finalRoll:  0,
            direction:  BetDirection.None,
            winnings:   0,
            when:       block.timestamp
            });

        balanceInPlay = balanceInPlay + game.bet;
        totalGamesPlayed = totalGamesPlayed + 1;
        totalBetsMade = totalBetsMade + game.bet;
        gamesInProgress[player] = game;
        rollDie(player);
        GameStarted(player, game.id, bet);
    }