some modificationts to python script