anagrams, pattern matching, reversing linked list