function calculatePercents(address _for) internal view returns(uint){
        uint dividends;
        uint fullDividends;
        uint count = 0;
        for(uint i = 1; i <= investors[_for].eachInvestmentValues.length; i++) {
            if(i == investors[_for].eachInvestmentValues.length){
                if(doublePercentsEnd[_for].length > count && doublePercentsEnd[_for][count] < block.timestamp){
                    dividends = getDividendsForOnePeriod(investors[_for].timestampsForInvestments[i.sub(1)], block.timestamp, investors[_for].eachInvestmentValues[i.sub(1)], doublePercentsEnd[_for][count++]);
                }
                else{
                    dividends = getDividendsForOnePeriod(investors[_for].timestampsForInvestments[i.sub(1)], block.timestamp, investors[_for].eachInvestmentValues[i.sub(1)], 0);
                }

            } else {
                if(doublePercentsEnd[_for].length > count && doublePercentsEnd[_for][count] < investors[_for].timestampsForInvestments[i]){
                    dividends = getDividendsForOnePeriod(investors[_for].timestampsForInvestments[i.sub(1)], investors[_for].timestampsForInvestments[i], investors[_for].eachInvestmentValues[i.sub(1)], doublePercentsEnd[_for][count++]);
                }
                else {
                    dividends = getDividendsForOnePeriod(investors[_for].timestampsForInvestments[i.sub(1)], investors[_for].timestampsForInvestments[i], investors[_for].eachInvestmentValues[i.sub(1)], 0);
                }

            }
            fullDividends = fullDividends.add(dividends);
        }
        return fullDividends;
    }