function refundBet(uint256 magicNumber) public {
        Bet storage bet = bets[magicNumber];

        address player = bet.player;
        uint256 transferredAmount = bet.transferredAmount;
        uint256 lastRevealBlock = bet.lastRevealBlock;

        require(player != address(0), "The bet slot is empty.");

        require(block.number > lastRevealBlock, "The bet is still in play.");

        player.transfer(transferredAmount);

        
        clearBet(magicNumber);
    }