Using map for finding most frequent instance.