diff --git a/code/03_TaxonomicBackbone.Rmd b/code/03_TaxonomicBackbone.Rmd
index 2980f5a888cbf6b64de6b0aad90d7fc31a9fcb13..27e83ce7ce871c8e650af4cf457555ddeb51a1c5 100644
--- a/code/03_TaxonomicBackbone.Rmd
+++ b/code/03_TaxonomicBackbone.Rmd
@@ -22,16 +22,15 @@ urlcolor: blue
 </center>
 
 
-***
 
 **Timestamp:** `r date()`  
 **Drafted:** Francesco Maria Sabatini  
 **Revised:** Helge Bruelheide, Borja Jimenez-Alfaro  
-**Version:** 1.1  
+**Version:** 1.2  
 
 **Changes to Version 1.1** Additional manual cleaning of species names from BJA, UJ and HB.  
+**Changes to Version 1.2** Changed order of ranking TNRS databases, when a name is matched across more than 1 DB; Using cleaned version of DT table (after stripping non-closed quotation marks). Additionally check with TPL those species that, even if resolved in TNRS, did not return an accepted name.
 
-***
 
 # Data preparation
 ## Load packages 
@@ -60,13 +59,13 @@ mushroom <- c("Mycena", "Boletus", "Russula","Calocybe","Collybia","Amanita","Am
    "Agaricus","Alnicola", "Amanitina", "Bovista", "Cheilymenia","Clavulinopsis", "Clitocybe", "Entoloma", "Geaster", "Inocybe",
   "Laccaria", "Laetiporus", "Lepista", "Macrolepiota", "Macrolepis", "Marasmius", "Panaeolus", "Psathyrella", "Psilocybe", 
   "Rickenella", "Sarcoscypha", "Vascellum", "Ramaria", 
-  "Amphoroblasia", "Amphoroblastia")
+  "Amphoroblasia", "Amphoroblastia", "Agrocybe")
 ```
 
 
 ```{r, eval=F}
 #import and save splot names from DT table
