termination checking for treeMap now works; still several stylistic TODOs in the file