Modfied code so that it can be run directly to provide information instead of importing to ipython.