adapted query.rb to the actual topics