simplified javascript code, uses ipython interact now