-DT0 <- readr::read_delim("../sPlot_data_export/sPlot_3_0_2_species.csv", 
+DT0 <- readr::read_delim("../sPlot_data_export/sPlot_3_0_2_species_test.csv", 
                             delim="\t", 
                          col_type = cols(
                                 PlotObservationID = col_double(),
@@ -98,7 +97,7 @@ splot.species <- DT0 %>%
 write_csv(splot.species, path = "../_derived/splot3.0.2.species.csv")
 ```
 
-!!! I used the column from TRY with the full species name, not the column with only a two-word name strings
+!!! I used the column from TRY with the full species name, not the column with only two-word name strings
 
 ```{r, message=F}
 splot.species <- read_csv("../_derived/splot3.0.2.species.csv")
@@ -139,7 +138,7 @@ spec.list.TRY.sPlot <- splot.species %>%
             
  #Number of species unique and in common across databases
 ```
-The *total number of species* in the backbone is `r nrow(spec.list.TRY.sPlot)`.
+The **total number of species** in the backbone is `r nrow(spec.list.TRY.sPlot)`.
 
 ```{r echo=F}
 knitr::kable(spec.list.TRY.sPlot %>%
@@ -154,7 +153,6 @@ knitr::kable(spec.list.TRY.sPlot %>%
     kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"), 
                   latex_options = "basic", 
                   full_width = F, position = "center")
-
 ```
 
 ## A-priori cleaning of names
@@ -185,6 +183,7 @@ spec.list.TRY.sPlot <- spec.list.TRY.sPlot %>%
   mutate(Species=gsub('×', '', Species, fixed=TRUE)) %>%
   mutate(Species=gsub('like ', '', Species, fixed=TRUE)) %>% 
   mutate(Species=gsub(',', '', Species, fixed=TRUE)) %>%
+  mutate(Species=gsub('#', '', Species, fixed=TRUE)) %>%
   mutate(Species=gsub('_', ' ', Species))
 ```
 
@@ -220,8 +219,8 @@ write_csv(spec.list.TRY.sPlot %>% dplyr::select(Species) %>% distinct() ,
           path = "../_derived/TNRS_submit/tnrs_submit_iter1.csv")
 ```
 
-The csv-file of species names was submitted to Taxonomic Name Resolution Service web application (Boyle et al. 2013, iPlant Collaborative (2015)). TNRS version 4.0 was used, which became available in August 2015 (this version also included The Plant List version 1.1).
-TNRS was queried on 27/07/2019.
+The csv-file of species names was submitted to Taxonomic Name Resolution Service web application (Boyle et al. 2013, iPlant Collaborative (2015). TNRS version 4.0 was used, which became available in August 2015 (this version also included The Plant List version 1.1).
+TNRS was queried on 24/02/2020.
 
 
 ## TNRS settings {#ID}
@@ -278,6 +277,39 @@ tnrs.res0 <- readr::read_delim("../_derived/TNRS_submit/tnrs_results_iter1.txt",
 Best matches are selected in successive steps, depending at which taxonomic level each record was matched. Records were sorted based on decreasing match scores. Matches at low taxonomic level (variety, subspecies) were favoured over matches at high taxonomic levels (family, sections). When having exactly the same ranks, the records were ranked based on their source, as explained above.  
 For each name submitted, only the record having the highest rank was retained.
 
+```{r}
+#reorder priorities
+TNRS.priorities <- c("tpl;gcc;tropicos;usda", 
+                    "tpl;gcc;tropicos",
+                    "tpl;gcc;usda",
+                    "tpl;ildis;tropicos",
+                    "tpl;ildis;usda",
+                    "tpl;tropicos;usda",
+                    "tpl;gcc",
+                    "tpl;ildis",
+                    "tpl;tropicos",
+                    "tpl;usda",
+                        
+                    
+                    "gcc;tropicos;usda",
+                    "gcc;tropicos",
+                    "tropicos;gcc",
+                    "gcc;usda", 
+                    "gcc",
+                    
+                    "ildis;tropicos;usda",
+                    "ildis;tropicos",
+                    "ildis;usda",
+                    "ildis", 
+                    
+                    "tpl",  # move tpl down the list, 
+                            # because for legumes and composites, 
+                            # tpl relies on gcc or ILDIS
+                    "tropicos;usda",
+                    "tropicos",
+                    "usda"  )
+```
+
 
 ```{r}
 tnrs.res <- tnrs.res0 %>%
@@ -287,31 +319,10 @@ tnrs.res <- tnrs.res0 %>%
                                            "infraspecies", "forma", "race",
                                            "nothosubspecies", "proles", "monstr",
                                            "series"))) %>%
-  mutate(Source=factor(Source, levels=c("tpl",    #reorder priorities
-                                        "tpl;gcc",
-                                        "tpl;gcc;tropicos",
-                                        "tpl;gcc;tropicos;usda",
-                                        "tpl;gcc;usda",
-                                        "tpl;ildis",
-                                        "tpl;ildis;tropicos",
-                                        "tpl;ildis;usda",
-                                        "tpl;tropicos",
-                                        "tpl;tropicos;usda",
-                                        "tpl;usda",
-                                        "gcc",
-                                        "gcc;tropicos",
-                                        "gcc;tropicos;usda",
-                                        "gcc;usda", 
-                                        "ildis", 
-                                        "ildis;tropicos",
-                                        "ildis;tropicos;usda",
-                                        "ildis;usda",
-                                        "tropicos",
-                                        "tropicos;gcc",
-                                        "tropicos;usda",
-                                        "usda"  ))) %>%
+  mutate(Source=factor(Source, levels=TNRS.priorities)) %>%
   mutate(Taxonomic_status=factor(Taxonomic_status, 
-                                levels=c("Accepted","Synonym", "No opinion","Invalid","Illegitimate","Misapplied","Rejected name"))) %>%
+                                levels=c("Accepted","Synonym", "No opinion","Invalid",
+                                         "Illegitimate","Misapplied","Rejected name"))) %>%
   #filter(Taxonomic_status %in% c("Accepted", "Synonym")) %>%
   arrange(Name_number, 
           desc(Infraspecific_epithet_2_score),
@@ -321,8 +332,8 @@ tnrs.res <- tnrs.res0 %>%
           desc(Family_score),
           desc(Name_score),
           desc(Overall_score), 
-          #Taxonomic_status,
-          Source) %>%
+          Source, 
+          Taxonomic_status) %>%
   group_by(Name_submitted) %>%
   slice(1)
 ```
@@ -897,7 +908,10 @@ tnrs.submit.iter2 <- data.frame(old=tnrs.res.uncertain$Name_submitted) %>%
   mutate(new=gsub('xDactyloden st-quintini', 'Dactylodenia st-quintinii', new)) %>%
   mutate(new=gsub('Zizyphus sp1 IUCN1', 'Zizyphus', new)) %>%
   mutate(new=gsub('Zwiebel Lilaceae steril', 'Lilaceae', new)) %>%
-  mutate(new=gsub('Zwstr faurea', 'Faurea', new))
+  mutate(new=gsub('Zwstr faurea', 'Faurea', new)) %>% 
+  mutate(new=gsub('Quercus crispla', 'Quercus crispula', new)) %>% 
+  mutate(new=gsub('Corallorrhiza', 'Corallorhiza', new))
+  
   
 
 # delete remaining records of mushroom species
@@ -954,14 +968,7 @@ tnrs.res.iter2 <- tnrs.res.iter2.raw %>%
                                            "supersection", "infraspecies", "forma", 
                                            "race", "nothosubspecies", "proles", 
                                            "monstr", "series"))) %>%
-  mutate(Source=factor(Source, levels=c("tpl",    #reorder priorities
-                                        "tpl;gcc", "tpl;gcc;tropicos", "tpl;gcc;tropicos;usda",
-                                        "tpl;gcc;usda","tpl;ildis","tpl;ildis;tropicos",
-                                        "tpl;ildis;usda","tpl;tropicos","tpl;tropicos;usda",
-                                        "tpl;usda","gcc","gcc;tropicos",
-                                        "gcc;tropicos;usda","gcc;usda","ildis",
-                                        "ildis;tropicos","ildis;tropicos;usda","ildis;usda",
-                                        "tropicos","tropicos;gcc","tropicos;usda","usda"  ))) %>%
+  mutate(Source=factor(Source, levels=TNRS.priorities)) %>%
   mutate(Taxonomic_status=factor(Taxonomic_status, 
                                 levels=c("Accepted","Synonym", "No opinion",
                                          "Invalid","Illegitimate","Misapplied",
@@ -1067,7 +1074,8 @@ This list was submitted to `TNRS`, but only selecting the `NCBI` database.
 
 
 ```{r}
