function distributedAmountWithBlockTimestamp(ERC20Basic token, uint256 blockTimestamp) public view returns (uint256) {
        uint256 currentBalance = token.balanceOf(this);
        uint256 totalBalance = currentBalance.add(released[token]);

        if (blockTimestamp < cliff) {
            return 0;
        } else if (blockTimestamp >= endTime) {
            return totalBalance;
        } else {
            uint256 unitsPassed = blockTimestamp.sub(start).div(secondsIn1Unit); 
            uint256 unitsIn1Phase = numberOfUnits.div(numberOfPhases); 
            uint256 unitsInThisPhase;
            uint256 weight;

            if (unitsPassed < unitsIn1Phase) {
                weight = 5;
                unitsInThisPhase = unitsPassed;
                
                return unitsInThisPhase.mul(totalBalance).mul(weight).div(slice).div(unitsIn1Phase);
            } else if (unitsPassed < unitsIn1Phase.mul(2)) {
                weight = 4;
                unitsInThisPhase = unitsPassed.sub(unitsIn1Phase);
                
                
                return totalBalance.mul(5).add(unitsInThisPhase.mul(totalBalance).mul(weight).div(unitsIn1Phase)).div(slice);
            } else if (unitsPassed < unitsIn1Phase.mul(3)) {
                weight = 3;
                unitsInThisPhase = unitsPassed.sub(unitsIn1Phase.mul(2));
                
                
                return totalBalance.mul(9).add(unitsInThisPhase.mul(totalBalance).mul(weight).div(unitsIn1Phase)).div(slice);
            } else if (unitsPassed < unitsIn1Phase.mul(4)) {
                weight = 2;
                unitsInThisPhase = unitsPassed.sub(unitsIn1Phase.mul(3));
                
                
                return totalBalance.mul(12).add(unitsInThisPhase.mul(totalBalance).mul(weight).div(unitsIn1Phase)).div(slice);
            } else if (unitsPassed < unitsIn1Phase.mul(5)) {
                weight = 1;
                unitsInThisPhase = unitsPassed.sub(unitsIn1Phase.mul(4));
                
                
                return totalBalance.mul(14).add(unitsInThisPhase.mul(totalBalance).mul(weight).div(unitsIn1Phase)).div(slice);
            }
            require(blockTimestamp < endTime, "Block timestamp is expected to have not reached distribution endTime if the code even falls in here.");
        }
    }