Could have been simpler if I had picked up on the fact that I can alphabetise the letters and reconstruct and compare the word as a whole. I had alphabetised the letters and compared them one at a time. That created a more difficult challenge where I had to deal with what happened if the number of letters was different between the two words,
That's what caused all my spaghetti here. But it does work