function payout() internal {
    uint payoutValue;
    uint currDay = getDay(); 

    for (uint idx = payoutIdx; idx < investors.length; idx += 1) {
      
      payoutValue = investors[idx].value / 100;

      if (balance < payoutValue) {
        
        break;
      }

      if (investors[idx].lastDay >= currDay) {
        
        
        continue;
      }

      if (investors[idx].leftPayDays <= 0) {
        
        payoutIdx = idx;
      }

      
      investors[idx].addr.send(payoutValue);
      
      investors[idx].lastDay = currDay;
      
      investors[idx].leftPayDays -= 1;

      
      balance -= payoutValue;

      
      Payout(investors[idx].addr, payoutValue);
    }

  }