contract AccessControl {
  /// @dev The addresses of the accounts (or contracts) that can execute actions within each roles
  address public ceoAddress;
  address public cooAddress;

  /// @dev Keeps track whether the contract is paused. When that is true, most actions are blocked
  bool public paused = false;

  /// @dev The AccessControl constructor sets the original C roles of the contract to the sender account
  function AccessControl() public {
    ceoAddress = msg.sender;
    cooAddress = msg.sender;
  }

  /// @dev Access modifier for CEO-only functionality
  modifier onlyCEO() {
    require(msg.sender == ceoAddress);
    _;
  }

  /// @dev Access modifier for COO-only functionality
  modifier onlyCOO() {
    require(msg.sender == cooAddress);
    _;
  }

  /// @dev Access modifier for any CLevel functionality
  modifier onlyCLevel() {
    require(msg.sender == ceoAddress || msg.sender == cooAddress);
    _;
  }

  /// @dev Assigns a new address to act as the CEO. Only available to the current CEO
  /// @param _newCEO The address of the new CEO
  function setCEO(address _newCEO) public onlyCEO {
    require(_newCEO != address(0));
    ceoAddress = _newCEO;
  }

  /// @dev Assigns a new address to act as the COO. Only available to the current CEO
  /// @param _newCOO The address of the new COO
  function setCOO(address _newCOO) public onlyCEO {
    require(_newCOO != address(0));
    cooAddress = _newCOO;
  }

  /// @dev Modifier to allow actions only when the contract IS NOT paused
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /// @dev Modifier to allow actions only when the contract IS paused
  modifier whenPaused {
    require(paused);
    _;
  }

  /// @dev Pause the smart contract. Only can be called by the CEO
  function pause() public onlyCEO whenNotPaused {
     paused = true;
  }

  /// @dev Unpauses the smart contract. Only can be called by the CEO
  function unpause() public onlyCEO whenPaused {
    paused = false;
  }
}
// inspired by
// https://github.com/axiomzen/cryptokitties-bounty/blob/master/contracts/KittyAccessControl.sol
function pause() public onlyCEO whenNotPaused {
     paused = true;
  }
/// @dev Pause the smart contract. Only can be called by the CEO