refined debug output, added color TM