Implemented a dictionary to speed up word lookups