moved some functions around in jmGen.py