File writing assignment, from chapter 6.