change algorithm of topic trace (final part)