fix anagrams

Fixes compilation errors and some formatting issues.