refactored to incorporate reading words from a text file
supporting text file