Added all the needed calculations from ResearchNotes.Rmd