function doBet() public payable notFromContract {

    
    if (m_timer.timeLeft().isZero()) {
      bettor.transfer(bankAmount);
      emit LogNewWinner(bettor, level, bankAmount, now);

      bankAmount = nextLevelBankAmount;
      nextLevelBankAmount = 0;
      level++;
      emit LogNewLevel(level, bankAmount, now);
    }

    Bet.bet memory bet = Bet.New(msg.sender, msg.value);
    bet.amount.requireNotZero();

    
    if (bet.excess.notZero()) {
      bet.transferExcess();
      emit LogSendExcessOfEther(bet.bettor, bet.excess, now);
    }

    
    nextLevelBankAmount += m_nextLevelPercent.mul(bet.amount);
    bankAmount += m_bankPercent.mul(bet.amount);
    adminsAddress.send(m_adminsPercent.mul(bet.amount));
  
    m_timer.start(bet.duration);
    bettor = bet.bettor;

    emit LogNewBet(bet.bettor, bet.amount, bet.duration, level, now);
  }