chaged file writing to append instead of write. Also some changes to building a word count