implementation and unit test for TOPICS