corrected python script