function payAllInvitors(Group storage thisGroup, address _payer, uint256 _relevantTime, uint256 _amount, uint32 _depth) internal returns (uint256 invitationFee) {

        address invitor = thisGroup.members[_payer].invitor;
        
        if (
        
            invitor == owner ||
        
            _amount == 0 ||
        
            _depth >= thisGroup.invitationFeeDepth ||
        
            _relevantTime > thisGroup.members[_payer].joinTime.add(thisGroup.invitationFeePeriod.mul(1 days))
        ) {
            return;
        }

        
        invitationFee = _amount.mul(thisGroup.invitationFee).div(1000);
        
        
        if (invitationFee == 0) return;

        
        uint256 invitorFee = payAllInvitors(thisGroup, invitor, _relevantTime,  invitationFee, _depth.add(1));
        
        
        uint256 paid = invitationFee.sub(invitorFee);
        
        
        balances[invitor] = balances[invitor].add(paid);
        
        
        Deposit(invitor, paid, block.timestamp);
    }