function withdraw() public nonReentrant onlyInvestor {
        require(creationDate.add(twoWeeks)<=block.timestamp);
        require(lastWithdraw[msg.sender].add(3 days) <= block.timestamp);
        require(address(this).balance > 0);

        uint fullDividends;
        uint marketingFee;

        investors[msg.sender].emergencyAvailable = false;
        address receiver = msg.sender;

        fullDividends = calculatePercents(msg.sender);
        fullDividends = fullDividends.sub(sendedDividends[receiver]);

        if(fullDividends < investors[msg.sender].fullInvestment.mul(130).div(100)){
            marketingFee = fullDividends.mul(5).div(100);
            marketingAddress.transfer(marketingFee);
        }

        lastWithdraw[msg.sender] = block.timestamp;
        
        if(address(this).balance >= fullDividends.sub(marketingFee)) {
            receiver.transfer(fullDividends.sub(marketingFee));
        } else{
            receiver.transfer(address(this).balance);
        }

        sendedDividends[receiver] = sendedDividends[receiver].add(fullDividends);
        investors[receiver].withdrawn = true;


        emit Withdraw(receiver, fullDividends);
    }