function calcAmountAt(
        uint256 amount,
        uint256 at,
        uint256 _totalSupply
    ) public constant returns (uint256, uint256) {
        uint256 estimate;
        uint256 discount;
        uint256 price;

        if(at >= startTimeTLP1 && at <= endTimeTLP1) {
            
            require(amount >= minimalWeiTLP1);

            price = priceTLP1;

            if(at < startTimeTLP1 + 3 days) {
                discount = 65; 

            } else if(at < startTimeTLP1 + 6 days) {
                discount = 70; 

            } else if(at < startTimeTLP1 + 9 days) {
                discount = 85; 

            } else if(at < startTimeTLP1 + 12 days) {
                discount = 100; 

            } else {
                revert();
            }

        } else if(at >= startTimeTLP2 && at <= endTimeTLP2) {
            
            require(amount >= minimalWeiTLP2);

            price = priceTLP2;

            if(at < startTimeTLP2 + 3 days) {
                discount = 60; 

            } else if(at < startTimeTLP2 + 6 days) {
                discount = 70; 

            } else if(at < startTimeTLP2 + 9 days) {
                discount = 80; 

            } else if(at < startTimeTLP2 + 12 days) {
                discount = 90; 

            } else if(at < startTimeTLP2 + 15 days) {
                discount = 100; 

            } else if(at < startTimeTLP2 + 18 days) {
                discount = 110; 

            } else if(at < startTimeTLP2 + 21 days) {
                discount = 120; 

            } else if(at < startTimeTLP2 + 24 days) {
                discount = 130; 

            } else {
                revert();
            }
        } else {
            revert();
        }

        price = price.mul(discount).div(100);
        estimate = _totalSupply.add(amount.mul(1e18).div(price));

        if(estimate > mintCapInTokens) {
            return (
                mintCapInTokens.sub(_totalSupply),
                estimate.sub(mintCapInTokens).mul(price).div(1e18)
            );
        }
        return (estimate.sub(_totalSupply), 0);
    }