library SafeMath {
 
  /**
   * Add two uint256 values, throw in case of overflow.
   * @param x first value to add
   * @param y second value to add
   * @return x + y
   */
  function safeAdd (uint256 x, uint256 y) internal pure returns (uint256) {
    uint256 z = x + y;
    require(z >= x);
    return z;
  }

  /**
   * Subtract one uint256 value from another, throw in case of underflow.
   * @param x value to subtract from
   * @param y value to subtract
   * @return x - y
   */
  function safeSub (uint256 x, uint256 y) internal pure returns (uint256) {
    require (x >= y);
    uint256 z = x - y;
    return z;
  }
}
function safeAdd (uint256 x, uint256 y) internal pure returns (uint256) {
  uint256 z = x + y;
  require(z >= x);
  return z;
}

/**
 * Add two uint256 values, throw in case of overflow.
 * @param x first value to add
 * @param y second value to add
 * @return x + y
 */