Cleaned up using external ipython.