function withdrawFromFailedLottery(uint32 lotteryId) public {
    address player = msg.sender;
    
    Lottery storage lot = lotteries[lotteryId];
    
    
    require(lot.status == 2);
    
    
    uint256 playerBalance = lot.balances[player].sub(lot.oraclizeFees / lot.participants.length);
    
    require(playerBalance > 0);

    
    lot.balances[player] = 0;
    lot.prizePool = lot.prizePool.sub(playerBalance);

    
    player.transfer(playerBalance);
  }