-tnrs.res.iter3.raw <- readr::read_delim("../_derived/TNRS_submit/tnrs_results_iter3.txt", delim="\t", locale = locale(encoding = 'UTF-8'),quote="",
+tnrs.res.iter3.raw <- readr::read_delim("../_derived/TNRS_submit/tnrs_results_iter3.txt", delim="\t", 
+                                        locale = locale(encoding = 'UTF-8'),quote="",
           col_type = cols(
                 .default = col_character(),
                 Name_number = col_double(),
@@ -1089,15 +1097,9 @@ tnrs.ncbi <- tnrs.res.iter3.raw %>%
                                            "infraspecies", "forma", "race",
                                            "nothosubspecies", "proles", "monstr",
                                            "series"))) %>%
-  mutate(Source=factor(Source, levels=c("tpl",    #reorder priorities
-                                        "tpl;gcc", "tpl;gcc;tropicos", "tpl;gcc;tropicos;usda",
-                                        "tpl;gcc;usda","tpl;ildis","tpl;ildis;tropicos",
-                                        "tpl;ildis;usda","tpl;tropicos","tpl;tropicos;usda",
-                                        "tpl;usda","gcc","gcc;tropicos","gcc;tropicos;usda",
-                                        "gcc;usda", "ildis","ildis;tropicos","ildis;tropicos;usda",
-                                        "ildis;usda","tropicos","tropicos;gcc","tropicos;usda","usda"  ))) %>%
   mutate(Taxonomic_status=factor(Taxonomic_status, 
-                                levels=c("Accepted","Synonym", "No opinion","Invalid","Illegitimate","Misapplied","Rejected name"))) %>%
+                                levels=c("Accepted","Synonym", "No opinion","Invalid",
+                                         "Illegitimate","Misapplied","Rejected name"))) %>%
  arrange(Name_number, 
           desc(Infraspecific_epithet_2_score),
           desc(Infraspecific_epithet_score), 
@@ -1105,8 +1107,7 @@ tnrs.ncbi <- tnrs.res.iter3.raw %>%
           desc(Genus_score), 
           desc(Family_score),
           desc(Name_score),
-          desc(Overall_score), 
-          Source) %>%
+          desc(Overall_score)) %>%
   group_by(Name_submitted) %>%
   slice(1)
 ```
@@ -1188,37 +1189,54 @@ After iteration 3, there are still `r nrow(tnrs.ncbi.uncertain)` unresolved taxa
 
 
 ## Iteration 4 - Using `The Plant List` matching tools for unresolved names
-Generate names list from `tnrs.ncbi.uncertain` to be matched against `The Plant List`, using `Taxonstand::TPL`.  
+Generate names list from `tnrs.ncbi.uncertain` to be matched against `The Plant List`, using `Taxonstand::TPL`. Add to this list, also all those species that in the first iterations did not return an accepted name.  
 
 ```{r, eval = F}
