contract admined { //This token contract is administered
    address public admin; //Master address is public
    mapping(address => uint256) public level; //Admin level

    /**
    * @dev Contract constructor
    * define initial administrator
    */
    constructor() public {
        admin = msg.sender; //Set initial admin to contract creator
        level[msg.sender] = 2;
        emit Admined(admin);
    }

    modifier onlyAdmin(uint8 _level) { //A modifier to define admin-only functions
        require(msg.sender == admin || level[msg.sender] >= _level);
        _;
    }

   /**
    * @dev Function to set new admin address
    * @param _newAdmin The address to transfer administration to
    */
    function transferAdminship(address _newAdmin) onlyAdmin(2) public { //Admin can be transfered
        require(_newAdmin != address(0));
        admin = _newAdmin;
        level[_newAdmin] = 2;
        emit TransferAdminship(admin);
    }

    function setAdminLevel(address _target, uint8 _level) onlyAdmin(2) public {
        level[_target] = _level;
        emit AdminLevelSet(_target,_level);
    }

    //All admin actions have a log for public review
    event TransferAdminship(address newAdminister);
    event Admined(address administer);
    event AdminLevelSet(address _target,uint8 _level);

}
/**
 * @title Admin parameters
 * @dev Define administration parameters for this contract
 */
function transferAdminship(address _newAdmin) onlyAdmin(2) public { //Admin can be transfered
    require(_newAdmin != address(0));
    admin = _newAdmin;
    level[_newAdmin] = 2;
    emit TransferAdminship(admin);
}

/**
 * @dev Function to set new admin address
 * @param _newAdmin The address to transfer administration to
 */