Updated Top metric

incorporated comments from earlier pull request. 
Why do we need defaultdict here?