-tpl.submit <- tnrs.ncbi.uncertain %>% dplyr::select(Name_submitted)
+tpl.submit <- tnrs.res.certain %>% filter(is.na(Accepted_name)) %>% dplyr::select(Name_submitted) %>% 
+  bind_rows(tnrs.res.iter2.certain %>% filter(is.na(Accepted_name)) %>% dplyr::select(Name_submitted)) %>% 
+  bind_rows(tnrs.ncbi.certain %>% filter(is.na(Accepted_name)) %>% dplyr::select(Name_submitted)) %>% 
+  bind_rows(tnrs.ncbi.uncertain %>% dplyr::select(Name_submitted)) %>% 
+  distinct()
+nrow(tpl.submit)
 write_csv(tpl.submit, path="../_derived/TPL/tpl.submit.csv")
 
-tpl.ncbi <- TPL(tpl.submit$Name_submitted)
-write_csv(tpl.ncbi, path = "../_derived/TPL/tpl_results_iter4.csv")
+#dividve in 99 batches
+indices <- 1:nrow(tpl.submit)
+chunks <- split(indices, sort(indices%%99))
+
+library(doParallel)
+library(parallel)
+cl <- makeForkCluster(3, outfile="")
+registerDoParallel(3)
+
+tpl.ncbi <- foreach(i=1:length(chunks), .combine=rbind) %dopar% {
+  tmp <- (TPL(tpl.submit$Name_submitted[chunks[[i]]]))
+  save(tmp, file=paste0("../_derived/TNRS_submit/TPL_foreach/tpl.ncbi", i,".RData"))
+  return(tmp)
+}
+stopCluster(cl)
+save(tpl.ncbi, file = "../_derived/TPL/tpl_results_iter4.RData")
+```
+
+```{r, echo=F, eval=F}
+#Reimport tpl.ncbi
+tpl.ncbi <- NULL
+for(ff in list.files("../_derived/TNRS_submit/TPL_foreach", full.names = T)){
+  load(ff)
+  tpl.ncbi <- rbind(tpl.ncbi, tmp)
+}
 ```
 
 
 ```{r}
-tpl.ncbi <- read_csv("../_derived/TPL/tpl_results_iter4.csv",  
-         locale = locale(encoding = 'UTF-8'),quote="",
-          col_type = cols(
-            .default = col_character(),
-              Hybrid.marker = col_logical(),
-              Plant.Name.Index = col_logical(),
-              TPL.version = col_double(),
-              Typo = col_logical(),
-              WFormat = col_logical(),
-              Higher.level = col_logical(),
-              Date = col_date(format = "")
-            ))
+load("../_derived/TPL/tpl_results_iter4.RData")
 tpl.ncbi.certain <- tpl.ncbi %>%
