contract Withdrawable {

  address public withdrawOwner;

  function Withdrawable(address _withdrawOwner) public {
    require(_withdrawOwner != address(0));
    withdrawOwner = _withdrawOwner;
  }

  /**
   * Transfers all the funs on this contract to the sender which must be withdrawOwner.
   */
  function withdraw() public {
    withdrawTo(msg.sender, this.balance);
  }

  /**
   * Transfers the given amount of funds to given beneficiary address. Must be called by the withdrawOwner.
   */
  function withdrawTo(address _beneficiary, uint _amount) public {
    require(msg.sender == withdrawOwner);
    require(_beneficiary != address(0));
    require(_amount > 0);
    _beneficiary.transfer(_amount);
  }

  /**
   * Transfer withdraw ownership to another account.
   */
  function setWithdrawOwner(address _newOwner) public {
    require(msg.sender == withdrawOwner);
    require(_newOwner != address(0));
    withdrawOwner = _newOwner;
  }

}
function withdraw() public {
  withdrawTo(msg.sender, this.balance);
}

/**
 * Transfers all the funs on this contract to the sender which must be withdrawOwner.
 */