SECOND ATTEMPT WITH CLEANED CODE, RANDOM GENERATOR NOW WRITES CORRECTLY TO STATS FILE.
ZPA GENERATOR STILL SUCKS