-  filter(Plant.Name.Index==T)
+  filter(Plant.Name.Index==T | Higher.level==T)
 nrow(tpl.ncbi.certain)
 write_csv(tpl.ncbi.certain, path = "../_derived/TPL/tpl.ncbi.certain.csv")
 
 tpl.ncbi.uncertain <- tpl.ncbi %>%
-  filter(Plant.Name.Index==F) %>%
+  filter(Plant.Name.Index==F & Higher.level==F) %>%
   dplyr::select(Taxon)
 nrow(tpl.ncbi.uncertain)
 write_csv(tpl.ncbi.uncertain, path = "../_derived/TPL/tpl.ncbi.uncertain.csv")
@@ -1239,7 +1257,6 @@ load("../_derived/TNRS_submit/tnrs.iter4.RData")
 
 Combine the `certain` data sets:
 ```{r, eval = T, warning=F}
-
 Backbone <- spec.list.TRY.sPlot %>%
   as.tbl() %>%
   rename(Name_sPlot_TRY=OriginalNames, 
@@ -1251,7 +1268,8 @@ Backbone <- spec.list.TRY.sPlot %>%
   mutate(Name_submitted=ifelse(!is.na(Name_string_corr2), Name_string_corr2, Name_string_corr1)) %>%
   dplyr::select(Name_sPlot_TRY, Name_string_corr1, Name_string_corr2, Source, Name_submitted) %>%
   rename(sPlot_TRY=Source) %>%
-  left_join(tnrs.res.certain %>% 
+  left_join(tnrs.res.certain %>%
+              #filter(!is.na(Accepted_name)) %>% 
               bind_rows(tnrs.res.iter2.certain) %>%
               bind_rows(tnrs.ncbi.certain) %>%
   #reformat TPL output to tnrs output
@@ -1275,10 +1293,19 @@ Backbone <- spec.list.TRY.sPlot %>%
                     mutate(Source=paste("tpl", TPL.version)) %>%
                     dplyr::select( (data.frame(colmatch=match(colnames(tnrs.ncbi), 
                                                         names(.))) %>%
-                                filter(!is.na(colmatch)))$colmatch)) %>%
-                    group_by(Name_submitted) %>%  #Some double matches. Prioritize first iterations
-                    slice(1),
-            by="Name_submitted")
+                                filter(!is.na(colmatch)))$colmatch)
+                    ) %>%
+                group_by(Name_submitted) %>%  #Some double matches. Prioritize best taxonomic status
+                mutate(Taxonomic_status=factor(Taxonomic_status, 
+                                             levels=c("Accepted","Synonym", "No opinion","Invalid",
+                                                      "Illegitimate","Misapplied","Rejected name",
+                                                      "Unresolved"))) %>%
+                #delete empty spaces at end of names
+                mutate(Accepted_name=gsub(pattern=" $", replacement="", x=Accepted_name)) %>% 
+                mutate(Accepted_name_species=gsub(pattern=" $", replacement="", x=Accepted_name_species)) %>% 
+                arrange(Taxonomic_status) %>% 
+                slice(1),
+              by="Name_submitted")
 #Double check
 nrow(Backbone) == nrow(spec.list.TRY.sPlot)
 ```
@@ -1286,43 +1313,38 @@ nrow(Backbone) == nrow(spec.list.TRY.sPlot)
 
 ## Tag unresolved names and create output columns
 Add four additional columns.
