Minor changes to python code and start of R code edits