added pprint, re, improved generation, minor cleanup