This is R code from past time spend scripting on the iMac