reading text files from directory and count the words