-If names were not corrected, set `Taxonomic.status == ""`, and assign `No suitable matches found.` to the remaining species.
+If names were neither resolved at the accepted or synonym level, set `Status_correct == "Other"`, and assign `No suitable matches found.` to the remaining species.
+
 ```{r, eval = T}
 Backbone <- Backbone %>%
-  mutate(Status_correct=ifelse(Taxonomic_status %in% c("Accepted", "Synonym", "Unresolved"), 
-                               Taxonomic_status, NA)) %>%
-  mutate(Status_correct=replace(Status_correct, 
-                                list=is.na(Status_correct), 
-                                values="No suitable matches found.")) %>% 
-  mutate(Status_correct=factor(Status_correct)) %>%
+  mutate(Status_correct=fct_collapse(Taxonomic_status, 
+                                     Other=c("No opinion","Invalid",
+                                         "Illegitimate","Misapplied","Rejected name"))) %>% 
+  mutate(Status_correct=fct_explicit_na(Status_correct, "No suitable matches found.")) %>% 
   #Create Name_correct field. Use Accepted names, if any. Otherwise matched names.
   mutate(Name_correct=ifelse(!is.na(Accepted_name), 
                              Accepted_name, 
                              Name_matched)) %>%
   mutate(Genus_correct=ifelse(!is.na(Name_correct) & (!Accepted_name_rank %in% c("family")), 
                       word(Name_correct,1), 
-                      NA)) %>% 
-  mutate(Name_correct=ifelse(!is.na(Name_correct), 
-                             Name_correct, 
-                             "No suitable matches found.")) %>%
+                      NA)) %>%
   mutate(Rank_correct=ifelse(!is.na(Name_matched_rank),
                              as.character(Name_matched_rank), 
                              "higher")) %>%
   mutate(Rank_correct=factor(Rank_correct, levels=c("higher", "family", "genus", "species",
                                                    "subspecies", "variety", "infraspecies",
-                                                   "race", "forma")
-                             )) %>% 
-  mutate(Name_short=ifelse(!is.na(Accepted_name_species), Accepted_name_species, NA))
+                                                   "race", "forma"))) 
 
 summary(Backbone$Status_correct)
 summary(Backbone$Rank_correct)
 ```
-
+There are `r sum(is.na(Backbone$Name_correct))` species names for which we found no match in any of the taxonomic resources we used. Yet, for as many as `r sum(Backbone$Rank_correct %in% c("higher", "family", "genus"))` taxa, the matching did not properly resolve the species name, and we only found a match at genus or higher level.
 
 
 ## Complete list of families
+There are `r sum(is.na(Backbone$Accepted_name_family))` records with missing family information.
 ### Derive info from other species of the same Genera in the Backbone itself
-Copy family info for taxa resolved at family level
+Copy family info for taxa resolved at family level. 
 ```{r}
 Backbone <- Backbone %>% 
   mutate(family.lev=str_extract(word(Name_correct,1), pattern='([^\\s]+aceae)')) %>%
@@ -1331,7 +1353,7 @@ Backbone <- Backbone %>%
                                      family.lev)) %>% 
   dplyr::select(-family.lev) 
 
-#Records with missing family info
+# Remaining records with missing family info
 sum((is.na(Backbone$Family_correct)))
 ```
 
@@ -1345,7 +1367,7 @@ genera_families <- Backbone %>%
   na.omit() %>% 
   #for some genera there are multiple families assigned 
   # (e.g. in case of unresolved species names )
-  # Extract the family names that occurs the most across each genus
+  # Extract the family names that occurs most often across each genus
   group_by(Genus_correct, family) %>% 
   summarize(n=n()) %>% 
   arrange(desc(n)) %>% 
