fixed file read-in while loop to properly count recurrences of words