refactored words.py to use config file and functions