Messing around with file writing. The object here is to write to the
file only once per instance. Maybe abandon writing so much and just save
to file in the background and maybe when windowClosing() occurs.