spiral sort refactor
is it an anagram