adding ipython magic function