function hasEnded() public constant returns (bool) {
        uint256 totalSupply = token.getTotalSupply();
        if ((block.timestamp < time0) || (block.timestamp < time2 && totalSupply > 500000000000000000000000)
        || (block.timestamp < time4 && totalSupply > 1000000000000000000000000)
        || (block.timestamp < time7 && totalSupply > 2500000000000000000000000)
            || (block.timestamp > time7)) return true;
        else return false;
    }