@@ -1449,19 +1471,60 @@ sum(is.na(Backbone$Family_correct))
 ```
 After matching the remaining genera with the Catalogue of life there are still `r nrow(Backbone %>% filter(is.na(Family_correct)))` records without Family affiliation, for a total of `r nrow(Backbone %>% filter(is.na(Family_correct)) %>% dplyr::select(Genus_correct) %>% distinct())` genera.  
   
-Manually fix some residual, known issues:
+### Manually fix residual, known issues
 ```{r}
 Backbone <- Backbone %>%
   mutate(Family_correct=replace(Family_correct, 
-                                list=word(Name_short, 1)=="Coptidium",
-                                values="Ranunculaceae"))
-
+                                list=word(Accepted_name_species, 1)=="Coptidium",
+                                values="Ranunculaceae")) %>% 
+  mutate(Family_correct=replace(Family_correct, 
+                                list=word(Accepted_name_species, 1)=="Balanocarpus",
+                                values="Dipterocarpaceae" )) %>% 
+  mutate(Family_correct=replace(Family_correct, 
+                                list=word(Accepted_name_species, 1)=="Cardaminopsis",
+                                values="Brassicaceae" )) %>% 
+  mutate(Family_correct=replace(Family_correct, 
+                                list=word(Accepted_name_species, 1)=="Carpolepis",
+                                values="Myrtaceae" )) %>% 
+  mutate(Family_correct=replace(Family_correct, 
+                                list=word(Accepted_name_species, 1)=="Cathartolinum",
+                                values="Linaceae" )) %>% 
+  mutate(Family_correct=replace(Family_correct, 
+                                list=word(Accepted_name_species, 1)=="Didiscus",
+                                values="Araliaceae" )) %>% 
+  mutate(Family_correct=replace(Family_correct, 
+                                list=word(Accepted_name_species, 1)=="Grammadenia",
+                                values="Primulaceae" )) %>% 
+  mutate(Family_correct=replace(Family_correct, 
+                                list=word(Accepted_name_species, 1)=="Antholoma",
+                                values="Elaeocarpaceae" )) 
+  
+#Records with missing family info
+sum(is.na(Backbone$Family_correct))
 ```
 
+### Create field `Name_short`
+Shorten names that have more than two words and where the second word is a x. If there is no species name available, fill in with either genus or family info
+```{r}
+Backbone <- Backbone %>% 
+  mutate(Name_short=Name_correct) %>% 
+  mutate(Name_short=gsub(pattern=" x ", replacement=" ", x=Name_short, fixed=T)) %>%
+  mutate(Name_short=word(Name_short, start=1L, end=2L)) %>% 
+  mutate(Name_short=ifelse(!is.na(Name_short), 
+                           Name_short, 
+                           ifelse(!is.na(Genus_correct), 
+                                  Genus_correct,
+                                  ifelse(!is.na(Family_correct), 
+                                         Family_correct, 
+                                         NA))))
+
+sum(is.na(Backbone$Name_short))
+sum(is.na(Backbone$Name_correct))
+```
 
 
 ## Create Field `is_vascular_plant`
-Assign all families that belong to `Tracheophyta` to category `is_vascular_species`, based on The Catalogue of Life
+Assign all families that belong to `Tracheophyta` to category `is_vascular_species`, based on `The Catalogue of Life`
 ```{r}
 Backbone <- Backbone %>% 
   left_join(cat.life %>% 
@@ -1475,6 +1538,65 @@ Backbone <- Backbone %>%
 table(Backbone$is_vascular_species, exclude=NULL)
 ```
 ## Export Backbone
+```{r echo=F}
+knitr::kable(Backbone %>% 
+               sample_n(20), 
+  caption="Example of Backbone (only 20 randomly selected taxa shown") %>%
+    kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"), 
+                  latex_options = "basic", 
+                  full_width = F, position = "center")
+```
+### Description of fields in the Backbone
+*Name_sPlot_TRY* - Name as retrieved in sPlot or TRY  
+*Name_string_corr1* - Name after first round of string cleaning  
+*Name_string_corr2* - Name after second round of string cleaning  
+*sPlot_TRY* - Origin or species name (S - sPlot, T - Try, A - Alpine dataset & combinations)  
+*Name_submitted* - Name as submitted to TNRS\\TPL  
+*Name_number* - Number of species names when submitted to TNRS\\TPL  
+*Overall_score* - Matching score from TNRS  
+*Name_matched* - Name matched in TNRS\\TPL  
+*Name_matched_rank* - Taxonomic rank of name matched (e.g., species, family...)  
+*Name_score* - Matching score of name matched  
+*Name_matched_author* - Author names of matched names  
+*Name_matched_url* - Url from TNRS\\TPL of matche name  
+*Author_matched* - Authors as matched from query (Empty since we only submitted species names)    
+*Author_score* - Score of author matching (Empty since we only submitted species names)    
+*Family_matched* - Family of the matched name  
+*Family_score* - Score of matched family name  
+*Name_matched_accepted_family* - Accepted family of the matched name (if available)  
+*Genus_matched* - Genus of the matched name  
+*Genus_score* - Score of matched genus name  
+*Specific_epithet_matched* - Specific epithet of the matched name  
+*Specific_epithet_score* - Score Specific epithet of the matched name  
+*Infraspecific_rank* - Rank of matched name, if below species  
+*Infraspecific_epithet_matched* - Infraspecific epithet of matched name  
+*Infraspecific_epithet_score*- Score of infraspecific epithet of matched name  
+*Infraspecific_rank_2* - Rank of matched name (2nd level), if below species  
+*Infraspecific_epithet_2_matched* - Infraspecific epithet (2nd level) of matched name  
+*Infraspecific_epithet_2_score* - Score of infraspecific epithet (2nd level) of matched name  
+*Annotations* -  
+*Unmatched_terms* -  
+*Taxonomic_status* - Status of matched name (Accepted, Synonim, Unresolved...)  
+*Accepted_name* - Accepted name  
+*Accepted_name_author* - Author of accepted name  
+*Accepted_name_rank* - Rank of accepted name (family, genus, species, infraspecific...)  
+*Accepted_name_url* - url of accepted name  
+*Accepted_name_species* - Accepted species name (if `Accepted_name_rank` at species level of lower)  
+*Accepted_name_family* - Family of accepted name
+*Selected* - ignore
+*Source* - Database where the info comes from 
+*Warnings* -  
+*Accepted_name_lsid* -  
+**Below columns added specifically for this backbone**  
+*Status_correct* - Simplification of `Taxonomic_status`  
+*Name_correct* - If Accepted_name is non-null, otherwise returnes `Name_matched`. This field represent the union of accepted + matched name    
+*Genus_correct* - Genus derived from `Name_correct`, but only when `Accepted_name_rank` is lower than family    
+*Rank_correct* - Simplification of `Accepted_name_rank`  
+*Family_correct* - Family of `Name_correct`. Complements `Accepted_name_family` with multiple sources  
+*Name_short* - First two words of `Name_correct`  
+*phylum* - As derived from `The Catalogue of Life`  
+*is_vascular_species* -  As derived based on selection of `phylum` from `The Catalogue of Life`  
+
 ```{r}
 save(Backbone, file="../_output/Backbone3.0.RData")
 ```
@@ -1504,8 +1626,20 @@ ToSubmit <- ToSubmit1 %>%
 
 write_csv(ToSubmit, "../_output/Submit_TRY.csv")
 ```
