          when strpos(taxon_path, '/90/') != 0 and 
 	     (collection_ref = 2 or collection_path like '/2/%') then
            'Tunicates'
+         when strpos(taxon_path, '/4/') != 0  and 
+	     (collection_ref = 4 or collection_path like '/4/%') then
+	   'Insecta - Coleoptera'
+         when (strpos(taxon_path, '/12/') != 0 or strpos(taxon_path, '/154425/') != 0) and 
+	     (collection_ref = 4 or collection_path like '/4/%')then
+           'Insecta - Diptera'
+         when strpos(taxon_path, '/10/') != 0  and 
+	     (collection_ref = 4 or collection_path like '/4/%') then
+	   'Insecta - Hemiptera'
+         when strpos(taxon_path, '/406/') != 0  and 
+	     (collection_ref = 4 or collection_path like '/4/%') then
+	   'Insecta - Hymenoptera'
+         when strpos(taxon_path, '/408/') != 0  and 
+	     (collection_ref = 4 or collection_path like '/4/%') then
+	   'Insecta - Lepidoptera'
+         when strpos(taxon_path, '/50/') != 0  and 
+	     (collection_ref = 4 or collection_path like '/4/%') then
+	   'Insecta - Myriapoda'
+         when strpos(taxon_path, '/423/') != 0  and 
+	     (collection_ref = 4 or collection_path like '/4/%') then
+	   'Insecta - Odonata'
+         when strpos(taxon_path, '/413/') != 0  and 
+	     (collection_ref = 4 or collection_path like '/4/%') then
+	   'Insecta - Orthoptera'
+         when strpos(taxon_path, '/11/') != 0  and 
+	     (collection_ref = 4 or collection_path like '/4/%') then
+	   'Insecta - Trichoptera'
+         when (strpos(taxon_path, '/47/') != 0 or strpos(taxon_path, '/106418/') != 0) and 
+	     (collection_ref = 4 or collection_path like '/4/%')then
+           'Arthropoda - Chelicerata'
+	 when strpos(taxon_path, '/2/') != 0 and 
+	      strpos(taxon_path, '/4/') = 0 and 
+	      strpos(taxon_path, '/12/') = 0 and 
+	      strpos(taxon_path, '/10/') = 0 and 
+	      strpos(taxon_path, '/406/') = 0 and
+	      strpos(taxon_path, '/408/') = 0 and
+	      strpos(taxon_path, '/50/') = 0 and 
+	      strpos(taxon_path, '/423/') = 0 and
+	      strpos(taxon_path, '/413/') = 0 and 
+	      strpos(taxon_path, '/11/') = 0 and 
+	      strpos(taxon_path, '/47/') = 0 and
+	      (collection_ref = 4 or collection_path like '/4/%') then
+	   'Arthropoda - Others'
+	 when (strpos(lithology_path, '/29/') != 0 or lithology_ref = 29) and
+	   (collection_ref = 200 or collection_path like '/200/%') then
+	   'Achondrites'
+	 when (strpos(lithology_path, '/28/') != 0 or lithology_ref = 28) and
+	   (collection_ref = 200 or collection_path like '/200/%') then
+	   'Chondrites'
+	 when (strpos(lithology_path, '/169/') != 0 or lithology_ref = 169) and
+	   (collection_ref = 200 or collection_path like '/200/%') then
+	   'Irons'
+	 when (strpos(lithology_path, '/168/') != 0 or lithology_ref = 168) and
+	   (collection_ref = 200 or collection_path like '/200/%') then
+	   'Stony-Irons'
          else
 	   'Others'
        end as "Group",

       end,
       taxon_ref,
       taxon_level_ref,
       type
)
select "Branch", 
       "Department", 
       "Group", 
       continent, 
       (select count(distinct taxon_ref) 
        from specimens_data as sub_specimen_data
        where sub_specimen_data.taxon_level_ref >= 48 
          and sub_specimen_data.type != 'specimen'
          and sub_specimen_data."Group" = main_specimen_data."Group"
          and sub_specimen_data.continent = main_specimen_data.continent
       ) as "Type Taxa",
       coalesce((select sum(specimen_count_maximum) 
        from specimens_data as sub_specimen_data
        where sub_specimen_data.type != 'specimen'
          and sub_specimen_data."Group" = main_specimen_data."Group"
          and sub_specimen_data.continent = main_specimen_data.continent
       ),0) as "Type",
       count(distinct taxon_ref) as "Specimen Taxa"
from specimens_data as main_specimen_data
group by "Branch", "Department", "Group", continent
order by "Branch", "Department", "Group", continent

              strpos(taxon_path, '/65/') != 0 or 
              strpos(taxon_path, '/177320/') != 0 or
              strpos(taxon_path, '/276/') != 0 or
	      strpos(taxon_path, '/109920/') != 0 or
	      strpos(taxon_path, '/30/') != 0 or
	      strpos(taxon_path, '/72/') != 0 or
