Added and began adapting some scripts from R Huggins.