Added file handling to the word count application