generating words from dictionary (working)