change algorithm of TopicTrace (part I)