second commit for stateanagrams.js, can't tell if this thing works or not...