updated to work with latest ipython... A lot has changed