advanced  chSubGenerator.py