updated python script