Fixed some stuff in topic algo

asdf