contract Token is admined {

    uint256 public totalSupply;
    mapping (address => uint256) balances; //Balances mapping
    mapping (address => mapping (address => uint256)) allowed; //Allowance mapping

    function balanceOf(address _owner) public constant returns (uint256 bal) {
        return balances[_owner];
    }

    function transfer(address _to, uint256 _value) endOfLock public returns (bool success) {
        require(balances[msg.sender] >= _value);
        balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value);
        balances[_to] = SafeMath.add(balances[_to], _value);
        Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) endOfLock public returns (bool success) {
        require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value);
        balances[_to] = SafeMath.add(balances[_to], _value);
        balances[_from] = SafeMath.sub(balances[_from], _value);
        allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value);
        Transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value) endOfLock public returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;
    }

    function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
        return allowed[_owner][_spender];
    }

    function mintToken(address _target, uint256 _mintedAmount) onlyAdmin endOfLock public {
        balances[_target] = SafeMath.add(balances[_target], _mintedAmount);
        totalSupply = SafeMath.add(totalSupply, _mintedAmount);
        Transfer(0, this, _mintedAmount);
        Transfer(this, _target, _mintedAmount);
    }

    function burnToken(address _target, uint256 _burnedAmount) onlyAdmin endOfLock public {
        balances[_target] = SafeMath.sub(balances[_target], _burnedAmount);
        totalSupply = SafeMath.sub(totalSupply, _burnedAmount);
        Burned(_target, _burnedAmount);
    }
    //This is an especial Admin-only function to make massive tokens assignments
    function batch(address[] data,uint256 amount) onlyAdmin public { //It takes an array of addresses and an amount
        require(balances[this] >= data.length*amount); //The contract must hold the needed tokens
        for (uint i=0; i<data.length; i++) { //It moves over the array
            address target = data[i]; //Take an address
            balances[target] = SafeMath.add(balances[target], amount); //Add an amount to the target address
            balances[this] = SafeMath.sub(balances[this], amount); //Sub that amount from the contract
            allowed[this][msg.sender] = SafeMath.sub(allowed[this][msg.sender], amount); //Sub allowance from the contract creator over the contract
            Transfer(this, target, amount); //log every transfer
        }
    }

    //Events to log transactions
    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
    event Burned(address indexed _target, uint256 _value);
}
function balanceOf(address _owner) public constant returns (uint256 bal) {
    return balances[_owner];
}

//Allowance mapping