got printing and appending to the end of files working