fixed it so that it actually writes stuff out to a file.