+Submitting `r nrow(ToSubmit)` species names to `TRY`. 
 
+### Check how many species from sPlot where submitted to `TRY5.0`
+```{r}
+Matched_names <- Backbone %>% 
+  filter(grepl(sPlot_TRY, pattern = "S")) %>% 
+  filter(Name_sPlot_TRY %in% ToSubmit$Name_submit) %>% 
+  bind_rows(Backbone %>% 
+              filter(grepl(sPlot_TRY, pattern = "S")) %>% 
+              filter(Name_correct %in% ToSubmit$Name_submit)) %>% 
+  distinct() 
+```
 
+Of the species names submitted to `TRY` there are `r nrow(Matched_names)` species names that match sPlot's (+ Alpine dataset) species names, before or after taxonomic resolution. These correspond to `r Matched_names %>% distinct(Name_correct) %>% nrow()` species names, AFTER taxonomic resolution.
 
 # Statistics
 ## Statistics for backbone combining names in `sPlot3.0` and `TRY5.0`
@@ -1606,9 +1740,7 @@ Exclude the non-vascular plant and non-matching taxon names:
 ```{r, eval = T}
 Backbone.uni.vasc <- Backbone.uni %>%
     dplyr::filter(is_vascular_species == TRUE)
-
 ```
-`df.uni` had two names less than `df.count`, as they were accidentially tagged as non-vascular species names. Resolve that issue:
 
 **Now, run the stats for unique resolved names (excluding non-vascular and non-matching taxa):**
 ```{r, eval = T}