contract PersonalERC20Factory {

  // index of created contracts

  mapping (address => bool) public validContracts; 
  address[] public contracts;

  // useful to know the row count in contracts index

  function getContractCount() 
    public
    view
    returns(uint contractCount)
  {
    return contracts.length;
  }

  // get all contracts

  function getDeployedContracts() public view returns (address[] memory)
  {
    return contracts;
  }

  // deploy a new contract

  function newPersonalERC20(string memory name, string memory symbol, uint256 init, address owner)
    public
    returns(address)
  {
    PersonalERC20 c = new PersonalERC20(name, symbol, init, owner);
    validContracts[c] = true;
    contracts.push(c);
    return c;
  }
}
function getContractCount() 
    public
    view
    returns(uint contractCount)
  {
    return contracts.length;
  }
// useful to know the row count in contracts index