second version of TopN