Updates to the python and R scripts