haskell anagrams
some smaller functions for clarity
simplification
minor simplification