Rough sketch for finding phi(word)