function invest(uint32 _group) payable public {
        address investor = msg.sender;
        Group storage thisGroup = groups[_group];
        uint32 round = thisGroup.currentRound;
        Round storage thisRound = thisGroup.rounds[round];
        
        
        require(thisGroup.active || thisRound.totalInvestors > 0);
        
        
        require(msg.value == thisGroup.investment);
        
        require(thisGroup.members[investor].joinTime > 0);
        
        require(! isInvestorInRound(thisRound, investor));
        
        
        Invest(investor, _group, round, block.timestamp);

        
        uint256 ownerFee = msg.value.mul(thisGroup.ownerFee).div(1000);
        balances[owner] = balances[owner].add(ownerFee);
        Deposit(owner, ownerFee, block.timestamp);
                
        uint256 investedSumLessOwnerFee = msg.value.sub(ownerFee);

        uint256 invitationFee = payAllInvitors(thisGroup, investor, block.timestamp, investedSumLessOwnerFee, 0);

        uint256 investedNetSum = investedSumLessOwnerFee.sub(invitationFee);
        
        
        thisRound.investorMapping[investor] = thisRound.totalInvestors;
        thisRound.investments[thisRound.totalInvestors] = Investment({
            investor: investor,
            sum: investedNetSum,
            time: block.timestamp});
        
        thisRound.totalInvestors = thisRound.totalInvestors.add(1);
        thisRound.totalInvestment = thisRound.totalInvestment.add(investedNetSum);
        
        
        if (thisRound.totalInvestors == thisGroup.roundSize) {
            thisGroup.currentRound = thisGroup.currentRound.add(1);
            thisRound.lastBlock = block.number;
        }

        
        address winner;
        string memory reason;
        (winner, reason) = checkWinnerInternal(thisGroup);
        if (winner != 0)
            declareWinner(_group, winner);
    }