corrected to run script in IPython