updated to matrix code to work with wordlist class