formed the hashmap for counts