experimental build-in writing functionality via the java parser. does not work when called as of now; the parser fails to read gTh from file in its current format