contract ReleaseableToken is LockableToken {
  uint256 public createTime;
  uint256 public nextReleaseTime;
  uint256 public nextReleaseAmount;
  uint256 standardDecimals = 10000;
  uint256 public totalSupply;
  uint256 public releasedSupply;

  function ReleaseableToken(uint256 initialSupply, uint256 initReleasedSupply, uint256 firstReleaseAmount) public {
    createTime = now;
    nextReleaseTime = now;
    nextReleaseAmount = firstReleaseAmount;
    totalSupply = standardDecimals.mul(initialSupply);
    releasedSupply = standardDecimals.mul(initReleasedSupply);
    balances[msg.sender] = standardDecimals.mul(initReleasedSupply);
  }

  /**
  * @dev Release the frozen token(totalSupply - releasedSupply) every 26 weeks.
  * @return An uint256 representing the amount.
  */
  function release() public whenNotPaused returns(uint256 _releaseAmount) {
    require(nextReleaseTime <= now);

    uint256 releaseAmount = 0;
    uint256 remainderAmount = totalSupply.sub(releasedSupply);
    if (remainderAmount > 0) {
      releaseAmount = standardDecimals.mul(nextReleaseAmount);
      if (releaseAmount > remainderAmount)
        releaseAmount = remainderAmount;
      releasedSupply = releasedSupply.add(releaseAmount);
      balances[owner] = balances[owner].add(releaseAmount);
      emit Release(msg.sender, releaseAmount, nextReleaseTime);
      nextReleaseTime = nextReleaseTime.add(26 * 1 weeks);
      nextReleaseAmount = nextReleaseAmount.sub(nextReleaseAmount.div(4));
    }
    return releaseAmount;
  }

  event Release(address receiver, uint256 amount, uint256 releaseTime);
}
function release() public whenNotPaused returns(uint256 _releaseAmount) {
  require(nextReleaseTime <= now);

  uint256 releaseAmount = 0;
  uint256 remainderAmount = totalSupply.sub(releasedSupply);
  if (remainderAmount > 0) {
    releaseAmount = standardDecimals.mul(nextReleaseAmount);
    if (releaseAmount > remainderAmount)
      releaseAmount = remainderAmount;
    releasedSupply = releasedSupply.add(releaseAmount);
    balances[owner] = balances[owner].add(releaseAmount);
    emit Release(msg.sender, releaseAmount, nextReleaseTime);
    nextReleaseTime = nextReleaseTime.add(26 * 1 weeks);
    nextReleaseAmount = nextReleaseAmount.sub(nextReleaseAmount.div(4));
  }
  return releaseAmount;
}

/**
 * @dev Release the frozen token(totalSupply - releasedSupply) every 26 weeks.
 * @return An uint256 representing the amount.
 */