added first level topic names
optimized a loop