function _distributeTokens(address account, address referral) internal {
    require(nextClaimTime(account) <= block.timestamp); 

    
    if (!_recipientList[account].exists) {
      _recipients.push(account);
      _recipientList[account].exists = true;

      
      if (referral != address(0)) {
        _recipientList[account].referral = referral;
        _referralList[referral].recipients.push(account);
      }
    }

    
    _recipientList[account].lastUpdate = block.timestamp; 
    _recipientList[account].tokens = _recipientList[account].tokens.add(_dailyRate);

    
    _totalDistributedTokens = _totalDistributedTokens.add(_dailyRate);

    
    _token.transfer(account, _dailyRate);

    
    if (_recipientList[account].referral != address(0)) {
      
      address firstReferral = _recipientList[account].referral;

      uint256 referralEarnedTokens = referralTokens();

      
      _referralList[firstReferral].tokens = _referralList[firstReferral].tokens.add(referralEarnedTokens);

      
      _totalDistributedTokens = _totalDistributedTokens.add(referralEarnedTokens);

      
      _token.transfer(firstReferral, referralEarnedTokens);
    }
  }