function refundGame(uint commit) external {
        Game storage bet = bets[commit];
        bet.finished = true;
        uint amount = bet.amount;

        require (amount != 0, "Game should be in an 'active' state");

        require (block.number > bet.placeBlockNumber + BET_EXPIRATION_BLOCKS, "Game has not expired yet");

        bet.amount = 0;

        uint diceWinAmount;
        uint inviteProfit;
        (diceWinAmount,inviteProfit) = getDiceWinAmount(amount, bet.rollUnder, bet.inviter);

        lockedInBets -= uint128(diceWinAmount);

        sendFunds(bet.player, amount);
    }