Added generating topics to the code.