More cleanup and format of WGGen.py