updates to python script from Julian's review