contract StandardToken is ERC20, BasicToken, owned {

  mapping (address => mapping (address => uint256)) internal allowed;
  mapping (address => bool) public frozenAccount;
  

  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));
    require(_value <= balances[_from]);
    require(_value <= allowed[_from][msg.sender]);

    require(!frozenAccount[_from]);
    require(!frozenAccount[_to]);


    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);

    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    emit Transfer(_from, _to, _value);
    return true;
  }


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


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


  function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
    allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

  function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
    uint oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue > oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }
  
  
  function burn(uint256 _value) public returns (bool success) {
        require(balances[msg.sender] >= _value);   // Check if the sender has enough
        //balances[msg.sender] -= _value;            // Subtract from the sender

        balances[msg.sender] = balances[msg.sender].sub(_value);
        //totalSupply -= _value;                      // Updates totalSupply
        totalSupply = totalSupply.sub(_value);
        emit Burn(msg.sender, _value);
        return true;
    }

    function burnFrom(address _from, uint256 _value) onlyOwner public returns (bool success) {
        require(balances[_from] >= _value);                // Check if the targeted balance is enough
        require(_value <= allowed[_from][msg.sender]);    // Check allowance
        //balances[_from] -= _value;                         // Subtract from the targeted balance
        balances[_from] = balances[_from].sub(_value); 
        //allowed[_from][msg.sender] -= _value;             // Subtract from the sender's allowance
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); 
        //totalSupply -= _value;                              // Update totalSupply
        totalSupply = totalSupply.sub(_value);
        emit Burn(_from, _value);
        return true;
    }


    function mintToken(address target, uint256 initialSupply) onlyOwner public returns (bool success)  {
        //balances[target] += initialSupply;

        balances[target] = balances[target].add(initialSupply);

        //totalSupply += initialSupply;
        totalSupply = totalSupply.add(initialSupply);

        emit Transfer(address(0), address(this), initialSupply);
        emit Transfer(address(this), target, initialSupply);
        return true;
    }


   function freezeAccount(address target, bool freeze) onlyOwner public returns (bool success)  {
        frozenAccount[target] = freeze;
        emit FrozenFunds(target, freeze);
         return true;
   }



}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));
    require(_value <= balances[_from]);
    require(_value <= allowed[_from][msg.sender]);

    require(!frozenAccount[_from]);
    require(!frozenAccount[_to]);


    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);

    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    emit Transfer(_from, _to, _value);
    return true;
  }
/**
 * @dev Transfer tokens from one address to another
 * @param _from address The address which you want to send tokens from
 * @param _to address The address which you want to transfer to
 * @param _value uint256 the amount of tokens to be transferred
 */