function investment() public inState(State.Fundraising) accountNotFrozen minInvestment payable returns (uint)  {
        uint amount = msg.value;

        balanceOf[msg.sender] += amount;
        currentBalance += amount;

        uint tokenAmount = getExchangeRate(amount);
        exchangeToken.generateTokens(msg.sender, tokenAmount);
        tokensIssued += tokenAmount;

        emit FundTransfer(msg.sender, amount, true);
        emit LogFundingReceived(msg.sender, tokenAmount, tokensIssued);

        if (tokensIssued >= capTokenAmount) {
            state = State.Successful;
            emit GoalReached(fundRecipient, currentBalance);
        }

        return balanceOf[msg.sender];
    }