diff --git a/.travis.yml b/.travis.yml
index 1cfc8273666e4559d49b94ea90befaba0261f32d..fca147510a8b275c53327f1a10007ea2b9d62099 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,13 +8,13 @@ os:
 branches:
     only:
         - master
-        - chamcham
 notifications:
     email:
         recipients:
             - dilawar.s.rajput@gmail.com
             - bhalla@ncbs.res.in
             - hrani@ncbs.res.in
+            - ray.subhasis@gmail.com
 
         on_success: change
         on_failure: always
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2878beefa0ec273b43a4a50ee1717d4f7510c5fa..f073f74719e6ce6ff99d331050e371112da30883 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,13 +83,9 @@ install(DIRECTORY ${MOOSE_EXAMPLE_DIR}/
     PATTERN "_travis*" EXCLUDE
     PATTERN ".travis*" EXCLUDE
     PATTERN "*.pyc" EXCLUDE
-    PATTERN "*.png" EXCLUDE
-    PATTERN "docs*" EXCLUDE
     )
 
-# Copy the command to launch moose.
-configure_file(${CMAKE_SOURCE_DIR}/cmake/moose.in ${CMAKE_BINARY_DIR}/moose)
-
+configure_file( ${CMAKE_SOURCE_DIR}/cmake/moose.in ${CMAKE_BINARY_DIR}/moose )
 install(PROGRAMS ${CMAKE_BINARY_DIR}/moose DESTINATION bin)
 
 ## UNINSTALL
diff --git a/docs/Makefile b/docs/Makefile
index a8997d1c346f7c346662c40921a5ac724e994366..6cba5e3d4f7fe3d0d232fb05d3c8671def147cf9 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -17,4 +17,4 @@ help:
 # Catch-all target: route all unknown targets to Sphinx using the new
 # "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
 %: Makefile
-	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
+	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index c3a2e6c2454d031adb35d4de795551a918ce405d..329de82eb5c8b07d3f4a6b4debb98497c03a576d 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,10 +1,9 @@
 # -*- coding: utf-8 -*-
 #
 # MOOSE documentation build configuration file, created by
-# sphinx-quickstart on Thu Feb  9 14:56:13 2017.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
+# sphinx-quickstart on Tue Jul  1 19:05:47 2014.
+# updated on Thr Jan 21 00:30:10 2016
+# This file is execfile()d with the current directory set to its containing dir.
 #
 # Note that not all possible configuration values are present in this
 # autogenerated file.
@@ -12,15 +11,14 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#
+import subprocess
 import os
 import sys
 import sphinx_rtd_theme
-# sys.path.insert(0, os.path.abspath('.'))
 
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
 sys.path.insert(0, os.path.abspath('../python'))
 sys.path.append(os.path.abspath('../../moose-examples/snippets'))
 sys.path.append(os.path.abspath('../../moose-examples/tutorials/ChemicalOscillators'))
@@ -29,140 +27,264 @@ sys.path.append(os.path.abspath('../../moose-examples/tutorials/ExcInhNet'))
 sys.path.append(os.path.abspath('../../moose-examples/neuroml/lobster_pyloric'))
 sys.path.append(os.path.abspath('../../moose-examples/tutorials/ExcInhNetCaPlasticity'))
 
-# -- General configuration ------------------------------------------------
+# -- General configuration -----------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
-#
-# needs_sphinx = '1.0'
+#needs_sphinx = '1.0'
 
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['sphinx.ext.autodoc']
+extensions = ['sphinx.ext.autodoc',
+              'sphinx.ext.mathjax',
+              'sphinx.ext.autosummary',
+              'sphinx.ext.todo',
+              'sphinx.ext.viewcode',
+		]
+
+todo_include_todos = True
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
-# The suffix(es) of source filenames.
-# You can specify multiple suffix as a list of string:
-#
-# source_suffix = ['.rst', '.md']
+# The suffix of source filenames.
 source_suffix = '.rst'
 
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
 # The master toctree document.
 master_doc = 'index'
 
 # General information about the project.
 project = u'MOOSE'
-copyright = u'2017, Upinder S. Bhall, Subhasis Ray, Aditya Gilra, Dilawar Singh, Harsha Rani, Aviral Goel, Malav Shah'
-author = u'Upinder S. Bhall, Subhasis Ray, Aditya Gilra, Dilawar Singh, Harsha Rani, Aviral Goel, Malav Shah'
+copyright = u'2016, Upinder Bhalla, Niraj Dudani, Aditya Gilra, Aviral Goel, Subhasis Ray, Harsha Rani and Dilawar Singh'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
 # The short X.Y version.
-version = u'3.1'
+version = '3.1'
 # The full version, including alpha/beta/rc tags.
-release = u'ChamCham (3.1.1)'
+release = 'chamcham (3.1.1)'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 #
 # This is also used if you do content translation via gettext catalogs.
 # Usually you set "language" from the command line for these cases.
-language = None
+language = 'English'
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%B %d, %Y'
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-# This patterns also effect to html_static_path and html_extra_path
-exclude_patterns = []
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
 
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = 'sphinx'
 
 # If true, `todo` and `todoList` produce output, else they produce nothing.
-todo_include_todos = False
+todo_include_todos = True
 
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
 
-# -- Options for HTML output ----------------------------------------------
+# -- Options for HTML output ---------------------------------------------------
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-#
-html_theme = "sphinx_rtd_theme"
+html_theme = 'sphinx_rtd_theme'
 
 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
 # documentation.
-#
-# html_theme_options = {}
+# html_theme_options = {'stickysidebar': 'true',
+#                       'sidebarwidth': '300'}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+html_logo = 'images/moose_logo.png'
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
 
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
 
-# -- Options for HTMLHelp output ------------------------------------------
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
 
-html_logo = 'images/moose_logo.png'
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'MOOSEdoc'
+htmlhelp_basename = 'MOOSE'
 
 
-# -- Options for LaTeX output ---------------------------------------------
+# -- Options for LaTeX output --------------------------------------------------
 
 latex_elements = {
-    # The paper size ('letterpaper' or 'a4paper').
-    #
-    # 'papersize': 'letterpaper',
-
-    # The font size ('10pt', '11pt' or '12pt').
-    #
-    # 'pointsize': '10pt',
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
 
-    # Additional stuff for the LaTeX preamble.
-    #
-    # 'preamble': '',
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
 
-    # Latex figure (float) alignment
-    #
-    # 'figure_align': 'htbp',
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
 }
 
 # Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-#  author, documentclass [howto, manual, or own class]).
+# (source start file, target name, title, author, documentclass [howto/manual]).
 latex_documents = [
-    (master_doc, 'MOOSE.tex', u'MOOSE Documentation',
-     u'Upinder S. Bhall, Subhasis Ray, Aditya Gilra, Dilawar Singh, Harsha Rani, Aviral Goel, Malav Shah', 'manual'),
+  ('index', 'MOOSE.tex', u'MOOSE Documentation',
+   u'Upinder Bhalla, Niraj Dudani, Aditya Gilra, Aviral Goel, Subhasis Ray,Harsha Rani and Dilawar Singh', 'manual'),
 ]
 
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+latex_logo = 'images/moose_logo.png'
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+latex_show_pagerefs = True
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
 
-# -- Options for manual page output ---------------------------------------
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    (master_doc, 'moose', u'MOOSE Documentation',
-     [author], 1)
+    ('index', 'moose', u'MOOSE Documentation',
+     [u'Upinder Bhalla, Niraj Dudani, Aditya Gilra, Aviral Goel, Subhasis Ray,Harsha Rani and Dilawar Singh'], 1)
 ]
 
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
 
-# -- Options for Texinfo output -------------------------------------------
+# -- Options for Texinfo output ------------------------------------------------
 
 # Grouping the document tree into Texinfo files. List of tuples
 # (source start file, target name, title, author,
 #  dir menu entry, description, category)
 texinfo_documents = [
-    (master_doc, 'MOOSE', u'MOOSE Documentation',
-     author, 'MOOSE', 'One line description of project.',
-     'Miscellaneous'),
+  ('index', 'MOOSE', u'MOOSE Documentation',
+   u'Upinder Bhalla, Niraj Dudani, Aditya Gilra, Aviral Goel, Subhasis Ray,Harsha Rani and Dilawar Singh', 'MOOSE', 'MOOSE is the Multiscale Object-Oriented Simulation Environment.',
+   'Science'),
 ]
 
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+#numpydoc option
+numpydoc_show_class_members = False
+
+# autodoc options to mock MOOSE module
+autodoc_mock_imports = [ 'numpy' , 'moose.sbml' , 'moose.genesis' , 'moose.LIF' , 'moogli.extensions.moose' , 'extensions.moose', 'moose' , 'moose.SBML' , 'pylab' , 'moose.genesis' , 'datetime' , 'getpass' , 'h5py' , 'matplotlib' , 'squid' , 'PyQt4' , 'moogli' , 'moose.utils' , 'math' , 'SquidAxon' , '_moogli' , 'XRRRates' , 'neuroml.NeuroML' ,'neuroml' , 'rdesigneur' , 'pyplot' , 'gnuplot' , 'cm' , 'matplotlib.pyplot' , 'matplotlib.image' , 'matplotlib.cm' , 'shapes' , 'chemUtil.add_Delete_ChemicalSolver' ]
+
+#include reference files
+exclude_patterns = ['/docs/source/user/py/references/*.rst']
+
+#run the doxygen thingy
+# read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
+#
+# if read_the_docs_build:
+#
+#     subprocess.call('cd ../../doxygen; doxygen', shell=True)
+
+import subprocess, os
 
+read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
 
+if read_the_docs_build:
+    subprocess.call('cd ../../doxygen; echo HELLO......................; doxygen Doxyfile', shell=True)
diff --git a/docs/source/docs/source/modules.rst b/docs/source/docs/source/modules.rst
index 733da1c55c012340a920a07efc1c464af5967b99..bf86f144c054261a95bfc75c1b58fc47b941f688 100644
--- a/docs/source/docs/source/modules.rst
+++ b/docs/source/docs/source/modules.rst
@@ -1,6 +1,2 @@
 projectdir
 ==========
-
-.. toctree::
-   :maxdepth: 4
-
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 319c27402cd203f2c3f68683fbfc4052e0c41260..aa463b195ce811c66214430238e874299d41f6ea 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -30,6 +30,7 @@ MOOSE is a simulation environment, not just a numerical engine: It provides data
    /user/py/cookbook/index_ckbk
    /user/py/graphics/index_graphics
    /user/py/references/index_ref
+   /doxygen/doxy
 
 .. toctree::
    :maxdepth: 1
diff --git a/docs/source/install/install.rst b/docs/source/install/install.rst
index 15caee9752c346573aa3094be5a1e06337df98ce..d0aafce9140c22f428ef0ed7bc69e6e9cc619b4a 100644
--- a/docs/source/install/install.rst
+++ b/docs/source/install/install.rst
@@ -23,10 +23,6 @@ to pick your distribution and follow instructions.
 .. note::
     ``moogli`` (tool to visualize network activity) is not available for CentOS-6.
 
-.. raw:: html
-    <iframe
-    src="http://software.opensuse.org/download/package.iframe?project=moose&package=moose"></iframe>
-
 .. todo:: Packages for gentoo, Arch Linux
 
 Mac OSX
@@ -36,12 +32,15 @@ Download the ``dmg`` file from `here <https://github.com/BhallaLab/moose/release
 
 Alternatively, you can use ``homebrew`` to install ``moose``
 ::
+
     $ brew install homebrew/science/moose
 
 
 Windows/Cygwin
 ^^^^^^^^^^^^^^
 
+Coming soon...!
+
 Building MOOSE
 --------------
 
@@ -52,15 +51,25 @@ In case your distribution is not listed on `our repository page
 First, you need to get the source code. You can use ``git`` (clone the
 repository) or download snapshot of github repo by clicking on `this link
 <https://github.com/BhallaLab/moose/archive/master.zip>`_.::
+
     $ git clone https://github.com/BhallaLab/moose
 
+(This will create folder called "moose")
 Or,
 ::
+
     $ wget https://github.com/BhallaLab/moose/archive/master.zip
     $ unzip master.zip
 
 If you don't want lasest snapshot of ``MOOSE``, you can download other released
-versions from here `https://github.com/BhallaLab/moose/releases`.
+versions from `here <`https://github.com/BhallaLab/moose/releases>`_.
+
+Once you have downloaded the repository, ::
+
+    $ cd moose
+    $ git submodule update --init; git pull
+                      or
+    $ sudo -E ./update-repository     # This script updates the repository and its subrepositories recursively, located in moose folder
 
 Install dependencies
 ^^^^^^^^^^^^^^^^^^^^
@@ -68,32 +77,67 @@ Install dependencies
 Next, you need to install required dependencies. Depending on your OS, names of
 following packages may vary.
 
-- cmake (version 2.8 or higher)
-- gsl-1.16 or higher `download <ftp://ftp.gnu.org/gnu/gsl/>`_.
-- libhdf5 development package e.g. `libhdf5-serial-dev` or `libhdf5-devel`
-- python development package e.g. `python-dev` or `python-devel`
-- numpy e.g. `python-numpy` or `numpy`
+Core MOOSE
+""""""""""
+- Required:
+    - cmake (version 2.8 or higher)
+    - g++ (>= 4.6.x) For building the C++ MOOSE core.
+    - gsl-1.16 or higher.
+
+- Optional
+    - HDF5 (>=1.8.x) For reading and writing data into HDF5 based formats
+
+Python interface for core MOOSE API (pymoose)
+"""""""""""""""""""""""""""""""""""""""""""""
+- Required
+    - Python2 ( >= 2.7.x) For building the MOOSE Python bindings
+    - Python-dev ( >= 2.7.x) Python development headers and libraries, e.g. `python-dev` or `python-devel`
+    - NumPy ( >= 1.6.x) For array interface, e.g. `python-numpy` or `numpy`
+
+- Optional
+    - NetworkX (1.x) For automatical layout
+    - pygraphviz For automatic layout for chemical models
+    - Matplotlib (>=1.1.x) For plotting simulation results
+    - python-libsbml For reading and writing chemical models from and into SBML format
 
 Most of the dependencies can be installed using package manager.
 
 On ``Debian/Ubuntu``
 ::
+
     $ sudo apt-get install libhdf5-dev cmake libgsl0-dev libpython-dev python-numpy
 
 .. note::
+
     Ubuntu 12.04 does not have required version of ``gsl`` (required 1.16 or
     higher, available 1.15). On Ubuntu 16.04, package name is ``libgsl-dev``.
 
 On ``CentOS/Fedora/RHEL/Scientific Linux``
 ::
+
     $ sudo yum install hdf5-devel cmake libgsl-dev python-devel python-numpy
 
 On ``OpenSUSE``
 ::
-    $ sudo zypper install hdf5-devel cmake libgsl-dev python-devel python-numpy
 
-Now use `cmake` to build moose
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  $ sudo zypper install hdf5-devel cmake libgsl-dev python-devel python-numpy
+
+build moose
+^^^^^^^^^^^
+
+Method 1: Using Makefile
+""""""""""""""""""""""""
+
+.. code-block:: bash
+
+    $ cd moose-core
+    $ make
+    $ export PYTHONPATH="/homedir/moose-core/python"
+               or
+    $ ./build-moose-core #builds moose and sets the pythonpath in local_site_package_directory
+
+Method 2: Using cmake
+"""""""""""""""""""""
 
 .. code-block:: bash
 
@@ -108,25 +152,28 @@ This will build pyMOOSE (MOOSE's python extention), `ctest` will run few tests t
 check if build process was successful.
 
 .. note::
-    To install MOOSE into non-standard directory, pass additional argument
-    `-DCMAKE_INSTALL_PREFIX=path/to/install/dir` to cmake
-    ::
-        $ cmake -DCMAKE_INSTALL_PREFIC=$HOME/.local ..
 
-    To use different version of python
-    ::
-        $ cmake -DPYTHON_EXECUTABLE=/opt/python3/bin/python3 ..
+  To install MOOSE into non-standard directory, pass additional argument
+  `-DCMAKE_INSTALL_PREFIX=path/to/install/dir` to cmake
+  ::
+
+    $ cmake -DCMAKE_INSTALL_PREFIC=$HOME/.local ..
+
+  To use different version of python
+  ::
+
+    $ cmake -DPYTHON_EXECUTABLE=/opt/python3/bin/python3 ..
 
 After that installation is pretty easy
 ::
-    $ sudo make install
 
-If everything went fine, you should be able to import moose in python shell.
+  $ sudo make install
 
-.. code-block:: python
+If everything went fine, you should be able to import moose in python shell.
 
-    import moose
+.. code-block::  python
 
+   >>> import moose
 
 Graphical User Interface (GUI)
 ------------------------------
@@ -135,30 +182,41 @@ You can get the source of ``moose-gui`` from `here
 <https://github.com/BhallaLab/moose-gui>`_. You can download it either by
 clicking on `this link <https://github.com/BhallaLab/moose-gui/archive/master.zip>`_
 or by using ``git`` ::
+
     $ git clone https://github.com/BhallaLab/moose-gui
 
-To be able to launch ``moose-gui``, you need to install some more packages
+Below are packages which you may want to install to use MOOSE Graphical User Interface.
 
-- matplotlib
-- python-qt4
+- Required:
+    - PyQt4 (4.8.x) For Python GUI
+    - Matplotlib ( >= 1.1.x) For plotting simulation results
+    - NetworkX (1.x) For automatical layout
+    - suds/suds-jurko (0.4) For accessing models hosted on biomodels database.
+- Optional:
+    - python-libsbml For reading and writing signalling models from and into SBML format
 
 On ``Ubuntu/Debian``, these can be installed with
 ::
+
     $ sudo apt-get install python-matplotlib python-qt4
 
 On ``CentOS/Fedora/RHEL``
 ::
+
     $ sudo yum install python-matplotlib python-qt4
 
 Now you can fire up the GUI
 ::
+
     $ cd /to/moose-gui
     $ python mgui.py
 
 .. note::
+
     If you have installed ``moose`` package, then GUI is launched by
     running following commnad::
-        $ moose
+
+    $ moose
 
 Building moogli
 ---------------
@@ -169,6 +227,9 @@ be found `here <http://moose.ncbs.res.in/moogli>`_.
 `Moogli` is part of `moose` package. Building moogli can be tricky because of
 multiple depednecies it has.
 
+- Required
+    - OSG (3.2.x) For 3D rendering and simulation of neuronal models
+    - Qt4 (4.8.x) For C++ GUI of Moogli
 
 To get the latest source code of ``moogli``, click on `this link <https://github.com/BhallaLab/moogli/archive/master.zip>`_.
 
@@ -182,18 +243,22 @@ packages to be installed.
 
 On ``Ubuntu/Debian``
 ::
+
     $ sudo apt-get install python-qt4-dev python-qt4-gl python-sip-dev libqt4-dev
 
 On ``Fedora/CentOS/RHEL``
 ::
+
     $ sudo yum install sip-devel PyQt4-devel qt4-devel libjpeg-devel PyQt4
 
 On ``openSUSE``
 ::
+
     $ sudo zypper install python-sip python-qt4-devel libqt4-devel python-qt4
 
 After this, building and installing ``moogli`` should be as simple as
 ::
+
     $ cd /path/to/moogli
     $ mkdir _build
     $ cd _build
diff --git a/docs/source/release_notes/index.rst b/docs/source/release_notes/index.rst
index 862216e95c1d42e9c53d4f176e75ffdfe2987165..6dccd2d97b202eddd93052e594011f8283b8383f 100644
--- a/docs/source/release_notes/index.rst
+++ b/docs/source/release_notes/index.rst
@@ -1,4 +1,6 @@
 Release Notes
-============
+=============
 
-.. todo:: Collect release notes from github.
+.. todo::
+
+   Collect release notes from github.
diff --git a/docs/source/user/py/cookbook/chem.rst b/docs/source/user/py/cookbook/chem.rst
index a12d179bf4b7eb8242470a6a27c9448cf29117ce..3f9571344bd10366d985be1b6dea3b339ae3a95f 100644
--- a/docs/source/user/py/cookbook/chem.rst
+++ b/docs/source/user/py/cookbook/chem.rst
@@ -2,661 +2,10 @@
 Chemical Aspects
 ****************
 
-.. contents::
-   :local:
-   :depth: 1
+.. toctree::
+   :maxdepth: 2
 
-.. _ckbk-chem-load-run:
-
-Load - Run - Save models
-========================
-
-Load a Kinetic Model
---------------------
-
-.. automodule:: loadKineticModel
-   :members:
-
-Load an SBML Model
--------------------
-
-.. automodule:: loadSbmlmodel
-   :members:
-
-Load a CSpace Model
--------------------
-
-.. automodule:: loadCspaceModel
-   :members:
-
-Save a model into SBML format
------------------------------
-
-.. automodule:: convert_Genesis2Sbml
-   :members:
-
-Save a model
-------------
-
-.. automodule:: savemodel
-   :members:
-
-.. _ckbk-chem-snippets:
-
-Simple Examples
-===============================
-
-Set-up a kinetic solver and model
----------------------------------
-
-with Scripting
-^^^^^^^^^^^^^^
-
-.. automodule:: scriptGssaSolver
-   :members:
-
-With something else
-^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: changeFuncExpression
-   :members:
-
-Building a chemical Model from Parts
-------------------------------------
-
-.. automodule:: scriptKineticSolver
-   :members:
-
-Cross-Compartment Reaction Systems
-----------------------------------
-
-.. automodule:: crossComptSimpleReac
-   :members:
-
-.. automodule:: crossComptOscillator
-   :members:
-
-.. automodule:: crossComptNeuroMesh
-   :members:
-
-.. automodule:: crossComptSimpleReacGSSA
-   :members:
-
-Tweaking Parameters
--------------------
-
-.. automodule:: tweakingParameters
-   :members:
-
-Models' Demonstration
----------------------
-
-Oscillation Model
-^^^^^^^^^^^^^^^^^
-
-.. automodule:: slowFbOsc
-   :members:
-
-Bistability Models
-^^^^^^^^^^^^^^^^^^
-
-MAPK feedback loop model
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. automodule:: mapkFB
-   :members:
-
-Simple minimal bistable model
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. automodule:: scaleVolumes
-   :members:
-
-Strongly bistable Model
-~~~~~~~~~~~~~~~~~~~~~~~
-
-.. automodule:: strongBis
-   :members:
-
-Model of bidirectional synaptic plasticity
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-[showing bistable chemical switch]
-
-.. automodule:: bidirectionalPlasticity
-   :members:
-
-Reaction Diffusion Models
--------------------------
-[Reaction-diffusion + transport in a tapering cylinder]
-
-.. automodule:: cylinderDiffusion
-   :members:
-
-.. automodule:: cylinderMotor
-   :members:
-
-.. automodule:: gssaCylinderDiffusion
-   :members:
-
-Neuronal Diffusion Reaction
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: rxdFuncDiffusion
-   :members:
-
-.. automodule:: rxdReacDiffusion
-   :members:
-
-.. automodule:: rxdFuncDiffusionStoch
-   :members:
-
-A Turing Model
---------------
-
-.. automodule:: TuringOneDim
-   :members:
-
-A Spatial Bistable Model
-------------------------
-
-.. automodule:: 
-   :members:
-
-Reaction Diffusion in Neurons
------------------------------
-
-.. automodule:: reacDiffConcGradient
-   :members:
-
-.. automodule:: reacDiffBranchingNeuron
-   :members:
-
-.. automodule:: reacDiffSpinyNeuron
-   :members:
-
-.. automodule:: diffSpinyNeuron
-   :members:
-
-Manipulating Chemical Models
-----------------------------
-
-Running with different numerical methods
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: switchKineticSolvers
-   :members:
-
-Changing volumes
-^^^^^^^^^^^^^^^^
-
-.. automodule:: scaleVolumes
-   :members:
-
-Feeding tabulated input to a model
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: analogStimTable
-   :members:
-
-Finding steady states
-^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: findChemSteadyState
-   :members:
-
-Making a dose-response curve
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: chemDoseResponse
-   :members:
-
-Transport in branching dendritic tree
--------------------------------------
-
-.. automodule:: transportBranchingNeuron
-   :members:
-
-.. _ckbk-chem-gui:
-
-Interface for chemical kinetic models in MOOSEGUI
-=================================================
-
-
-Upinder Bhalla, Harsha Rani
-
-Nov 8 2016.
-
---------------
-
--  `Introduction <#introduction>`__
-
--  `**TODO** What are chemical kinetic
-   models? <#todo-what-are-chemical-kinetic-models>`__
-
-   -  `Levels of model <#levels-of-model>`__
-   -  `Numerical methods <#numerical-methods>`__
-
--  `Using Kinetikit 12 <#using-kinetikit-12>`__
-
-   -  `Overview <#overview>`__
-   -  `Model layout and icons <#model-layout-and-icons>`__
-
-      -  `Compartment <#compartment>`__
-      -  `Pool <#pool>`__
-      -  `Buffered pools <#buffered-pools>`__
-      -  `Reaction <#reaction>`__
-      -  `Mass-action enzymes <#mass-action-enzymes>`__
-      -  `Michaelis-Menten Enzymes <#michaelis-menten-enzymes>`__
-      -  `Summation <#summation>`__
-
-   -  `Model operations <#model-operations>`__
-   -  `Model Building <#model-building>`__
-
-`Introduction <#TOC>`__
------------------------
-
-Kinetikit 12 is a graphical interface for doing chemical kinetic modeling in MOOSE. It is derived in part from Kinetikit, which was the
-graphical interface used in GENESIS for similar models. Kinetikit, also known as kkit, was at version 11 with GENESIS. Here we start with
-Kinetikit 12.
-
-`**TODO** What are chemical kinetic models? <#TOC>`__
------------------------------------------------------
-
-Much of neuronal computation occurs through chemical signaling. For
-example, many forms of synaptic plasticity begin with calcium influx
-into the synapse, followed by calcium binding to calmodulin, and then
-calmodulin activation of numerous enzymes. These events can be
-represented in chemical terms:
-
-   4 Ca2+ + CaM <===> Ca4.CaM
-
-Such chemical equations can be modeled through standard Ordinary
-Differential Equations, if we ignore space::
-
-   d[Ca]/dt = −4Kf ∗ [Ca]4 ∗ [CaM] + 4Kb ∗ [Ca4.CaM] d[CaM]/dt = −Kf ∗ [Ca]4 ∗ [CaM] + Kb ∗ [Ca4.CaM] d[Ca4.CaM]/dt = Kf ∗ [Ca]4 ∗ [CaM] − Kb ∗ [Ca4.CaM]
-
-MOOSE models these chemical systems. This help document describes how to do such modelling using the graphical interface, Kinetikit 12.
-
-`Levels of model <#TOC>`__
---------------------------
-
-Chemical kinetic models can be simple well-stirred (or point) models, or
-they could have multiple interacting compartments, or they could include
-space explicitly using reaction-diffusion. In addition such models could
-be solved either deterministically, or using a stochastic formulation.
-At present Kinetikit handles compartmental models but does not compute
-diffusion within the compartments, though MOOSE itself can do this at
-the script level. Kkit12 will do deterministic as well as stochastic
-chemical calculations.
-
-`Numerical methods <#TOC>`__
-----------------------------
-
--  **Deterministic**: Adaptive timestep 5th order Runge-Kutta-Fehlberg from the GSL (GNU Scientific Library).
--  **Stochastic**: Optimized Gillespie Stochastic Systems Algorithm, custom implementation.
-
-`Using Kinetikit 12 <#TOC>`__
------------------------------
-
-`Overview <#TOC>`__
-^^^^^^^^^^^^^^^^^^^
-
--  Load models using **'File -> Load model'**.  A reaction schematic for the chemical system appears in the **'Editor view'** tab.
--  From **'Editor view'** tab
-
-  -  View parameters by clicking on icons, and looking at entries in **'Properties'** table to the right.
-  -  Edit parameters by changing their values in the **'Properties'** table.
-
--  From **'Run View'**
-
-  -  Pools can be plotted by clicking on their icons and dragging the icons onto the plot Window. Presently only concentration v/s time is plottable.
-  -  Select simulation, diffusin dt's along updateInterval for plot and Gui with numerical method using options under **'Preferences'** button in simulation control.
-  -  Run model using **'Run'** button.
-  -  Save plots image using the icons at the top of the **'Plot Window'** or right click on plot to Export to csv.
-
-Most of these operations are detailed in other sections, and are shared
-with other aspects of the MOOSE simulation interface. Here we focus on
-the Kinetikit-specific items.
-
-`Model layout and icons <#TOC>`__
----------------------------------
-
-When you are in the **'Editor View'** tab you will see a collection of
-icons, arrows, and grey boxes surrounding these. This is a schematic of
-the reaction scheme being modeled. You can view and change parameters,
-and change the layout of the model.
-
-.. figure:: ../../../images/Moose1.png
-  :alt:
-
-Resizing the model layout and icons:
-
--  **Zoom**:Â Â Comma and period keys. Alternatively, the mouse scroll wheel or vertical scroll line on the track pad will cause the display to zoom in and out.
--  **Pan**:Â Â The arrow keys move the display left, right, up, and down.
--  **Entire Model View**:Â Â Pressing the **'a'** key will fit the entire model into the entire field of view.
--  **Resize Icons**:Â Â Angle bracket keys, that is, **'<'** and **'>'** or **'+'** and **'-'**. This resizes the icons while leaving their positions on the screen layout more or less the same.
--  **Original Model View**:Â Â Pressing the **'A'** key (capital 'A') will revert to the original model view including the original icon scaling.
-
-`Compartment <#TOC>`__
-^^^^^^^^^^^^^^^^^^^^^^
-
-The *compartment* in moose is usually a contiguous domain in which a
-certain set of chemical reactions and molecular species occur. The
-definition is very closely related to that of a cell-biological
-compartment. Examples include the extracellular space, the cell
-membrane, the cytosol, and the nucleus. Compartments can be nested, but
-of course you cannot put a bigger compartment into a smaller one.
-
--  **Icon**: Grey boundary around a set of reactions.
--  **Moving Compartments**: Click and drag on the boundary.
--  **Resizing Compartment boundary**: Happens automatically when contents are repositioned, so that the boundary just contains contents.
--  **Compartment editable parameters**:
-
-  -  **'name'**: The name of the compartment.
-  -  **'size'**: This is the volume, surface area or length of the compartment, depending on its type.
-
--  **Compartment fixed parameters**:
-
-  -  **'numDimensions'**: This specifies whether the compartment is a volume, a 2-D surface, or if it is just being represented as a length.
-
-`Pool <#TOC>`__
-^^^^^^^^^^^^^^^
-
-This is the set of molecules of a given species within a compartment.
-Different chemical states of the same molecule are in different pools.
-
--  **Icon**: |image0| Colored rectangle with pool name in it.
--  **Moving pools**: Click and drag.
--  **Pool editable parameters**:
-
-  -  **name**: Name of the pool
-  -  **n**: Number of molecules in the pool
-  -  **nInit**: Initial number of molecules in the pool. 'n' gets set
-     to this value when the 'reinit' operation is done.
-  -  **conc**: Concentration of the molecules in the pool.
-     ``conc = n * unit_scale_factor / (N<sub>A</sub> * vol)``
-  -  **concInit**: Initial concentration of the molecules in the pool.
-     'conc' is set to this value when the 'reinit' operation is done.
-
-     ``concInit = nInit * unit_scale_factor / (N<sub>A</sub> * vol)``
-
--  **Pool fixed parameters**
-
-  -  **size**: Derived from the compartment that holds the pool.
-     Specifies volume, surface area or length of the holding
-     compartment.
-
-`Buffered pools <#TOC>`__
-^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Some pools are set to a fixed 'n', that is number of molecules, and
-therefore a fixed concentration, throughout a simulation. These are
-buffered pools.
-
--  **Icon**: |image1| Colored rectangle with pool name in it.
--  **Moving Buffered pools**: Click and drag.
--  **Buffered Pool editable parameters**
-
-  -  **name**: Name of the pool
-  -  **nInit**: Fixed number of molecules in the pool. 'n' gets set to
-     this value throughout the run.
-  -  **concInit**: Fixed concentration of the molecules in the pool.
-     'conc' is set to this value throughout the run.
-
-     ``concInit = nInit * unit_scale_factor / (N<sub>A</sub> * vol)``
-
--  **Pool fixed parameters**:
-
-  -  **n**: Number of molecules in the pool. Derived from 'nInit'.
-  -  **conc**: Concentration of molecules in the pool. Derived from
-     'concInit'.
-  -  **size**: Derived from the compartment that holds the pool.
-     Specifies volume, surface area or length of the holding
-     compar'tment.
-
-`Reaction <#TOC>`__
-^^^^^^^^^^^^^^^^^^^
-
-These are conversion reactions between sets of pools. They are
-reversible, but you can set either of the rates to zero to get
-irreversibility. In the illustration below, **'D'** and **'A'** are
-substrates, and **'B'** is the product of the reaction. This is
-indicated by the direction of the green arrow.
-
-.. figure:: ../../../images/KkitReaction.png
-  :alt:
-
--  **Icon**: |image2| Reversible reaction arrow.
--  **Moving Reactions**: Click and drag.
--  **Reaction editable parameters**:
-  -  **Name** : Name of reaction
-  -  **K\ :sub:`f`** : 'Forward rate' of reaction, in
-     'concentration/time' units. This is the normal way to express and
-     manipulate the reaction rate.
-  -  **k\ :sub:`f`** : Forward rate of reaction, in 'number/time'
-     units. This is used internally for computations, but is
-     volume-dependent and should not be used to manipulate the reaction
-     rate unless you really know what you are doing.
-  -  **K\ :sub:`b`** : Backward rate' of reaction, in
-     'concentration/time' units. This is the normal way to express and
-     manipulate the reaction rate.
-  -  **k\ :sub:`b`** : Backward rate of reaction, in 'number/time'
-     units. This is used internally for computations, but is
-     volume-dependent and should not be used to manipulate the reaction
-     rate unless you really know what you are doing.
--  **Reaction fixed parameters**:
-  -  **numSubstrates**: Number of substrates molecules.
-  -  **numProducts**: Number of product molecules.
-
-`Mass-action enzymes <#TOC>`__
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-These are enzymes that model the chemical equation's
-
-   E + S <===> E.S -> E + P
-
-Note that the second reaction is irreversible. Note also that
-mass-action enzymes include a pool to represent the **'E.S'**
-(enzyme-substrate) complex. In the example below, the enzyme pool is
-named **'MassActionEnz'**, the substrate is **'C'**, and the product is
-**'E'**. The direction of the enzyme reaction is indicated by the red
-arrows.
-
-.. figure:: ../../../images/MassActionEnzReac.png
-  :alt:
-
--  **Icon**: |image3| Colored ellipse atop a small square. The ellipse represents the enzyme. The small square represents **'E.S'**, the enzyme-substrate complex. The ellipse icon has the same color as the enzyme pool **'E'**. It is connected to the enzyme pool **'E'** with a straight line of the same color.
-
-  The ellipse icon sits on a continuous, typically curved arrow in red,
-  from the substrate to the product.
-
-  A given enzyme pool can have any number of enzyme activities, since
-  the same enzyme might catalyze many reactions.
-
--  **Moving Enzymes**: Click and drag on the ellipse.
--  **Enzyme editable parameters**
-
-  -  **name** : Name of enzyme.
-  -  **K\ :sub:`m`** : Michaelis-Menten value for enzyme, in
-     'concentration' units.
-  -  **k\ :sub:`cat`** : Production rate of enzyme, in '1/time' units.
-     Equal to k\ :sub:`3`, the rate of the second, irreversible
-     reaction.
-  -  **k1** : Forward rate of the **E+S** reaction, in number and
-     '1/time' units. This is what is used in the internal calculations.
-  -  **k2** : Backward rate of the **E+S** reaction, in '1/time' units.
-     Used in internal calculations.
-  -  **k3** : Forward rate of the **E.S -> E + P** reaction, in
-     '1/time' units. Equivalent to k\ :sub:`cat`. Used in internal
-     calculations.
-  -  **ratio** : This is equal to k\ :sub:`2`/k:sub:`3`. Needed to
-     define the internal rates in terms of K\ :sub:`m` and
-     k\ :sub:`cat`. I usually use a value of 4.
-
--  **Enzyme-substrate-complex editable parameters**: These are identica'l to those of any other pool.
-
-  -  **name**: Name of the **E.S** complex. Defaults to \*\*\_cplx\*\*.
-  -  **n**: Number of molecules in the pool
-  -  **nInit**: Initial number of molecules in the complex. 'n' gets set to this value when the 'reinit' operation is done.
-  -  **conc**: Concentration of the molecules in the pool.
-
-     ``conc = n * unit_scale_factor / (N<sub>A</sub> * vol)``
-  -  **concInit**: Initial concentration of the molecules in the pool.
-     'conc' is set to this value when the 'reinit' operation is done.
-     ``concI'nit = nInit * unit_scale_factor / (N<sub>A</sub> * vol)``
-
--  **Enzyme-substrate-complex fixed parameters**:
-
-  -  **size**: Derived from the compartment that holds the pool.
-     Specifies volume, surface area or length of the holding
-     compartment. Note that the Enzyme-substrate-complex is assumed to
-     be in the same compartment as the enzyme molecule.
-
-`Michaelis-Menten Enzymes <#TOC>`__
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-These are enzymes that obey the Michaelis-Menten equation
-
-``V = V<sub>max</sub> * [S] / ( K<sub>m</sub> + [S] ) = k<sub>cat</sub> * [Etot] * [S] / ( K<sub>m</sub> + [S] )``
-where
--  V\ :sub:`max` is the maximum rate of the enzyme
--  [Etot] is the total amount of the enzyme
--  K\ :sub:`m` is the Michaelis-Menten constant
--  S is the substrate.
-
-Nominally these enzymes model the same chemical equation as the mass-action enzyme':
-
-``E + S <===> E.S -> E + P``
-
-but they make the assumption that the **E.S** is in a quasi-steady-state
-with **E** and **S**, and they also ignore sequestration of the enzyme
-into the complex. So there is no representation of the **E.S** complex.
-In the example below, the enzyme pool is named **MM\_Enz**, the
-substrate is **E**, and the product is **P**. The direction of the
-enzyme reaction is indicated by the red arrows.
-
-.. figure:: ../../../images/MM_EnzReac.png
-  :alt:
-
--  **Icon**: |image4| Colored ellipse. The ellipse represents the enzyme
-  The ellipse icon has the same color as the enzyme **'MM\_Enz'**. It
-  is connected to the enzyme pool **'MM\_Enz'** with a straight line of
-  the same color. The ellipse icon sits on a continuous, typically
-  curved arrow in red, from the substrate to the product. A given
-  enzyme pool can have any number of enzyme activities, since the same
-  enzyme might catalyze many reactions.
-- **Moving Enzymes**: Click and drag.
-- **Enzyme editable parameters**:
-
-  -  **name**: Name of enzyme.
-  -  K\ :sub:`m`: Michaelis-Menten value for enzyme, in 'concentration'
-     units.
-  -  k\ :sub:`cat`: Production rate of enzyme, in '1/time' units. Equal to k\ :sub:`3`, the rate of the second, irreversible reaction.
-
-`Summation <#TOC>`__
-^^^^^^^^^^^^^^^^^^^^
-
-Summation object can be used to add specified variable values. The
-variables can be input from pool object.
-
-- **Icon**: This is **Σ** in the example image below. The input pools
-  **'A'** and **'B'** connect to the **Σ** with blue arrows. The
-  function ouput's to BuffPool |image5|
-
-`Model operations <#TOC>`__
-----------------------------
-
-- **Loading models**: **'File -> Load Model -> select from dialog'**.
-  This operation makes the previously loaded model disable and loads newly selected models in **'Model View''**
-- **New**: **'File -> New -> Model name **. This opens a empty widget for model building
-- **Saving models**: **'File -> Save Model -> select from dialog'**.
-- **Changing numerical methods**: **'Preference->Chemical tab'** item from Simulation Control. Currently supports:
-  -  Runge Kutta: This is the Runge-Kutta-Fehlberg implementation from the GNU Scientific Library (GSL). It is a fifth order variable timestep explicit method. Works well for most reaction systems except if they have very stiff reactions.
-  -  Gillespie: Optimized Gillespie stochastic systems algorithm, custom implementation. This uses variable timesteps internally.
-     Note that it slows down with increasing numbers of molecules in
-     each pool. It also slows down, but not so badly, if the number of
-     reactions goes up.
-  -  Exponential Euler:This methods computes the solution of partial
-     and ordinary differential equations.
-
-`Model building <#TOC>`__
--------------------------
-
-- The **Edit Widget** includes various menu options and model icons on
-  the top. Use the mouse buttton to click and drag icons from toolbar
-  to Edit Widget, two things will happen, **icon** will appear in the
-  editor widget and a **object editor** will pop up with lots of
-  parameters with respect to moose object.
-
-.. figure:: ../../../images/chemical_CS.png
-  :alt:
-
-**Rules**:
-::
-
-   *   Compartment has to be created firstly(At present only single compartment model is allowed)
-   *   Enzyme should be dropped on a pool as parent
-   *   function should be dropped on buffPool for output
-
-**Note**:
-::
-
-   *   Drag in pool's and reaction on to the editor widget, now one can set up a reaction.
-   *   Click on mooseObject one can find a little arrow on the top right corner of the object, drag from this little arrow to any object for connection. <br>E.g pool to reaction and reaction to pool. Specific connection type gets specific colored arrow. E.g. Green color arrow for specifying connection between reactant and product for reaction.
-   *   Clicking on the object one can rearrange object for clean layout.
-   *   Second order reaction can also be done by repeating the connection over again
-   *   Each connection can be deleted and using rubberband selection each moose object can be deleted
-
-- From **run widget**, pools are draggable to plot window for plotting.
-  (Currently **conc** is plotted as default field) Plots are
-  color-coded as per in model.
-
-.. figure:: ../../../images/Chemical_run.png
-  :alt:
-
-- Model can be run by clicking **start** button. One can stop button in
-  mid-stream and start up again without affectiong the calculations.
-  The reset button clears the simulation.
-
-.. |image0| image:: ../../../images/Pool.png
-.. |image1| image:: ../../../images/BufPool.png
-.. |image2| image:: ../../../images/KkitReacIcon.png
-.. |image3| image:: ../../../images/MassActionEnzIcon.png
-.. |image4| image:: ../../../images/MM_EnzIcon.png
-.. |image5| image:: ../../../images/func.png
-
-.. _ckbk-chem-rde:
-
-RDesigneur
-==========
-
-.. _ckbk-chem-tut:
-
-Tutorials
-=========
-
-Deterministic Simulation
-------------------------
-
-Stochastic Simulation
----------------------
-
-Finding Steady State (CSpace)
------------------------------
-
-.. automodule:: cspaceSteadyState
-   :members:
-
-Building Simple Reaction Model
-------------------------------
-
-Define a kinetic model using the scripting
-------------------------------------------
-
-.. automodule:: scriptKineticModel
-   :members:
-
-.. _ckbk-chem-adv:
-
-Advanced Examples
-=================
+   chem_GUI
+   chem_load_save
+   chem_sim_eg
+   chem_tut
diff --git a/docs/source/user/py/cookbook/elec.rst b/docs/source/user/py/cookbook/elec.rst
index ba4ccd12fc79f761a91a1b66df2c08679891eb7e..aa23f757c6283d88d3b32984a2beb69fdf930066 100644
--- a/docs/source/user/py/cookbook/elec.rst
+++ b/docs/source/user/py/cookbook/elec.rst
@@ -2,117 +2,10 @@
 Single Neuron Electrical Aspects (BioPhysics)
 *********************************************
 
-.. contents::
-   :local:
-   :depth: 1
+.. toctree::
+   :maxdepth: 2
 
-.. _ckbk-elec-load-run:
-
-Load and Run simple models
-==========================
-
-Single Cubicle Compartmental Neuron
------------------------------------
-
-.. automodule:: cubeMeshSigNeur
-   :members:
-
-Single Neuron Model
--------------------
-
-.. automodule:: testSigNeur
-   :members:
-
-Load neuron model from GENESIS
-------------------------------
-
-.. automodule:: neuronFromDotp
-   :members:
-
-Integrate-and-fire models
--------------------------
-
-.. automodule:: IntegrateFireZoo
-   :members:
-
-.. _ckbk-elec-snippets:
-
-Simple Examples
-===============================
-
-Create a Leaky Neuron
----------------------
-
-.. automodule:: lif
-   :members:
-
-Create a Leaky Compartment
---------------------------
-
-.. automodule:: lifcomp
-   :members:
-
-Voltage Clamping
-----------------
-
-.. automodule:: vclamp
-  :members:
-
-Generate Pulse
-----------------
-
-.. automodule:: pulsegen
-   :members:
-
-.. automodule:: pulsegen2
-   :members:
-
-Synapse
--------
-
-.. automodule:: synapse
-  :members:
-
-Message transmission via synapse
---------------------------------
-
-.. automodule:: intfire
-   :members:
-
-Gap Junction
-------------
-
-.. automodule:: gapjunction
-   :members:
-
-Insert Spine heads
-------------------
-
-.. automodule:: insertSpinesWithoutRdesigneur
-   :members:
-
-Multi compartmental Neuron model
---------------------------------
-
-.. automodule:: testHsolve
-   :members:
-
-.. _ckbk-elec-gui:
-
-GUI
-===
-
-.. _ckbk-elec-rde:
-
-RDesigneur
-==========
-
-.. _ckbk-elec-tut:
-
-Tutorials
-=========
-
-.. _ckbk-elec-adv:
-
-Advanced Examples
-=================
+   elec_mod
+   elec_GUI
+   elec_load_run
+   elec_sim_eg
diff --git a/docs/source/user/py/cookbook/multiscale.rst b/docs/source/user/py/cookbook/multiscale.rst
index dc65942cf4fff31d759f3a4c89544d87e89411f6..a8a83165c1675bd3d697107ed76aa9be96a40915 100644
--- a/docs/source/user/py/cookbook/multiscale.rst
+++ b/docs/source/user/py/cookbook/multiscale.rst
@@ -2,81 +2,8 @@
 MultiScale Modeling
 *******************
 
-.. contents::
-   :local:
-   :depth: 1
+.. toctree::
+   :maxdepth: 2
 
-.. _ckbk-multi-load-run:
-
-Load and Run simple models
-==========================
-
-.. _ckbk-multi-snippets:
-
-Simple Examples
-===============
-
-Single-compartment multiscale model
------------------------------------
-
-.. automodule:: multiscaleOneCompt
-   :members:
-
-Multi compartment Single Neuron Model
--------------------------------------
-
-.. automodule:: multiComptSigNeur
-   :members:
-
-Multi-compartment multiscale model
-----------------------------------
-
-Modeling chemical reactions in neurons
---------------------------------------
-
-.. automodule:: gssaRDspiny
-   :members:
-
-.. automodule:: rxdSpineSize
-   :members:
-
-.. _ckbk-multi-gui:
-
-GUI
-===
-
-.. _ckbk-multi-rdes:
-
-RDesigneur
-==========
-
-Building Chemical-Electrical Signalling Models using Rdesigneur
----------------------------------------------------------------
-
-Building a compartment
-^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: testRdesigneur
-   :members:
-
-Inserting Spines and viewing
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: insertSpines
-   :members:
-
-Proceeding with Spines
-^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: testWigglySpines
-   :members:
-
-.. _ckbk-multi-tut:
-
-Tutorials
-=========
-
-.. _ckbk-multi-adv:
-
-Advanced Examples
-=================
+   multi_sim_eg
+   multi_rdes
diff --git a/docs/source/user/py/cookbook/network.rst b/docs/source/user/py/cookbook/network.rst
index 49eafdb4de7b424b40f9403a22e3db0114c813b4..d016e1dcce893d264bf0912439d2a252fda59630 100644
--- a/docs/source/user/py/cookbook/network.rst
+++ b/docs/source/user/py/cookbook/network.rst
@@ -2,97 +2,8 @@
 Networking
 **********
 
-.. contents::
-   :local:
-   :depth: 1
+.. toctree::
+   :maxdepth: 2
 
-.. _ckbk-net-load-run:
-
-Load and Run simple models
-==========================
-
-.. _ckbk-net-snippets:
-
-Simple Examples
-===============================
-
-Connecting two cells via a synapse
-----------------------------------
-
-.. automodule:: twocells
-   :members:
-
-Multi Compartmental Leaky Neurons
----------------------------------
-
-.. automodule:: multicomp_lif
-   :members:
-
-Providing random input to a cell
---------------------------------
-
-.. automodule:: randomspike
-   :members:
-
-Plastic synapse
----------------
-
-.. automodule:: STDP
-   :members:
-
-Synapse Handler for Spikes
---------------------------
-
-.. automodule:: RandSpikeStats
-   :members:
-
-Recurrent integrate-and-fire network
-------------------------------------
-
-.. automodule:: recurrentIntFire
-   :members:
-
-Recurrent integrate-and-fire network with plasticity
-----------------------------------------------------
-
-.. automodule:: recurrentLIF
-   :members:
-
-Demonstration Models
---------------------
-
-.. automodule:: compartment_net
-   :members:
-
-.. automodule:: compartment_net_no_array
-   :members:
-
-Building Models
----------------
-
-.. automodule:: synapse_tutorial
-   :members:
-
-.. _ckbk-net-gui:
-
-GUI
-===
-
-.. _ckbk-net-tut:
-
-Tutorials
-=========
-
-Network with Ca-based plasticity
---------------------------------
-
-.. automodule:: GraupnerBrunel2012_STDPfromCaPlasticity
-   :members:
-
-.. automodule:: HigginsGraupnerBrunel2014_LifetimeCaPlasticity
-   :members:
-
-.. _ckbk-net-adv:
-
-Advanced Examples
-=================
+   net_sim_eg
+   net_tut
diff --git a/docs/source/user/py/graphics/content_g.rst b/docs/source/user/py/graphics/content_g.rst
index e115dc824d82db751fecc489278befc09b389214..6080c48ec9adaea51cfd0ad7b83167d83e7a125a 100644
--- a/docs/source/user/py/graphics/content_g.rst
+++ b/docs/source/user/py/graphics/content_g.rst
@@ -8,6 +8,7 @@ Use Moogli for plotting
 
 .. automodule:: loadMorphology
    :members:
+   :noindex:
 
 MatPlotLib
 ==========
@@ -17,12 +18,15 @@ Displaying time-series plots
 
 .. automodule:: crossComptNeuroMesh
    :members:
+   :noindex:
 
 Animation of values along axis
 ------------------------------
 
 .. automodule:: diffSpinyNeuron
    :members:
+   :noindex:
 
 .. automodule:: reacDiffBranchingNeuron
    :members:
+   :noindex:
diff --git a/docs/source/user/py/quickstart/index_qs.rst b/docs/source/user/py/quickstart/index_qs.rst
index 5107d12b4326760c4f7b9fb765c06551001a5a81..c75b441d2b44c1bb44d586ff115a765d74b323e7 100644
--- a/docs/source/user/py/quickstart/index_qs.rst
+++ b/docs/source/user/py/quickstart/index_qs.rst
@@ -11,3 +11,5 @@ Quick Start
 
    qs_GUI
    moose_quickstart
+   demos
+   classes_demos
diff --git a/docs/source/user/py/quickstart/moose_quickstart.rst b/docs/source/user/py/quickstart/moose_quickstart.rst
index 8dc7583d2cd8afaafdc709f65580ca04893325b9..b1604e7f91963bab52655f57a31804096f7956d3 100644
--- a/docs/source/user/py/quickstart/moose_quickstart.rst
+++ b/docs/source/user/py/quickstart/moose_quickstart.rst
@@ -5,7 +5,7 @@ Getting started with python scripting for MOOSE
 .. contents::
    :local:
    :depth: 1
-   
+
 .. _quickstart-intro:
 
 Introduction
@@ -20,7 +20,7 @@ simulate existing models in one of the supported formats, you can fire
 the MOOSE GUI and locate the model file using the ``File`` menu and
 load it. The GUI is described in separate document. If you
 are looking for recipes for specific tasks, take a look at
-:doc:`moose_cookbook`. The example code in the boxes can be entered in
+`cookbook`. The example code in the boxes can be entered in
 a Python shell.
 
 .. _quickstart-importing:
@@ -644,7 +644,7 @@ Moving on
 
 Now you know the basics of pymoose and how to access the help
 system. You can figure out how to do specific things by looking at the
-:doc:`moose_cookbook`.  In addition, the ``moose-examples/snippets`` directory
+'cookbook`.  In addition, the ``moose-examples/snippets`` directory
 in your MOOSE installation has small executable python scripts that
 show usage of specific classes or functionalities. Beyond that you can
 browse the code in the ``moose-examples`` directory to see some more complex
@@ -680,190 +680,3 @@ help you get started.
    scheduling following the MOOSE API. So you have to consult the class'
    documentation for any nonstandard methods that can be scheduled this
    way.
-
-Demonstration of basic functionalities
-======================================
-
-.. _quickstart-load-run:
-
-Load and Run a Model
---------------------
-
-.. automodule:: helloMoose
-  :members:
-
-.. _quickstart-timing:
-
-Start, Stop, and setting clocks
--------------------------------
-
-.. automodule:: startstop
-  :members:
-
-.. automodule:: stimtable
-  :members:
-
-.. _quickstart-python_from_moose:
-
-Run Python from MOOSE
----------------------
-
-.. automodule:: pyrun
-  :members:
-
-.. automodule:: pyrun1
-  :members:
-
-.. _quickstart-classes:
-
-MOOSE Classes
--------------
-
-Messages
-^^^^^^^^
-
-One-to-one message
-""""""""""""""""""
-
-.. automodule:: onetoonemsg
-	:members:
-
-Show the message
-""""""""""""""""
-
-.. automodule:: showmsg
-  :members:
-
-Single Message Cross
-""""""""""""""""""""
-
-.. automodule:: singlemsgcross
-  :members:
-
-Time
-^^^^
-
-Clocks
-""""""
-
-.. automodule:: showclocks
-  :members:
-
-Generating Time Data Table
-""""""""""""""""""""""""""
-
-.. automodule:: timetable
-  :members:
-
-Vectors
-^^^^^^^
-
-.. automodule:: vectors
-  :members:
-
-Data Entries
-^^^^^^^^^^^^
-
-.. automodule:: wildcard
-  :members:
-
-Interpolation
-^^^^^^^^^^^^^
-
-1-dimentional Interpolation
-"""""""""""""""""""""""""""
-
-.. automodule:: interpol
-  :members:
-
-2-dimentional interpolation
-"""""""""""""""""""""""""""
-
-.. automodule:: interpol2d
-  :members:
-
-Function
-^^^^^^^^
-
-.. automodule:: func
-  :members:
-
-SymCompartment
-^^^^^^^^^^^^^^
-
-.. automodule:: symcompartment
-  :members:
-
-Tables
-^^^^^^
-
-.. automodule:: tabledemo
-  :members:
-
-Data Types
-^^^^^^^^^^
-
-HDF DataType
-""""""""""""
-
-.. automodule:: hdfdemo
-  :members:
-
-NSDF DataType
-"""""""""""""
-
-.. automodule:: nsdf
-  :members:
-
-.. automodule:: nsdf_vec
-  :members:
-
-Threading
-^^^^^^^^^
-
-.. automodule:: threading_demo
-  :members:
-
-PyMoose
-^^^^^^^
-
-.. automodule:: traub_naf
-  :members:
-
-.. _quickstart-maths:
-
-Mathematics with MOOSE
-^^^^^^^^^^^^^^^^^^^^^^
-
-Computing an arbitrary function
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: function
-  :members:
-
-Differential Equation Solving
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: diffEqSolution
-  :members:
-
-Harmonic Oscillatory Function
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: funcRateHarmonicOsc
-  :members:
-
-Lotka-Voltera Model
-^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: funcReacLotkaVolterra
-  :members:
-
-.. automodule:: stochasticLotkaVolterra
-  :members:
-
-Vary Concentration with mathematical function
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-.. automodule:: funcInputToPools
-  :members:
diff --git a/docs/source/user/py/quickstart/qs_GUI.rst b/docs/source/user/py/quickstart/qs_GUI.rst
index f4044b35e9cfac0a04b4e2e6e6eaab6b3ff11595..b0b58c50c15c8cd6f8767b8fea936acd645876ba 100644
--- a/docs/source/user/py/quickstart/qs_GUI.rst
+++ b/docs/source/user/py/quickstart/qs_GUI.rst
@@ -96,6 +96,7 @@ View menu option provides the following sub options -
 -  `Editor View <#editor-view>`_ - Switch to the editor view for editing models.
 -  `Run View <#run-view>`_ - Switch to run view for running models.
 -  `Dock Widgets <#dock-widgets>`_ - Following dock widgets are provided
+
   -  `Python <#dock-widget-python>`_ - Brings up a full fledged python
      interpreter integrated with MOOSE GUI. You can interact with
      loaded models and load new models through the PyMoose API. The
@@ -105,8 +106,8 @@ View menu option provides the following sub options -
      editing the fields of a selected object such as a pool, enzyme,
      function or compartment. Editable field values can be changed by
      clicking on them and overwriting the new values. Please be sure to
-     press enter once the editing is complete, in order to save your
-     changes.
+     press enter once the editing is complete, in order to save your changes.
+
 -  `SubWindows <#subwindows>`_ - This allows you to tile or tabify the run and editor views.
 
 Help
@@ -120,7 +121,8 @@ Editor View
 ~~~~~~~~~~~
 
 The editor view provides two windows -
--  `Model Editor <#model-editor>`_ - The model editor is a workspace to
+
+- `Model Editor <#model-editor>`_ - The model editor is a workspace to
   edit and create models. Using click-and-drag from the icons in the
   menu bar, you can create model entities such as chemical pools,
   reactions, and so on. A click on any object brings its property
@@ -137,7 +139,8 @@ The editor view provides two windows -
   :alt: Chemical Signalling Model Editor
 
   Chemical Signalling Model Editor
--  `Property Editor <#property-editor>`_ - The property editor provides a way of viewing and editing the properties of objects selected in the model editor.
+
+- `Property Editor <#property-editor>`_ - The property editor provides a way of viewing and editing the properties of objects selected in the model editor.
 
 .. figure:: ../../../images/PropertyEditor.png
   :align: center
diff --git a/docs/source/user/py/references/index_ref.rst b/docs/source/user/py/references/index_ref.rst
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..549f9e7c470d0e335ff39726cadcc3ad8ba1d457 100644
--- a/docs/source/user/py/references/index_ref.rst
+++ b/docs/source/user/py/references/index_ref.rst
@@ -0,0 +1,27 @@
+References
+==========
+
+How to use the documentation
+----------------------------
+
+MOOSE documentation is split into Python documentation and builtin
+documentation. The functions and classes that are only part of the
+Python interface can be viewed via Python's builtin ``help``
+function::
+
+   >>> help(moose.connect)
+
+The documentation built into main C++ code of MOOSE can be accessed
+via the module function ``doc``::
+
+   >>> moose.doc('Neutral')
+
+To get documentation about a particular field::
+
+   >>> moose.doc('Neutral.childMsg')
+
+.. toctree::
+   :maxdepth: 2
+
+   moose_functions
+   moose_classes
diff --git a/moose-core/.travis/travis_build_linux.sh b/moose-core/.travis/travis_build_linux.sh
index 3a2ebbfa48f5022d52eb5af6bec4e001ce91025d..b993e109f7ec82154791414896c6b02e5b7c645c 100755
--- a/moose-core/.travis/travis_build_linux.sh
+++ b/moose-core/.travis/travis_build_linux.sh
@@ -20,22 +20,20 @@
 set -o nounset                              # Treat unset variables as an error
 set -e
 
+PYTHON2="/usr/bin/python2"
+PYTHON3="/usr/bin/python3"
 #MAKEFLAGS="-j 4"
 
-PYTHON2="/usr/bin/python2"
 # Bug: `which python` returns /opt/bin/python* etc on travis. For which numpy
 # many not be available. Therefore, it is neccessary to use fixed path for
 # python executable.
-PYTHON3="/usr/bin/python3"
 
 (
     # Old makefile based flow.
     $PYTHON2 -m compileall -q .
     if type $PYTHON3 > /dev/null; then $PYTHON3 -m compileall -q . ; fi
-    ## DEPRECATED: No longer testing make file.
-
-    ## Traditional make.
-    #make 
+    # Traditional make.
+    make 
     ## CMAKE based flow
     mkdir -p _GSL_BUILD && cd _GSL_BUILD && \
         cmake -DDEBUG=ON -DPYTHON_EXECUTABLE="$PYTHON2" ..
diff --git a/moose-core/.travis/travis_prepare_linux.sh b/moose-core/.travis/travis_prepare_linux.sh
index d016aa5baab4dcf5226b6c7209c0625a2b12d408..ce068f9bf2fc2497ef2ca738a468e1acffb46541 100755
--- a/moose-core/.travis/travis_prepare_linux.sh
+++ b/moose-core/.travis/travis_prepare_linux.sh
@@ -29,4 +29,3 @@ apt-get install -qq libboost-all-dev
 apt-get install -qq libgsl0-dev
 apt-get install -qq python-pip python3-pip
 apt-get install -qq libgraphviz-dev
-pip3 install numpy
diff --git a/moose-core/CMakeLists.txt b/moose-core/CMakeLists.txt
index 4f3667a5f0bbfea6e53267b1c4bce1ca85011f40..aa1c243d0ffd727d1926ec67bd07d9d31a38a087 100644
--- a/moose-core/CMakeLists.txt
+++ b/moose-core/CMakeLists.txt
@@ -11,11 +11,9 @@ endif(COMMAND cmake_policy)
 
 project(MOOSE)
 
-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
 include(CheckCXXCompiler.cmake)
 include(CheckIncludeFileCXX)
 include(FindPkgConfig)
-include(GetRevision)
 
 # If from command line, version info is not passed, use the git to generate a
 # version file. If GIT fails, use the previous known version.
@@ -29,14 +27,14 @@ if( (NOT MOOSE_VERSION) AND GIT_EXEC)
         OUTPUT_VARIABLE MOOSE_VERSION
         OUTPUT_STRIP_TRAILING_WHITESPACE
         )
-endif( )
-
-# Default to current date.
-if( (NOT MOOSE_VERSION)  )
-    NOW(TIMESTAMP)
-    set(MOOSE_VERSION "nightly-${TIMESTAMP}" )
+    message(STATUS "+ Writing ${MOOSE_VERSION} to ${VERSION_FILE}" )
+    file(WRITE ${VERSION_FILE} ${MOOSE_VERSION})
+elseif( (NOT MOOSE_VERSION) AND (NOT GIT_EXEC) )
+    message(STATUS "+ Reading ${VERSION_FILE}" )
+    file(READ ${VERSION_FILE} GIT_VERSION_OUTPUT )
 elseif(MOOSE_VERSION)
     message(STATUS "+ Using user specified VERSION = ${MOOSE_VERSION}" )
+    file(WRITE ${VERSION_FILE} ${MOOSE_VERSION})
 else()
     message(FATAL_ERROR "Could not determine MOOSE_VERSION" )
 endif( )
@@ -44,9 +42,6 @@ endif( )
 add_definitions( -DMOOSE_VERSION="${MOOSE_VERSION}")
 message( STATUS "MOOSE Version ${MOOSE_VERSION}" )
 
-# Write VERSION to a file VERSION so that setup.py can use it.
-file(WRITE ${VERSION_FILE} ${MOOSE_VERSION} )
-
 # This snippet is from LLVM project.
 # Sanity check our source directory to make sure that we are not trying to
 # generate an in-tree build (unless on MSVC_IDE, where it is ok), and to make
@@ -103,6 +98,9 @@ option(WITH_MPI  "Enable Openmpi support" OFF)
 option(WITH_BOOST "Use boost library instead of GSL" OFF)
 option(WITH_GSL  "Use gsl-library. Alternative is WITH_BOOST" ON)
 
+################################# CMKAE MACROS #################################
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
 
 ############################ BUILD CONFIGURATION #################################
 
@@ -307,9 +305,15 @@ if(WITH_MPI)
     endif()
 endif(WITH_MPI)
 
-# Always use private version of muparser. We have some custom edits.
-add_subdirectory(external/muparser)
-list(APPEND MOOSE_LIBRARIES muparser)
+pkg_check_modules(MUPARSER muparser)
+if(MUPARSER_FOUND)
+    message(STATUS "Using system muparser ${MUPARSER_VERSION}")
+    list(APPEND SYSTEM_SHARED_LIBS ${MUPARSER_LIBRARIES})
+else()
+    message(STATUS "Using private muparser")
+    add_subdirectory(external/muparser)
+    list(APPEND MOOSE_LIBRARIES muparser)
+endif()
 
 # Add subdirectroeis
 add_subdirectory(basecode)
diff --git a/moose-core/CheckCXXCompiler.cmake b/moose-core/CheckCXXCompiler.cmake
index a87acde8d8136fa8d7fc1e09369cce64b3f65cdb..15a4d730b98679a10bf42e9c5f8df04d6de3fd58 100644
--- a/moose-core/CheckCXXCompiler.cmake
+++ b/moose-core/CheckCXXCompiler.cmake
@@ -37,7 +37,7 @@ if(COMPILER_SUPPORTS_CXX11)
 elseif(COMPILER_SUPPORTS_CXX0X)
     message(STATUS "Your compiler supports c++0x features. Enabling it")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-    add_definitions( -DENABLE_CPP11 )
+    add_definitions( -DENABLE_CXX11 )
     add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS -DBOOST_NO_SCOPED_ENUMS )
     if(APPLE)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
diff --git a/moose-core/Makefile b/moose-core/Makefile
index 3df49b3d6716d97edac4b4b4f31b66f12f55e8db..5dda459827e9ab9c719b762b9e19946bd0ab0daf 100644
--- a/moose-core/Makefile
+++ b/moose-core/Makefile
@@ -273,12 +273,12 @@ endif
 
 # Here we automagically change compilers to deal with MPI.
 ifdef USE_MPI
-	CXX = mpicxx --std=c++11
+	CXX = mpicxx
 #	CXX = /usr/local/mvapich2/bin/mpicxx
 #	PARALLEL_DIR = parallel
 #	PARALLEL_LIB = parallel/parallel.o
 else
-	CXX = g++  --std=c++11
+	CXX = g++
 #	CXX = CC	# Choose between Solaris CC and g++ on a Solaris machine
 endif
 
diff --git a/moose-core/basecode/SparseMatrix.h b/moose-core/basecode/SparseMatrix.h
index ecbc71eafa78149c8e67e09de69f5a7ceba6a34e..88d2681c65fd06f8a5f5479d348606f247038905 100644
--- a/moose-core/basecode/SparseMatrix.h
+++ b/moose-core/basecode/SparseMatrix.h
@@ -423,19 +423,6 @@ public:
                           colIndexArg.begin(), colIndexArg.end() );
         rowStart_[rowNum + 1] = N_.size();
     }
-	/// Here we expose the sparse matrix for MOOSE use.
-	const vector< T >& matrixEntry() const
-	{
-		return N_;
-	}
-	const vector< unsigned int >& colIndex() const
-	{
-		return colIndex_;
-	}
-	const vector< unsigned int >& rowStart() const
-	{
-		return rowStart_;
-	}
     //////////////////////////////////////////////////////////////////
     // Operations on entire matrix.
     //////////////////////////////////////////////////////////////////
@@ -582,7 +569,7 @@ public:
 
     void tripletFill( const vector< unsigned int >& row,
                       const vector< unsigned int >& col,
-                      const vector< T >& z, bool retainSize = false )
+                      const vector< T >& z )
     {
         unsigned int len = row.size();
         if ( len > col.size() ) len = col.size();
@@ -591,20 +578,16 @@ public:
         for ( unsigned int i = 0; i < len; ++i )
             trip[i]= Triplet< T >(z[i], row[i], col[i] );
         sort( trip.begin(), trip.end(), Triplet< T >::cmp );
-    	unsigned int nr = nrows_;
-    	unsigned int nc = ncolumns_;
-		if ( !retainSize ) {
-    		nr = trip.back().b_ + 1;
-    		nc = 0;
-    		for ( typename vector< Triplet< T > >::iterator i =
-                trip.begin(); i != trip.end(); ++i )
-    		{
-        		if ( nc < i->c_ )
-            		nc = i->c_;
-    		}
-    		nc++;
-		}
-   		setSize( nr, nc );
+        unsigned int nr = trip.back().b_ + 1;
+        unsigned int nc = 0;
+        for ( typename vector< Triplet< T > >::iterator i =
+                    trip.begin(); i != trip.end(); ++i )
+        {
+            if ( nc < i->c_ )
+                nc = i->c_;
+        }
+        nc++;
+        setSize( nr, nc );
 
         vector< unsigned int > colIndex( nc );
         vector< T > entry( nc );
diff --git a/moose-core/basecode/global.cpp b/moose-core/basecode/global.cpp
index b54fc979131dce4103a106281a28ab23ef0d7375..ec5a523e78e911755e12565e854af321b5172ada 100644
--- a/moose-core/basecode/global.cpp
+++ b/moose-core/basecode/global.cpp
@@ -87,7 +87,7 @@ namespace moose {
      *
      * @param x 
      */
-    void mtseed( int x )
+    void mtseed( unsigned int x )
     {
         moose::__rng_seed__ = x;
         moose::rng.setSeed( x );
diff --git a/moose-core/basecode/global.h b/moose-core/basecode/global.h
index 40b2dba5758c8c848e49ecca9a7b92257b4c9d9f..9b06b2820245f1ef4d8fd0639be1b3e6f42a5a13 100644
--- a/moose-core/basecode/global.h
+++ b/moose-core/basecode/global.h
@@ -109,7 +109,7 @@ namespace moose
      *
      * @param seed
      */
-    void mtseed( int seed );
+    void mtseed( unsigned int seed );
 
     /**
      * @brief Generate a random double between 0 and 1
diff --git a/moose-core/biophysics/CaConc.cpp b/moose-core/biophysics/CaConc.cpp
index 2ecf503491e562555271424772371699b1025ea9..40f3bf2b7be1002cb77cfecb90f682cebfde56c7 100644
--- a/moose-core/biophysics/CaConc.cpp
+++ b/moose-core/biophysics/CaConc.cpp
@@ -17,13 +17,13 @@ const Cinfo* CaConc::initCinfo()
 {
 	static string doc[] =
 	{
-		"Name", "CaConc",
-		"Author", "Upinder S. Bhalla, 2014, NCBS",
-		"Description", "CaConc: Calcium concentration pool. Takes current from a "
-				"channel and keeps track of calcium buildup and depletion by a "
-				"single exponential process. ",
+		"Name", "CaConc \n",
+		"Author", "Upinder S. Bhalla, 2014, NCBS \n",
+		"Description", "CaConc: Calcium concentration pool. Takes current from a \n"
+				"channel and keeps track of calcium buildup and depletion by a \n"
+				"single exponential process. \n",
 	};
-        
+
         static Dinfo< CaConc > dinfo;
 
 	static Cinfo CaConcCinfo(
@@ -177,16 +177,16 @@ void testCaConc()
 	cc.setB( 5.2e-6 / 1e-15 );
 	// Faraday constant = 96485.3415 s A / mol
 	// Use a 1 pA input current. This should give (0.5e-12/F) moles/sec
-	// influx, because Ca has valence of 2. 
+	// influx, because Ca has valence of 2.
 	// So we get 5.2e-18 moles/sec coming in.
 	// Our volume is 1e-15 m^3
 	// So our buildup should be at 5.2e-3 moles/m^3/sec = 5.2 uM/sec
 	double curr = 1e-12;
 	// This will settle when efflux = influx
 	// dC/dt = B*Ik - C/tau = 0.
-	// so Ca = CaBasal + tau * B * Ik = 
+	// so Ca = CaBasal + tau * B * Ik =
 	// 0.0001 + 0.1 * 5.2e-6 * 1e3 = 0.000626
-	
+
 	ProcInfo p;
 	p.dt = 0.001;
 	p.currTime = 0.0;
@@ -214,4 +214,4 @@ void testCaConc()
 	cout << "." << flush;
     */
 }
-#endif 
+#endif
diff --git a/moose-core/biophysics/CaConcBase.cpp b/moose-core/biophysics/CaConcBase.cpp
index c484b24827292cb1d2f8b031c066eb2c6562de87..f569cbaeb7651941e0fa53a7ad5d030514dcbca5 100644
--- a/moose-core/biophysics/CaConcBase.cpp
+++ b/moose-core/biophysics/CaConcBase.cpp
@@ -17,13 +17,13 @@
 ///////////////////////////////////////////////////////
 /*
  * This Finfo is used to send out Ca concentration to channels.
- * 
+ *
  * It is exposed here so that HSolve can also use it to send out
  * Ca concentration to the recipients.
  */
 // Static function.
 SrcFinfo1< double >* CaConcBase::concOut() {
-  static SrcFinfo1< double > concOut( "concOut", 
+  static SrcFinfo1< double > concOut( "concOut",
 				      "Concentration of Ca in pool" );
   return &concOut;
 }
@@ -33,10 +33,10 @@ const Cinfo* CaConcBase::initCinfo()
   ///////////////////////////////////////////////////////
   // Shared message definitions
   ///////////////////////////////////////////////////////
-  static DestFinfo process( "process", 
+  static DestFinfo process( "process",
 			    "Handles process call",
 			    new ProcOpFunc< CaConcBase >( &CaConcBase::process ) );
-  static DestFinfo reinit( "reinit", 
+  static DestFinfo reinit( "reinit",
 			   "Handles reinit call",
 			   new ProcOpFunc< CaConcBase >( &CaConcBase::reinit ) );
 
@@ -45,10 +45,10 @@ const Cinfo* CaConcBase::initCinfo()
       &process, &reinit
     };
 
-  static SharedFinfo proc( "proc", 
+  static SharedFinfo proc( "proc",
 			   "Shared message to receive Process message from scheduler",
 			   processShared, sizeof( processShared ) / sizeof( Finfo* ) );
-		
+
   ///////////////////////////////////////////////////////
   // Field definitions
   ///////////////////////////////////////////////////////
@@ -82,10 +82,9 @@ const Cinfo* CaConcBase::initCinfo()
 						    &CaConcBase::getB
 						    );
   static ElementValueFinfo< CaConcBase, double > thick( "thick",
-							"Thickness of Ca shell, assumed cylindrical. Legal range is "
-							"between zero and the radius. If outside this range it is "
-							"taken as the radius. Default zero, ie, the shell is the entire "
-							"thickness of the cylinder", 	
+							"Thickness of Ca shell, assumed cylindrical. Legal range is between 0 \n"
+							"and the radius. If outside this range it is taken as the radius. \n"
+							" Default zero, ie, the shell is the entire thickness of the cylinder \n",
 							&CaConcBase::setThickness,
 							&CaConcBase::getThickness
 							);
@@ -100,7 +99,8 @@ const Cinfo* CaConcBase::initCinfo()
 							   &CaConcBase::getDiameter
 							   );
   static ElementValueFinfo< CaConcBase, double > ceiling( "ceiling",
-							  "Ceiling value for Ca concentration. If Ca > ceiling, Ca = ceiling. If ceiling <= 0.0, there is no upper limit on Ca concentration value.",
+							  "Ceiling value for Ca concentration. If Ca > ceiling, Ca = ceiling. \n"
+                "If ceiling <= 0.0, there is no upper limit on Ca concentration value.",
 							  &CaConcBase::setCeiling,
 							  &CaConcBase::getCeiling
 							  );
@@ -114,34 +114,34 @@ const Cinfo* CaConcBase::initCinfo()
   // MsgDest definitions
   ///////////////////////////////////////////////////////
 
-  static DestFinfo current( "current", 
+  static DestFinfo current( "current",
 			    "Calcium Ion current, due to be converted to conc.",
 			    new EpFunc1< CaConcBase, double >( &CaConcBase::current )
 			    );
 
-  static DestFinfo currentFraction( "currentFraction", 
+  static DestFinfo currentFraction( "currentFraction",
 				    "Fraction of total Ion current, that is carried by Ca2+.",
 				    new EpFunc2< CaConcBase, double, double >( &CaConcBase::currentFraction )
 				    );
 
-  static DestFinfo increase( "increase", 
+  static DestFinfo increase( "increase",
 			     "Any input current that increases the concentration.",
 			     new EpFunc1< CaConcBase, double >( &CaConcBase::increase )
 			     );
 
-  static DestFinfo decrease( "decrease", 
+  static DestFinfo decrease( "decrease",
 			     "Any input current that decreases the concentration.",
 			     new EpFunc1< CaConcBase, double >( &CaConcBase::decrease )
 			     );
 
-  static DestFinfo basal( "basal", 
+  static DestFinfo basal( "basal",
 			  "Synonym for assignment of basal conc.",
 			  new EpFunc1< CaConcBase, double >( &CaConcBase::setCaBasal )
 			  );
 
   static Finfo* CaConcBaseFinfos[] =
     {
-      &proc,		// Shared 
+      &proc,		// Shared
       concOut(),	// Src
       &Ca,		// Value
       &CaBasal,	// Value
@@ -167,13 +167,12 @@ const Cinfo* CaConcBase::initCinfo()
     {
       "Name", "CaConcBase",
       "Author", "Upinder S. Bhalla, 2014, NCBS",
-      "Description", 
-      "CaConcBase: Base class for Calcium concentration "
-      "pool. Takes current from a channel and keeps track of "
-      "calcium buildup and depletion by a "
-      "single exponential process. ",
+      "Description",
+      "CaConcBase: Base class for Calcium concentration pool. \n"
+      "Takes current from a channel and keeps track of calcium buildup and \n"
+      " depletion by a single exponential process. ",
     };
-        
+
   static ZeroSizeDinfo< int > dinfo;
 
   static Cinfo CaConcBaseCinfo(
@@ -341,7 +340,7 @@ void CaConcBase::vSetSolver( const Eref& e, Id hsolve )
 {;}
 
 // static func
-void CaConcBase::zombify( Element* orig, const Cinfo* zClass, 
+void CaConcBase::zombify( Element* orig, const Cinfo* zClass,
 			  Id hsolve )
 {
   if ( orig->cinfo() == zClass )
@@ -355,7 +354,7 @@ void CaConcBase::zombify( Element* orig, const Cinfo* zClass,
   unsigned int j = 0;
   for ( unsigned int i = 0; i < num; ++i ) {
     Eref er( orig, i + start );
-    const CaConcBase* cb = 
+    const CaConcBase* cb =
       reinterpret_cast< const CaConcBase* >( er.data() );
     data[j + 0] = cb->getCa( er );
     data[j + 1] = cb->getCaBasal( er );
@@ -386,4 +385,3 @@ void CaConcBase::zombify( Element* orig, const Cinfo* zClass,
     j += 9; //was 7?
   }
 }
-
diff --git a/moose-core/biophysics/ChanBase.cpp b/moose-core/biophysics/ChanBase.cpp
index c3826c50bba41531a3734fb15e40a29455360d67..b483dbcb6bec2f8860856a3c2890bd9d9e14198b 100644
--- a/moose-core/biophysics/ChanBase.cpp
+++ b/moose-core/biophysics/ChanBase.cpp
@@ -13,21 +13,21 @@
 
 SrcFinfo1< double >* ChanBase::permeability()
 {
-	static SrcFinfo1< double > permeability( "permeabilityOut", 
+	static SrcFinfo1< double > permeability( "permeabilityOut",
 		"Conductance term going out to GHK object" );
 	return &permeability;
 }
 
 SrcFinfo2< double, double >* ChanBase::channelOut()
 {
-	static SrcFinfo2< double, double > channelOut( "channelOut", 
+	static SrcFinfo2< double, double > channelOut( "channelOut",
 		"Sends channel variables Gk and Ek to compartment" );
 	return &channelOut;
 }
 
 SrcFinfo1< double >* ChanBase::IkOut()
 {
-	static SrcFinfo1< double > IkOut( "IkOut", 
+	static SrcFinfo1< double > IkOut( "IkOut",
 		"Channel current. This message typically goes to concen"
 		"objects that keep track of ion concentration." );
 	return &IkOut;
@@ -38,10 +38,10 @@ const Cinfo* ChanBase::initCinfo()
 	/////////////////////////////////////////////////////////////////////
 	// Shared messages
 	/////////////////////////////////////////////////////////////////////
-	static DestFinfo process( "process", 
+	static DestFinfo process( "process",
 		"Handles process call",
 		new ProcOpFunc< ChanBase >( &ChanBase::process ) );
-	static DestFinfo reinit( "reinit", 
+	static DestFinfo reinit( "reinit",
 		"Handles reinit call",
 		new ProcOpFunc< ChanBase >( &ChanBase::reinit ) );
 
@@ -50,13 +50,13 @@ const Cinfo* ChanBase::initCinfo()
 		&process, &reinit
 	};
 
-	static SharedFinfo proc( "proc", 
+	static SharedFinfo proc( "proc",
 		"Shared message to receive Process message from scheduler",
 		processShared, sizeof( processShared ) / sizeof( Finfo* ) );
 
 	/////////////////////////////////////////////////////////////////////
 	/// ChannelOut SrcFinfo defined above.
-	static DestFinfo Vm( "Vm", 
+	static DestFinfo Vm( "Vm",
 		"Handles Vm message coming in from compartment",
 		new OpFunc1< ChanBase, double >( &ChanBase::handleVm ) );
 
@@ -64,7 +64,7 @@ const Cinfo* ChanBase::initCinfo()
 	{
 		channelOut(), &Vm
 	};
-	static SharedFinfo channel( "channel", 
+	static SharedFinfo channel( "channel",
 		"This is a shared message to couple channel to compartment. "
 		"The first entry is a MsgSrc to send Gk and Ek to the compartment "
 		"The second entry is a MsgDest for Vm from the compartment.",
@@ -79,7 +79,7 @@ const Cinfo* ChanBase::initCinfo()
 	{
 		&Vm, permeability()
 	};
-	static SharedFinfo ghk( "ghk", 
+	static SharedFinfo ghk( "ghk",
 		"Message to Goldman-Hodgkin-Katz object",
 		ghkShared, sizeof( ghkShared ) / sizeof( Finfo* ) );
 
@@ -104,7 +104,7 @@ const Cinfo* ChanBase::initCinfo()
 			&ChanBase::setModulation,
 			&ChanBase::getModulation
 		);
-		static ElementValueFinfo< ChanBase, double > Ek( "Ek", 
+		static ElementValueFinfo< ChanBase, double > Ek( "Ek",
 			"Reversal potential of channel",
 			&ChanBase::setEk,
 			&ChanBase::getEk
@@ -127,7 +127,7 @@ const Cinfo* ChanBase::initCinfo()
 ///////////////////////////////////////////////////////
 // MsgDest definitions
 ///////////////////////////////////////////////////////
-	
+
 ///////////////////////////////////////////////////////
 	static Finfo* ChanBaseFinfos[] =
 	{
@@ -141,7 +141,7 @@ const Cinfo* ChanBase::initCinfo()
 		IkOut(),			// Src
 		&proc,				// Shared
 	};
-	
+
 	static string doc[] =
 	{
 		"Name", "ChanBase",
@@ -151,7 +151,7 @@ const Cinfo* ChanBase::initCinfo()
 	};
 
         static  ZeroSizeDinfo< int > dinfo;
-        
+
 	static Cinfo ChanBaseCinfo(
 		"ChanBase",
 		Neutral::initCinfo(),
diff --git a/moose-core/biophysics/Compartment.cpp b/moose-core/biophysics/Compartment.cpp
index 569d6a50de67d46bd2a8335b953f6957a1fe65e3..dda3ee47cfe3645a4a9efc3df895b4d9ad7f58ea 100644
--- a/moose-core/biophysics/Compartment.cpp
+++ b/moose-core/biophysics/Compartment.cpp
@@ -54,18 +54,18 @@ static const Cinfo* compartmentCinfo = Compartment::initCinfo();
 
 
 /*
-const SrcFinfo1< double >* VmOut = 
-	dynamic_cast< const SrcFinfo1< double >* >( 
-			compartmentCinfo->findFinfo( "VmOut" ) ); 
+const SrcFinfo1< double >* VmOut =
+	dynamic_cast< const SrcFinfo1< double >* >(
+			compartmentCinfo->findFinfo( "VmOut" ) );
 			*/
 
-const SrcFinfo1< double >* axialOut = 
+const SrcFinfo1< double >* axialOut =
 	dynamic_cast< const SrcFinfo1< double >* > (
-			compartmentCinfo->findFinfo( "axialOut" ) ); 
+			compartmentCinfo->findFinfo( "axialOut" ) );
 
-const SrcFinfo2< double, double >* raxialOut = 
+const SrcFinfo2< double, double >* raxialOut =
 	dynamic_cast< const SrcFinfo2< double, double >* > (
-			compartmentCinfo->findFinfo( "raxialOut" ) ); 
+			compartmentCinfo->findFinfo( "raxialOut" ) );
 
 //////////////////////////////////////////////////////////////////
 // Here we put the Compartment class functions.
@@ -181,7 +181,7 @@ double Compartment::vGetInitVm( const Eref& e ) const
 void Compartment::vProcess( const Eref& e, ProcPtr p )
 {
         //cout << "Compartment " << e.id().path() << ":: process: A = " << A_ << ", B = " << B_ << endl;
-	A_ += inject_ + sumInject_ + Em_ * invRm_; 
+	A_ += inject_ + sumInject_ + Em_ * invRm_;
 	if ( B_ > EPSILON ) {
 		double x = exp( -B_ * p->dt / Cm_ );
 		Vm_ = Vm_ * x + ( A_ / B_ )  * ( 1.0 - x );
@@ -208,7 +208,7 @@ void Compartment::vReinit(  const Eref& e, ProcPtr p )
         lastIm_ = 0.0;
 	sumInject_ = 0.0;
 	dt_ = p->dt;
-	
+
 	// Send out the resting Vm to channels, SpikeGens, etc.
 	VmOut()->send( e, Vm_ );
 }
@@ -293,7 +293,7 @@ void testCompartment()
 	double Vm = 0.0;
 	double tau = 1.0;
 	double Vmax = 1.0;
-	for ( p.currTime = 0.0; p.currTime < 2.0; p.currTime += p.dt ) 
+	for ( p.currTime = 0.0; p.currTime < 2.0; p.currTime += p.dt )
 	{
 		Vm = c->getVm( compter );
 		double x = Vmax - Vmax * exp( -p.currTime / tau );
@@ -336,7 +336,7 @@ void testCompartmentProcess()
 	assert( ret );
 	Field< double >::setRepeat( cid, "inject", 0 );
 	// Only apply current injection in first compartment
-	Field< double >::set( ObjId( cid, 0 ), "inject", 1.0 ); 
+	Field< double >::set( ObjId( cid, 0 ), "inject", 1.0 );
 	Field< double >::setRepeat( cid, "Rm", Rm );
 	Field< double >::setRepeat( cid, "Ra", Ra );
 	Field< double >::setRepeat( cid, "Cm", Cm );
@@ -363,7 +363,7 @@ void testCompartmentProcess()
 	shell->doSetClock( 0, dt );
 	shell->doSetClock( 1, dt );
 	// Ensure that the inter_compt msgs go between nodes once every dt.
-	shell->doSetClock( 9, dt ); 
+	shell->doSetClock( 9, dt );
 
 	shell->doUseClock( "/compt", "init", 0 );
 	shell->doUseClock( "/compt", "process", 1 );
@@ -374,7 +374,7 @@ void testCompartmentProcess()
 	double Vmax = Field< double >::get( ObjId( cid, 0 ), "Vm" );
 
 	double delta = 0.0;
-	// We measure only the first 50 compartments as later we 
+	// We measure only the first 50 compartments as later we
 	// run into end effects because it is not an infinite cable
 	for ( unsigned int i = 0; i < size; i++ ) {
 		double Vm = Field< double >::get( ObjId( cid, i ), "Vm" );
diff --git a/moose-core/biophysics/CompartmentBase.cpp b/moose-core/biophysics/CompartmentBase.cpp
index 50297e3b9f83a3c8431e2dc91055dc95d1843f5a..94ac948d7fbdaff6a4eae98cfe4b40914ad00f10 100644
--- a/moose-core/biophysics/CompartmentBase.cpp
+++ b/moose-core/biophysics/CompartmentBase.cpp
@@ -19,13 +19,13 @@ using namespace moose;
 
 /*
  * This Finfo is used to send out Vm to channels, spikegens, etc.
- * 
+ *
  * It is exposed here so that HSolve can also use it to send out
  * the Vm to the recipients.
  */
 // Static function.
 SrcFinfo1< double >* CompartmentBase::VmOut() {
-	static SrcFinfo1< double > VmOut( "VmOut", 
+	static SrcFinfo1< double > VmOut( "VmOut",
 		"Sends out Vm value of compartment on each timestep" );
 	return &VmOut;
 }
@@ -35,7 +35,7 @@ SrcFinfo1< double >* CompartmentBase::VmOut() {
 // are still only Vm.
 
 static SrcFinfo1< double >* axialOut() {
-	static SrcFinfo1< double > axialOut( "axialOut", 
+	static SrcFinfo1< double > axialOut( "axialOut",
 		"Sends out Vm value of compartment to adjacent compartments,"
 		"on each timestep" );
 	return &axialOut;
@@ -43,7 +43,7 @@ static SrcFinfo1< double >* axialOut() {
 
 static SrcFinfo2< double, double >* raxialOut()
 {
-	static SrcFinfo2< double, double > raxialOut( "raxialOut", 
+	static SrcFinfo2< double, double > raxialOut( "raxialOut",
 		"Sends out Raxial information on each timestep, "
 		"fields are Ra and Vm" );
 	return &raxialOut;
@@ -62,38 +62,38 @@ const Cinfo* CompartmentBase::initCinfo()
 	///////////////////////////////////////////////////////////////////
 	// Shared messages
 	///////////////////////////////////////////////////////////////////
-	static DestFinfo process( "process", 
+	static DestFinfo process( "process",
 		"Handles 'process' call",
 		new ProcOpFunc< CompartmentBase >( &CompartmentBase::process ) );
 
-	static DestFinfo reinit( "reinit", 
+	static DestFinfo reinit( "reinit",
 		"Handles 'reinit' call",
 		new ProcOpFunc< CompartmentBase >( &CompartmentBase::reinit ) );
-	
+
 	static Finfo* processShared[] =
 	{
 		&process, &reinit
 	};
 
 	static SharedFinfo proc( "proc",
-		"This is a shared message to receive Process messages "
-		"from the scheduler objects. The Process should be called "
-		"_second_ in each clock tick, after the Init message."
+		"This is a shared message to receive Process messages from the scheduler"
+		"objects. The Process should be called _second_ in each clock tick, after the Init message."
 		"The first entry in the shared msg is a MsgDest "
 		"for the Process operation. It has a single argument, "
 		"ProcInfo, which holds lots of information about current "
 		"time, thread, dt and so on. The second entry is a MsgDest "
-		"for the Reinit operation. It also uses ProcInfo. ",
+		"for the Reinit operation. It also uses ProcInfo. "
+		"- Handles 'reinit' and 'process' calls.",
 		processShared, sizeof( processShared ) / sizeof( Finfo* )
 	);
 	///////////////////////////////////////////////////////////////////
-	
-	static DestFinfo initProc( "initProc", 
+
+	static DestFinfo initProc( "initProc",
 		"Handles Process call for the 'init' phase of the CompartmentBase "
 		"calculations. These occur as a separate Tick cycle from the "
 		"regular proc cycle, and should be called before the proc msg.",
 		new ProcOpFunc< CompartmentBase >( &CompartmentBase::initProc ) );
-	static DestFinfo initReinit( "initReinit", 
+	static DestFinfo initReinit( "initReinit",
 		"Handles Reinit call for the 'init' phase of the CompartmentBase "
 		"calculations.",
 		new ProcOpFunc< CompartmentBase >( &CompartmentBase::initReinit ) );
@@ -102,7 +102,7 @@ const Cinfo* CompartmentBase::initCinfo()
 		&initProc, &initReinit
 	};
 
-	static SharedFinfo init( "init", 
+	static SharedFinfo init( "init",
 			"This is a shared message to receive Init messages from "
 			"the scheduler objects. Its job is to separate the "
 			"compartmental calculations from the message passing. "
@@ -113,13 +113,14 @@ const Cinfo* CompartmentBase::initCinfo()
 			"single argument, ProcInfo, which holds lots of "
 			"information about current time, thread, dt and so on. "
 			"The second entry is a dummy MsgDest for the Reinit "
-			"operation. It also uses ProcInfo. ",
+			"operation. It also uses ProcInfo. "
+			"- Handles 'initProc' and 'initReinit' calls.",
 		initShared, sizeof( initShared ) / sizeof( Finfo* )
 	);
 
 	///////////////////////////////////////////////////////////////////
 
-	static DestFinfo handleChannel( "handleChannel", 
+	static DestFinfo handleChannel( "handleChannel",
 		"Handles conductance and Reversal potential arguments from Channel",
 		new EpFunc2< CompartmentBase, double, double >( &CompartmentBase::handleChannel ) );
 	// VmOut is declared above as it needs to be in scope for later funcs.
@@ -128,18 +129,19 @@ const Cinfo* CompartmentBase::initCinfo()
 	{
 		&handleChannel, CompartmentBase::VmOut()
 	};
-	static SharedFinfo channel( "channel", 
+	static SharedFinfo channel( "channel",
 			"This is a shared message from a compartment to channels. "
 			"The first entry is a MsgDest for the info coming from "
 			"the channel. It expects Gk and Ek from the channel "
-			"as args. The second entry is a MsgSrc sending Vm ",
+			"as args. The second entry is a MsgSrc sending Vm "
+			"- Handles 'handleChannel' and 'VmOut' calls.",
 		channelShared, sizeof( channelShared ) / sizeof( Finfo* )
 	);
 	///////////////////////////////////////////////////////////////////
 	// axialOut declared above as it is needed in file scope
-	static DestFinfo handleRaxial( "handleRaxial", 
+	static DestFinfo handleRaxial( "handleRaxial",
 		"Handles Raxial info: arguments are Ra and Vm.",
-		new OpFunc2< CompartmentBase, double, double >( 
+		new OpFunc2< CompartmentBase, double, double >(
 			&CompartmentBase::handleRaxial )
 	);
 
@@ -147,7 +149,7 @@ const Cinfo* CompartmentBase::initCinfo()
 	{
 		axialOut(), &handleRaxial
 	};
-	static SharedFinfo axial( "axial", 
+	static SharedFinfo axial( "axial",
 			"This is a shared message between asymmetric compartments. "
 			"axial messages (this kind) connect up to raxial "
 			"messages (defined below). The soma should use raxial "
@@ -161,12 +163,13 @@ const Cinfo* CompartmentBase::initCinfo()
 			"of the target compartment. The second entry is a MsgDest "
 			"for the info coming from the other compt. It expects "
 			"Ra and Vm from the other compt as args. Note that the "
-			"message is named after the source type. ",
+			"message is named after the source type. "
+			"- Handles 'axialOut' and 'handleRaxial' calls.",
 		axialShared, sizeof( axialShared ) / sizeof( Finfo* )
 	);
 
 	///////////////////////////////////////////////////////////////////
-	static DestFinfo handleAxial( "handleAxial", 
+	static DestFinfo handleAxial( "handleAxial",
 		"Handles Axial information. Argument is just Vm.",
 		new OpFunc1< CompartmentBase, double >( &CompartmentBase::handleAxial ) );
 	// rxialOut declared above as it is needed in file scope
@@ -174,78 +177,78 @@ const Cinfo* CompartmentBase::initCinfo()
 	{
 		&handleAxial, raxialOut()
 	};
-	static SharedFinfo raxial( "raxial", 
-			"This is a raxial shared message between asymmetric "
-			"compartments. The first entry is a MsgDest for the info "
-			"coming from the other compt. It expects Vm from the "
-			"other compt as an arg. The second is a MsgSrc sending "
-			"Ra and Vm to the raxialFunc of the target compartment. ",
+	static SharedFinfo raxial( "raxial",
+			"This is a raxial shared message between asymmetric compartments. The \n"
+			"first entry is a MsgDest for the info coming from the other compt. It \n"
+			"expects Vm from the other compt as an arg. The second is a MsgSrc sending \n"
+			"Ra and Vm to the raxialFunc of the target compartment. \n"
+			"- Handles 'handleAxial' and 'raxialOut' calls.",
 			raxialShared, sizeof( raxialShared ) / sizeof( Finfo* )
 	);
 	///////////////////////////////////////////////////////////////////
 	// Value Finfos.
 	///////////////////////////////////////////////////////////////////
 
-		static ElementValueFinfo< CompartmentBase, double > Vm( "Vm", 
+		static ElementValueFinfo< CompartmentBase, double > Vm( "Vm",
 			"membrane potential",
 			&CompartmentBase::setVm,
 			&CompartmentBase::getVm
 		);
-		static ElementValueFinfo< CompartmentBase, double > Cm( "Cm", 
+		static ElementValueFinfo< CompartmentBase, double > Cm( "Cm",
 			"Membrane capacitance",
 			 &CompartmentBase::setCm,
 			&CompartmentBase::getCm
 		);
-		static ElementValueFinfo< CompartmentBase, double > Em( "Em", 
+		static ElementValueFinfo< CompartmentBase, double > Em( "Em",
 			"Resting membrane potential",
 			 &CompartmentBase::setEm,
 			&CompartmentBase::getEm
 		);
-		static ReadOnlyElementValueFinfo< CompartmentBase, double > Im( "Im", 
+		static ReadOnlyElementValueFinfo< CompartmentBase, double > Im( "Im",
 			"Current going through membrane",
 			&CompartmentBase::getIm
 		);
-		static ElementValueFinfo< CompartmentBase, double > inject( "inject", 
+		static ElementValueFinfo< CompartmentBase, double > inject( "inject",
 			"Current injection to deliver into compartment",
 			&CompartmentBase::setInject,
 			&CompartmentBase::getInject
 		);
-		static ElementValueFinfo< CompartmentBase, double > initVm( "initVm", 
+		static ElementValueFinfo< CompartmentBase, double > initVm( "initVm",
 			"Initial value for membrane potential",
 			&CompartmentBase::setInitVm,
 			&CompartmentBase::getInitVm
 		);
-		static ElementValueFinfo< CompartmentBase, double > Rm( "Rm", 
+		static ElementValueFinfo< CompartmentBase, double > Rm( "Rm",
 			"Membrane resistance",
 			&CompartmentBase::setRm,
 			&CompartmentBase::getRm
 		);
-		static ElementValueFinfo< CompartmentBase, double > Ra( "Ra", 
+		static ElementValueFinfo< CompartmentBase, double > Ra( "Ra",
 			"Axial resistance of compartment",
 			&CompartmentBase::setRa,
 			&CompartmentBase::getRa
 		);
-		static ValueFinfo< CompartmentBase, double > diameter( "diameter", 
+		static ValueFinfo< CompartmentBase, double > diameter( "diameter",
 			"Diameter of compartment",
 			&CompartmentBase::setDiameter,
 			&CompartmentBase::getDiameter
 		);
-		static ValueFinfo< CompartmentBase, double > length( "length", 
+		static ValueFinfo< CompartmentBase, double > length( "length",
 			"Length of compartment",
 			&CompartmentBase::setLength,
 			&CompartmentBase::getLength
 		);
-		static ValueFinfo< CompartmentBase, double > x0( "x0", 
+		static ValueFinfo< CompartmentBase, double > x0( "x0",
 			"X coordinate of start of compartment",
 			&CompartmentBase::setX0,
 			&CompartmentBase::getX0
 		);
-		static ValueFinfo< CompartmentBase, double > y0( "y0", 
+		static ValueFinfo< CompartmentBase, double > y0( "y0",
 			"Y coordinate of start of compartment",
 			&CompartmentBase::setY0,
 			&CompartmentBase::getY0
 		);
-		static ValueFinfo< CompartmentBase, double > z0( "z0", 
+		static ValueFinfo< CompartmentBase, double > z0( "z0",
 			"Z coordinate of start of compartment",
 			&CompartmentBase::setZ0,
 			&CompartmentBase::getZ0
@@ -260,16 +263,16 @@ const Cinfo* CompartmentBase::initCinfo()
 			&CompartmentBase::setY,
 			&CompartmentBase::getY
 		);
-		static ValueFinfo< CompartmentBase, double > z( "z", 
+		static ValueFinfo< CompartmentBase, double > z( "z",
 			"z coordinate of end of compartment",
 			&CompartmentBase::setZ,
 			&CompartmentBase::getZ
 		);
-	
+
 	//////////////////////////////////////////////////////////////////
 	// DestFinfo definitions
 	//////////////////////////////////////////////////////////////////
-		static DestFinfo injectMsg( "injectMsg", 
+		static DestFinfo injectMsg( "injectMsg",
 			"The injectMsg corresponds to the INJECT message in the "
 			"GENESIS compartment. Unlike the 'inject' field, any value "
 			"assigned by handleInject applies only for a single timestep."
@@ -277,7 +280,7 @@ const Cinfo* CompartmentBase::initCinfo()
 			"injection current",
 			new EpFunc1< CompartmentBase,  double >( &CompartmentBase::injectMsg )
 		);
-		
+
 		static DestFinfo randInject( "randInject",
 			"Sends a random injection current to the compartment. Must be"
 			"updated each timestep."
@@ -285,24 +288,24 @@ const Cinfo* CompartmentBase::initCinfo()
 			new EpFunc2< CompartmentBase, double, double > (
 				&CompartmentBase::randInject ) );
 
-		static DestFinfo cable( "cable", 
+		static DestFinfo cable( "cable",
 			"Message for organizing compartments into groups, called"
 			"cables. Doesn't do anything.",
 			new OpFunc0< CompartmentBase >( &CompartmentBase::cable )
 		);
-		static DestFinfo displace( "displace", 
+		static DestFinfo displace( "displace",
 			"Displaces compartment by specified vector",
 			new OpFunc3< CompartmentBase, double, double, double>(
 				   	&CompartmentBase::displace )
 		);
-		static DestFinfo setGeomAndElec( "setGeomAndElec", 
+		static DestFinfo setGeomAndElec( "setGeomAndElec",
 			"Assigns length and dia and accounts for any electrical "
 			"scaling needed as a result.",
 			new EpFunc2< CompartmentBase, double, double>(
 				   	&CompartmentBase::setGeomAndElec )
 		);
 	///////////////////////////////////////////////////////////////////
-	static Finfo* compartmentFinfos[] = 
+	static Finfo* compartmentFinfos[] =
 	{
 		&Vm,				// Value
 		&Cm,				// Value
@@ -381,7 +384,7 @@ bool CompartmentBase::rangeWarning( const string& field, double value )
 	if ( value < RANGE ) {
 		cout << "Warning: Ignored attempt to set " << field <<
 				" of compartment " <<
-				// c->target().e->name() << 
+				// c->target().e->name() <<
 				" to " << value << " as it is less than " << RANGE << endl;
 		return 1;
 	}
@@ -480,8 +483,8 @@ double CompartmentBase::getDiameter() const
 void CompartmentBase::setLength( double value )
 {
 	// If length is assigned correctly, also redo the end coords to match.
-	if ( value > 0 && length_ > 0 && 
-			doubleEq( length_ * length_, 
+	if ( value > 0 && length_ > 0 &&
+			doubleEq( length_ * length_,
 			(x_-x0_)*(x_-x0_) + (y_-y0_)*(y_-y0_) + (z_-z0_)*(z_-z0_) ) ) {
 		double ratio = value / length_;
 		x_ = x0_ + ratio * ( x_ - x0_ );
@@ -499,7 +502,7 @@ double CompartmentBase::getLength() const
 
 void CompartmentBase::updateLength()
 {
-	length_ = sqrt( (x_-x0_)*(x_-x0_) + 
+	length_ = sqrt( (x_-x0_)*(x_-x0_) +
 					(y_-y0_)*(y_-y0_) + (z_-z0_)*(z_-z0_) );
 }
 
@@ -585,7 +588,7 @@ void CompartmentBase::reinit(  const Eref& e, ProcPtr p )
 
 void CompartmentBase::initProc( const Eref& e, ProcPtr p )
 {
-	vInitProc( e, p ); 
+	vInitProc( e, p );
 }
 
 void CompartmentBase::initReinit( const Eref& e, ProcPtr p )
@@ -637,11 +640,11 @@ void CompartmentBase::setGeomAndElec( const Eref& e,
 				double len, double dia )
 {
 	if ( length_ > 0 && diameter_ > 0 && len > 0 && dia > 0 &&
-			doubleEq( length_ * length_, 
+			doubleEq( length_ * length_,
 			(x_-x0_)*(x_-x0_) + (y_-y0_)*(y_-y0_) + (z_-z0_)*(z_-z0_) ) ) {
 		vSetRm( e, vGetRm( e ) * diameter_ * length_ / ( dia * len ) );
 		vSetCm( e, vGetCm( e ) * dia * len / ( diameter_ * length_ ) );
-		vSetRa( e, vGetRa( e ) * len * (diameter_ * diameter_) / 
+		vSetRa( e, vGetRa( e ) * len * (diameter_ * diameter_) /
 				( length_ * dia * dia ) );
 		// Rescale channel Gbars here
 		vector< ObjId > chans;
@@ -658,7 +661,7 @@ void CompartmentBase::setGeomAndElec( const Eref& e,
 			Field< double >::set( concs[i], "length", len );
 			Field< double >::set( concs[i], "diameter", dia );
 		}
-		
+
 		setLength( len );
 		setDiameter( dia );
 	}
@@ -673,7 +676,7 @@ void CompartmentBase::vSetSolver( const Eref& e, Id hsolve )
 {;}
 
 // static func
-void CompartmentBase::zombify( Element* orig, const Cinfo* zClass, 
+void CompartmentBase::zombify( Element* orig, const Cinfo* zClass,
 				Id hsolve )
 {
 	if ( orig->cinfo() == zClass )
@@ -686,7 +689,7 @@ void CompartmentBase::zombify( Element* orig, const Cinfo* zClass,
 
 	for ( unsigned int i = 0; i < num; ++i ) {
 		Eref er( orig, i + start );
-		const CompartmentBase* cb = 
+		const CompartmentBase* cb =
 			reinterpret_cast< const CompartmentBase* >( er.data() );
 		cdh[i].readData( cb, er );
 	}
diff --git a/moose-core/biophysics/DifBuffer.cpp b/moose-core/biophysics/DifBuffer.cpp
index 60763e82b86ce5794edf170948758d40d31f214c..cb77d41faeeb6907a35904a7ac1037813dca3e6b 100644
--- a/moose-core/biophysics/DifBuffer.cpp
+++ b/moose-core/biophysics/DifBuffer.cpp
@@ -1,47 +1,47 @@
 // DifBuffer.cpp --- 
-// 
+//
 // Filename: DifBuffer.cpp
-// Description: 
+// Description:
 // Author: Subhasis Ray
-// Maintainer: 
+// Maintainer:
 // Created: Mon Feb 16 12:02:11 2015 (-0500)
-// Version: 
+// Version:
 // Package-Requires: ()
 // Last-Updated: Mon Feb 23 13:07:56 2015 (-0500)
 //           By: Subhasis Ray
 //     Update #: 130
-// URL: 
-// Doc URL: 
-// Keywords: 
-// Compatibility: 
-// 
-// 
-
-// Commentary: 
-// 
-// 
-// 
-// 
+// URL:
+// Doc URL:
+// Keywords:
+// Compatibility:
+//
+//
+
+// Commentary:
+//
+//
+//
+//
 
 // Change Log:
 // 5/25/16 Completing DifBuffer -- Asia J-Szmek (GMU)
 // 9/21/16 rewrote DifBuffer to account for DifBufferBase (AJS)
-// 
-// 
+//
+//
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 // the Free Software Foundation, either version 3 of the License, or (at
 // your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful, but
 // WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU General Public License
 // along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-// 
-// 
+//
+//
 
 // Code:
 
@@ -141,7 +141,7 @@ void DifBuffer::vSetBFree(const Eref& e,double value)
   bBound_ = bTot_ - bFree_;
   prevFree_= bFree_;
   prevBound_ = bBound_;
-  
+
 }
 
 double DifBuffer::vGetBBound(const Eref& e) const
@@ -219,7 +219,7 @@ double DifBuffer::vGetD(const Eref& e) const
 
 void DifBuffer::vSetD(const Eref& e,double value)
 {
-  
+
   if ( value  < 0.0 ) {
     cerr << " Error: DifBuffer: Diffusion constant, D, cannot be negative!\n";
     return;
@@ -248,7 +248,7 @@ void DifBuffer::vSetLength(const Eref& e, double length )
     cerr << "Error: DifBuffer: length cannot be negative!\n";
     return;
   }
-	
+
   length_ = length;
 }
 
@@ -263,7 +263,7 @@ void DifBuffer::vSetDiameter(const Eref& e, double diameter )
     cerr << "Error: DifBuffer: diameter cannot be negative!\n";
     return;
   }
-	
+
   diameter_ = diameter;
 }
 
@@ -278,7 +278,7 @@ void DifBuffer::vSetThickness( const Eref& e, double thickness )
     cerr << "Error: DifBuffer: thickness cannot be negative!\n";
     return;
   }
-	
+
   thickness_ = thickness;
 }
 
@@ -291,12 +291,12 @@ void DifBuffer::vSetVolume(const Eref& e, double volume )
 {
   if ( shapeMode_ != 3 )
     cerr << "Warning: DifBuffer: Trying to set volume, when shapeMode is not USER-DEFINED\n";
-	
+
   if ( volume < 0.0 ) {
     cerr << "Error: DifBuffer: volume cannot be negative!\n";
     return;
   }
-	
+
   volume_ = volume;
 }
 
@@ -309,12 +309,12 @@ void DifBuffer::vSetOuterArea(const Eref& e, double outerArea )
 {
   if (shapeMode_ != 3 )
     cerr << "Warning: DifBuffer: Trying to set outerArea, when shapeMode is not USER-DEFINED\n";
-	
+
   if ( outerArea < 0.0 ) {
     cerr << "Error: DifBuffer: outerArea cannot be negative!\n";
     return;
   }
-	
+
   outerArea_ = outerArea;
 }
 
@@ -327,12 +327,12 @@ void DifBuffer::vSetInnerArea(const Eref& e, double innerArea )
 {
   if ( shapeMode_ != 3 )
     cerr << "Warning: DifBuffer: Trying to set innerArea, when shapeMode is not USER-DEFINED\n";
-    
+
   if ( innerArea < 0.0 ) {
     cerr << "Error: DifBuffer: innerArea cannot be negative!\n";
     return;
   }
-    
+
   innerArea_ = innerArea;
 }
 
@@ -369,16 +369,16 @@ void DifBuffer::vProcess( const Eref & e, ProcPtr p )
    * then compute their incoming fluxes.
    */
 
-  
-  
+
+
   Af_ += kb_ * bBound_;
   Bf_ += kf_ * activation_;
-  
+
   bFree_ = integrate(bFree_,p->dt,Af_,Bf_);
   bBound_ = bTot_ - bFree_;
   prevFree_ = bFree_;
   prevBound_ = bBound_;
- 
+
   /**
    * Send ion concentration to ion buffers. They will send back information on
    * the reaction (forward / backward rates ; free / bound buffer concentration)
@@ -395,11 +395,11 @@ void DifBuffer::vProcess( const Eref & e, ProcPtr p )
 
 void DifBuffer::vReinit( const Eref& e, ProcPtr p )
 {
-	
+
   Af_ = 0;
   Bf_= 0;
   double rOut = diameter_/2.;
-  
+
   double rIn = rOut - thickness_;
 
   if (rIn<0)
@@ -419,9 +419,9 @@ void DifBuffer::vReinit( const Eref& e, ProcPtr p )
 	outerArea_ = 2*M_PI * rOut * length_;
 	innerArea_ = 2*M_PI * rIn * length_;
       }
-		
+
       break;
-	
+
       /*
        * Cylindrical Slice
        */
@@ -430,7 +430,7 @@ void DifBuffer::vReinit( const Eref& e, ProcPtr p )
       outerArea_ = M_PI * diameter_ * diameter_ / 4.0;
       innerArea_ = outerArea_;
       break;
-	
+
       /*
        * User defined
        */
@@ -438,18 +438,18 @@ void DifBuffer::vReinit( const Eref& e, ProcPtr p )
       // Nothing to be done here. Volume and inner-, outer areas specified by
       // user.
       break;
-	
+
     default:
       assert( 0 );
     }
-  
+
   bFree_ = bTot_/(1+activation_*kf_/kb_);
   prevFree_ = bFree_;
   bBound_ = bTot_ - bFree_;
   prevBound_ = bBound_;
   innerDifSourceOut()->send( e, prevFree_, thickness_ );
   outerDifSourceOut()->send( e, prevFree_, thickness_ );
-  
+
 }
 
 void DifBuffer::vFluxFromIn(const Eref& e,double innerC, double innerThickness)
diff --git a/moose-core/biophysics/DifBufferBase.cpp b/moose-core/biophysics/DifBufferBase.cpp
index 40628a21e44d95612293230d45824ccb52c1b638..5c6c43a20dd7034673fa8b0e10fe31fde7a5a839 100644
--- a/moose-core/biophysics/DifBufferBase.cpp
+++ b/moose-core/biophysics/DifBufferBase.cpp
@@ -12,7 +12,7 @@ SrcFinfo4< double, double, double, double >* DifBufferBase::reactionOut()
 								 " (free-buffer and bound-buffer molecules).");
   return &reactionOut;
 }
-                                                                 
+
 
 SrcFinfo2< double, double >* DifBufferBase::innerDifSourceOut(){
   static SrcFinfo2< double, double > sourceOut("innerDifSourceOut",
@@ -34,20 +34,20 @@ const Cinfo * DifBufferBase::initCinfo()
   static DestFinfo reinit( "reinit",
                            "Reinit happens only in stage 0",
                            new ProcOpFunc< DifBufferBase >( &DifBufferBase::reinit));
-    
+
   static Finfo* processShared[] = {
     &process,
     &reinit
   };
 
   static SharedFinfo proc(
-			  "proc", 
+			  "proc",
 			  "Here we create 2 shared finfos to attach with the Ticks. This is because we want to perform DifBufferBase "
 			  "computations in 2 stages, much as in the Compartment object. "
 			  "In the first stage we send out the concentration value to other DifBufferBases and Buffer elements. We also",
 			  processShared,
 			  sizeof( processShared ) / sizeof( Finfo* ));
-  
+
   static DestFinfo concentration("concentration",
                                  "Receives concentration (from DifShell).",
                                  new EpFunc1<DifBufferBase, double>(&DifBufferBase::buffer));
@@ -72,13 +72,13 @@ const Cinfo * DifBufferBase::initCinfo()
   static DestFinfo fluxFromOut( "fluxFromOut",
                                 "Destination message",
                                 new EpFunc2< DifBufferBase, double, double > ( &DifBufferBase::fluxFromOut ));
-    
+
   static Finfo* innerDifShared[] = {
     &fluxFromOut,
     DifBufferBase::innerDifSourceOut()
-    
+
   };
-    
+
   static SharedFinfo innerDif( "innerDif",
                                "This shared message (and the next) is between DifBufferBases: adjoining shells exchange information to "
                                "find out the flux between them. "
@@ -88,9 +88,9 @@ const Cinfo * DifBufferBase::initCinfo()
 
   static DestFinfo fluxFromIn( "fluxFromIn", "",
                                new EpFunc2< DifBufferBase, double, double> ( &DifBufferBase::fluxFromIn) );
-  
+
   static Finfo* outerDifShared[] = {
-    &fluxFromIn,  
+    &fluxFromIn,
     DifBufferBase::outerDifSourceOut(),
 
   };
@@ -99,7 +99,7 @@ const Cinfo * DifBufferBase::initCinfo()
                                 "Using this message, an outer shell sends to, and receives from its inner shell." ,
                                 outerDifShared,
                                 sizeof( outerDifShared ) / sizeof( Finfo* ));
-  
+
   ////////////////////////////
   // Field defs
   ////////////////////////////
@@ -130,7 +130,7 @@ const Cinfo * DifBufferBase::initCinfo()
   static ElementValueFinfo<DifBufferBase, double> bTot("bTot",
 						       "Total buffer concentration.",
 						       &DifBufferBase::setBTot,
-						       &DifBufferBase::getBTot);  
+						       &DifBufferBase::getBTot);
   static ElementValueFinfo<DifBufferBase, double> length("length",
 							 "Length of shell",
 							 &DifBufferBase::setLength,
@@ -143,12 +143,12 @@ const Cinfo * DifBufferBase::initCinfo()
 								  "shape of the shell: SHELL=0, SLICE=SLAB=1, USERDEF=3",
 								  &DifBufferBase::setShapeMode,
 								  &DifBufferBase::getShapeMode);
-  
+
   static ElementValueFinfo<DifBufferBase, double> thickness("thickness",
 							    "Thickness of shell",
 							    &DifBufferBase::setThickness,
 							    &DifBufferBase::getThickness);
- 
+
   static ElementValueFinfo<DifBufferBase, double> innerArea("innerArea",
 							    "Inner area of shell",
 							    &DifBufferBase::setInnerArea,
@@ -160,7 +160,7 @@ const Cinfo * DifBufferBase::initCinfo()
   static ElementValueFinfo< DifBufferBase, double> volume( "volume", "",
 							   &DifBufferBase::setVolume,
 							   &DifBufferBase::getVolume );
-  
+
   ////
   // DestFinfo
   ////
@@ -168,7 +168,7 @@ const Cinfo * DifBufferBase::initCinfo()
     //////////////////////////////////////////////////////////////////
     // Field definitions
     //////////////////////////////////////////////////////////////////
-    
+
     &activation,
     &D,
     &bFree,
@@ -199,7 +199,7 @@ const Cinfo * DifBufferBase::initCinfo()
     //////////////////////////////////////////////////////////////////
     // DestFinfo definitions
     //////////////////////////////////////////////////////////////////
-    &concentration,    
+    &concentration,
   };
 
   static string doc[] = {
@@ -379,7 +379,7 @@ void DifBufferBase::buffer(const Eref& e,double C)
 {
   vBuffer(e,C);
 }
-  
+
 void DifBufferBase::reinit( const Eref& e, ProcPtr p )
 {
   vReinit( e, p );
@@ -400,7 +400,7 @@ void DifBufferBase:: fluxFromIn(const Eref& e,double innerC, double innerThickne
 void DifBufferBase::vSetSolver( const Eref& e, Id hsolve )
 {;}
 
-void DifBufferBase::zombify( Element* orig, const Cinfo* zClass, 
+void DifBufferBase::zombify( Element* orig, const Cinfo* zClass,
 			     Id hsolve )
 {
   if ( orig->cinfo() == zClass )
@@ -413,10 +413,10 @@ void DifBufferBase::zombify( Element* orig, const Cinfo* zClass,
   vector< double > data( num * len );
 
   unsigned int j = 0;
-	
+
   for ( unsigned int i = 0; i < num; ++i ) {
     Eref er( orig, i + start );
-    const DifBufferBase* ds = 
+    const DifBufferBase* ds =
       reinterpret_cast< const DifBufferBase* >( er.data() );
     data[j + 0] = ds->getActivation( er );
     data[j + 1] = ds->getBFree( er );
@@ -438,7 +438,7 @@ void DifBufferBase::zombify( Element* orig, const Cinfo* zClass,
   j = 0;
   for ( unsigned int i = 0; i < num; ++i ) {
     Eref er( orig, i + start );
-    DifBufferBase* ds = 
+    DifBufferBase* ds =
       reinterpret_cast< DifBufferBase* >( er.data() );
     ds->vSetSolver(er,hsolve);
     ds->setActivation(er, data[j+0]);
@@ -457,5 +457,5 @@ void DifBufferBase::zombify( Element* orig, const Cinfo* zClass,
     ds->setInnerArea(er, data[j + 13]);
     j += len; //??
   }
-	
+
 }
diff --git a/moose-core/biophysics/HHChannelBase.cpp b/moose-core/biophysics/HHChannelBase.cpp
index 677d9554282e7fcbdd210227d0c9eb02c4bdefe1..147bb6e89bf092be1599226fc6da449ea823335b 100644
--- a/moose-core/biophysics/HHChannelBase.cpp
+++ b/moose-core/biophysics/HHChannelBase.cpp
@@ -45,7 +45,7 @@ const Cinfo* HHChannelBase::initCinfo()
 			&HHChannelBase::setInstant,
 			&HHChannelBase::getInstant
 		);
-		static ElementValueFinfo< HHChannelBase, double > X( "X", 
+		static ElementValueFinfo< HHChannelBase, double > X( "X",
 			"State variable for X gate",
 			&HHChannelBase::setX,
 			&HHChannelBase::getX
@@ -60,7 +60,7 @@ const Cinfo* HHChannelBase::initCinfo()
 			&HHChannelBase::setZ,
 			&HHChannelBase::getZ
 		);
-		static ElementValueFinfo< HHChannelBase, int > useConcentration( 
+		static ElementValueFinfo< HHChannelBase, int > useConcentration(
 			"useConcentration",
 			"Flag: when true, use concentration message rather than Vm to"
 			"control Z gate",
@@ -76,7 +76,7 @@ const Cinfo* HHChannelBase::initCinfo()
 ///////////////////////////////////////////////////////
 // MsgDest definitions
 ///////////////////////////////////////////////////////
-		static DestFinfo concen( "concen", 
+		static DestFinfo concen( "concen",
 			"Incoming message from Concen object to specific conc to use"
 			"in the Z gate calculations",
 			new EpFunc1< HHChannelBase, double >( &HHChannelBase::handleConc )
@@ -88,7 +88,7 @@ const Cinfo* HHChannelBase::initCinfo()
 		);
 ///////////////////////////////////////////////////////
 // FieldElementFinfo definition for HHGates. Note that these are made
-// with the deferCreate flag off, so that the HHGates are created 
+// with the deferCreate flag off, so that the HHGates are created
 // right away even if they are empty.
 // Assume only a single entry allocated in each gate.
 ///////////////////////////////////////////////////////
@@ -116,7 +116,7 @@ const Cinfo* HHChannelBase::initCinfo()
 			&HHChannelBase::getNumZgates
 			// 1
 		);
-	
+
 ///////////////////////////////////////////////////////
 	static Finfo* HHChannelBaseFinfos[] =
 	{
@@ -134,7 +134,7 @@ const Cinfo* HHChannelBase::initCinfo()
 		&gateY,				// FieldElement
 		&gateZ				// FieldElement
 	};
-	
+
 	static string doc[] =
 	{
 		"Name", "HHChannelBase",
@@ -144,9 +144,9 @@ const Cinfo* HHChannelBase::initCinfo()
 		"like the old tabchannel from GENESIS, but also presents "
 		"a similar interface as hhchan from GENESIS. ",
 	};
-        
+
     static  ZeroSizeDinfo< int > dinfo;
-        
+
 	static Cinfo HHChannelBaseCinfo(
 		"HHChannelBase",
 		ChanBase::initCinfo(),
@@ -168,9 +168,9 @@ static const Cinfo* hhChannelCinfo = HHChannelBase::initCinfo();
 // Constructor
 ///////////////////////////////////////////////////
 HHChannelBase::HHChannelBase()
-	: 
-			Xpower_( 0.0 ), 
-			Ypower_( 0.0 ), 
+	:
+			Xpower_( 0.0 ),
+			Ypower_( 0.0 ),
 			Zpower_( 0.0 ),
 			useConcentration_( 0 ),
 			modulation_( 1.0 )
@@ -321,7 +321,7 @@ HHGate* HHChannelBase::getZgate( unsigned int i )
 	return vGetZgate( i );
 }
 
-void HHChannelBase::setNumGates( unsigned int num ) 
+void HHChannelBase::setNumGates( unsigned int num )
 { ; }
 
 unsigned int  HHChannelBase::getNumXgates() const
@@ -384,7 +384,7 @@ void HHChannelBase::zombify( Element* orig, const Cinfo* zClass, Id hsolve )
 
 	for ( unsigned int i = 0; i < num; ++i ) {
 		Eref er( orig, i + start );
-		const HHChannelBase* hb = 
+		const HHChannelBase* hb =
 			reinterpret_cast< const HHChannelBase* >( er.data() );
 		*j = hb->vGetGbar( er );
 		*(j+1) = hb->vGetEk( er);
@@ -406,9 +406,8 @@ void HHChannelBase::zombify( Element* orig, const Cinfo* zClass, Id hsolve )
 		hb->vSetYpower( er, *(j+3) );
 		hb->vSetZpower( er, *(j+4) );
 		// hb->vSetUseConcentration( er, *(j+5) > 0.5 );
-		// Disable this assignment because the Solver already reads the 
+		// Disable this assignment because the Solver already reads the
 		// value, and it triggers an error msg.
 		j+= 6;
 	}
 }
-
diff --git a/moose-core/biophysics/IntFire.cpp b/moose-core/biophysics/IntFire.cpp
index b4478a11d745da1d95492678f4bc631f968639a8..990e62d751abdec03d780e19795dc9929d6ef5ae 100644
--- a/moose-core/biophysics/IntFire.cpp
+++ b/moose-core/biophysics/IntFire.cpp
@@ -12,8 +12,8 @@
 #include "IntFire.h"
 
 static SrcFinfo1< double > *spikeOut() {
-	static SrcFinfo1< double > spikeOut( 
-			"spikeOut", 
+	static SrcFinfo1< double > spikeOut(
+			"spikeOut",
 			"Sends out spike events. The argument is the timestamp of "
 			"the spike. "
 			);
@@ -101,7 +101,7 @@ const Cinfo* IntFire::initCinfo()
 static const Cinfo* intFireCinfo = IntFire::initCinfo();
 
 IntFire::IntFire()
-	: Vm_( 0.0 ), thresh_( 0.0 ), tau_( 1.0 ), 
+	: Vm_( 0.0 ), thresh_( 0.0 ), tau_( 1.0 ),
 		refractoryPeriod_( 0.1 ), lastSpike_( -0.1 ),
 		activation_( 0.0 )
 {
diff --git a/moose-core/biophysics/MgBlock.cpp b/moose-core/biophysics/MgBlock.cpp
index 2c946a51f6152d1e3e689208ff6e01d50910c11b..a070e7aa837780f3b72b5997bbd66c3a4787793c 100644
--- a/moose-core/biophysics/MgBlock.cpp
+++ b/moose-core/biophysics/MgBlock.cpp
@@ -22,19 +22,19 @@ const Cinfo* MgBlock::initCinfo()
 	///////////////////////////////////////////////////////
 	// Dest definitions
 	///////////////////////////////////////////////////////
-	static DestFinfo origChannel( "origChannel", 
+	static DestFinfo origChannel( "origChannel",
 		"",
 		new EpFunc2< MgBlock, double, double > (&MgBlock::origChannel )
 	);
 	///////////////////////////////////////////////////////
 	// Field definitions
 	///////////////////////////////////////////////////////
-	static ValueFinfo< MgBlock, double > KMg_A( "KMg_A", 
+	static ValueFinfo< MgBlock, double > KMg_A( "KMg_A",
 			"1/eta",
 			&MgBlock::setKMg_A,
 			&MgBlock::getKMg_A
 		);
-	static ValueFinfo< MgBlock, double > KMg_B( "KMg_B", 
+	static ValueFinfo< MgBlock, double > KMg_B( "KMg_B",
 			"1/gamma",
 			&MgBlock::setKMg_B,
 			&MgBlock::getKMg_B
@@ -66,7 +66,7 @@ const Cinfo* MgBlock::initCinfo()
 		"Description", "MgBlock: Hodgkin-Huxley type voltage-gated Ion channel. Something "
 				"like the old tabchannel from GENESIS, but also presents "
 				"a similar interface as hhchan from GENESIS. ",
-	};	
+	};
 	static Dinfo< MgBlock > dinfo;
 	static Cinfo MgBlockCinfo(
 		"MgBlock",
@@ -87,7 +87,7 @@ static const Cinfo* MgBlockCinfo = MgBlock::initCinfo();
 // Constructor
 ///////////////////////////////////////////////////
 MgBlock::MgBlock()
-	:	Zk_( 0.0 ), 
+	:	Zk_( 0.0 ),
 		KMg_A_( 1.0 ), // These are NOT the same as the A, B state
 		KMg_B_( 1.0 ), // variables used for Exp Euler integration.
 		CMg_( 1.0 ), 	// Conc of Mg in mM
@@ -185,4 +185,3 @@ void MgBlock::origChannel( const Eref& e, double Gk, double Ek )
 ///////////////////////////////////////////////////
 // Unit tests
 ///////////////////////////////////////////////////
-
diff --git a/moose-core/biophysics/RandSpike.cpp b/moose-core/biophysics/RandSpike.cpp
index ac5257d2a9699c85a60ca80f3dc4f6e50fd2ac00..0c2e09ffff1825cd06407a8931fd79dd41db58d7 100644
--- a/moose-core/biophysics/RandSpike.cpp
+++ b/moose-core/biophysics/RandSpike.cpp
@@ -15,7 +15,7 @@
 	// MsgSrc definitions
 	///////////////////////////////////////////////////////
 static SrcFinfo1< double > *spikeOut() {
-	static SrcFinfo1< double > spikeOut( "spikeOut", 
+	static SrcFinfo1< double > spikeOut( "spikeOut",
 			"Sends out a trigger for an event.");
 	return &spikeOut;
 }
@@ -25,10 +25,10 @@ const Cinfo* RandSpike::initCinfo()
 	///////////////////////////////////////////////////////
 	// Shared message definitions
 	///////////////////////////////////////////////////////
-	static DestFinfo process( "process", 
+	static DestFinfo process( "process",
 		"Handles process call",
 		new ProcOpFunc< RandSpike >( &RandSpike::process ) );
-	static DestFinfo reinit( "reinit", 
+	static DestFinfo reinit( "reinit",
 		"Handles reinit call",
 		new ProcOpFunc< RandSpike >( &RandSpike::reinit ) );
 
@@ -37,10 +37,10 @@ const Cinfo* RandSpike::initCinfo()
 		&process, &reinit
 	};
 
-	static SharedFinfo proc( "proc", 
+	static SharedFinfo proc( "proc",
 		"Shared message to receive Process message from scheduler",
 		processShared, sizeof( processShared ) / sizeof( Finfo* ) );
-		
+
 	//////////////////////////////////////////////////////////////////
 	// Dest Finfos.
 	//////////////////////////////////////////////////////////////////
@@ -48,7 +48,7 @@ const Cinfo* RandSpike::initCinfo()
 	//////////////////////////////////////////////////////////////////
 	// Value Finfos.
 	//////////////////////////////////////////////////////////////////
-	
+
 	static ValueFinfo< RandSpike, double > rate( "rate",
 		"Specifies rate for random spike train. Note that this is"
 		"probabilistic, so the instantaneous rate may differ. "
@@ -72,7 +72,7 @@ const Cinfo* RandSpike::initCinfo()
 		&RandSpike::getFired
 	);
 
-	static Finfo* spikeGenFinfos[] = 
+	static Finfo* spikeGenFinfos[] =
 	{
 		spikeOut(),	// SrcFinfo
 		&proc,		// Shared
@@ -96,7 +96,7 @@ const Cinfo* RandSpike::initCinfo()
 		spikeGenFinfos, sizeof( spikeGenFinfos ) / sizeof( Finfo* ),
 		&dinfo,
                 doc,
-                sizeof(doc)/sizeof(string)                
+                sizeof(doc)/sizeof(string)
 	);
 
 	return &spikeGenCinfo;
@@ -105,7 +105,7 @@ const Cinfo* RandSpike::initCinfo()
 static const Cinfo* spikeGenCinfo = RandSpike::initCinfo();
 
 RandSpike::RandSpike()
-	: 
+	:
 	  rate_( 0.0 ),
 	  realRate_( 0.0 ),
       refractT_(0.0),
@@ -159,11 +159,11 @@ void RandSpike::process( const Eref& e, ProcPtr p )
 	if ( refractT_ > p->currTime - lastEvent_ )
 		return;
 	double prob = realRate_ * p->dt;
-	if ( prob >= 1.0 || prob >= mtrand() ) 
+	if ( prob >= 1.0 || prob >= mtrand() )
 	{
 		lastEvent_ = p->currTime;
 		spikeOut()->send( e, p->currTime );
-		fired_ = true;                    
+		fired_ = true;
 	} else {
         fired_ = false;
 	}
diff --git a/moose-core/biophysics/ReadSwc.cpp b/moose-core/biophysics/ReadSwc.cpp
index 3fde18ec6c22e432c8d6d7fb405d57aab376b4c1..9894e0472bf64628f75971fc76ae95f6d2c3ddf6 100644
--- a/moose-core/biophysics/ReadSwc.cpp
+++ b/moose-core/biophysics/ReadSwc.cpp
@@ -23,7 +23,6 @@ static const double MinRadius = 0.04;
 
 ReadSwc::ReadSwc( const string& fname )
 {
-	bool verbose = false;
 	ifstream fin( fname.c_str() );
 	if ( !fin ) {
 		cerr << "ReadSwc:: could not open file " << fname << endl;
@@ -53,13 +52,12 @@ ReadSwc::ReadSwc( const string& fname )
 		cleanZeroLength();
 		parseBranches();
 	}
-	cout << "ReadSwc: " << fname << "	: " << (valid ? "OK" : "FAILED" )<<
-			", # Branches = " << branches_.size() << 
-			". # Segs = " << segs_.size() << 
+	cout << "ReadSwc: " << fname << "	: NumSegs = " << segs_.size() << 
 			", bad = " << badSegs <<
+			", Validated = " << valid << 
+			", numBranches = " << branches_.size() << 
 			endl;
-	if ( verbose )
-		diagnostics();
+	diagnostics();
 }
 
 bool ReadSwc::validate() const
diff --git a/moose-core/builtins/Streamer.cpp b/moose-core/builtins/Streamer.cpp
index fc21fc05612830c7bea3d8af0fa361fa39dc9b53..dd9c0bf2f1ab213981d4f64b737d047bfee96275 100644
--- a/moose-core/builtins/Streamer.cpp
+++ b/moose-core/builtins/Streamer.cpp
@@ -136,7 +136,7 @@ static const Cinfo* tableStreamCinfo = Streamer::initCinfo();
 
 // Class function definitions
 
-Streamer::Streamer() 
+Streamer::Streamer()
 {
     // Not all compilers allow initialization during the declaration of class
     // methods.
@@ -176,7 +176,7 @@ void Streamer::reinit(const Eref& e, ProcPtr p)
     }
 
     Clock* clk = reinterpret_cast<Clock*>( Id(1).eref().data() );
-    for (size_t i = 0; i < tableIds_.size(); i++) 
+    for (size_t i = 0; i < tableIds_.size(); i++)
     {
         int tickNum = tableIds_[i].element()->getTick();
         double tick = clk->getTickDt( tickNum );
@@ -206,14 +206,14 @@ void Streamer::reinit(const Eref& e, ProcPtr p)
 
     // Make sure all tables have same dt_ else disable the streamer.
     vector<unsigned int> invalidTables;
-    for (size_t i = 1; i < tableTick_.size(); i++) 
+    for (size_t i = 1; i < tableTick_.size(); i++)
     {
         if( tableTick_[i] != tableTick_[0] )
         {
             LOG( moose::warning
                     , "Table " << tableIds_[i].path()
                     << " has tick (dt) which is different than the first table."
-                    << endl 
+                    << endl
                     << " Got " << tableTick_[i] << " expected " << tableTick_[0]
                     << endl << " Disabling this table."
                     );
@@ -221,7 +221,7 @@ void Streamer::reinit(const Eref& e, ProcPtr p)
         }
     }
 
-    for (size_t i = 0; i < invalidTables.size(); i++) 
+    for (size_t i = 0; i < invalidTables.size(); i++)
     {
         tables_.erase( tables_.begin() + i );
         tableDt_.erase( tableDt_.begin() + i );
@@ -320,7 +320,7 @@ void Streamer::addTables( vector<Id> tables )
 void Streamer::removeTable( Id table )
 {
     int matchIndex = -1;
-    for (size_t i = 0; i < tableIds_.size(); i++) 
+    for (size_t i = 0; i < tableIds_.size(); i++)
         if( table.path() == tableIds_[i].path() )
         {
             matchIndex = i;
@@ -383,7 +383,7 @@ void Streamer::setFormat( string fmt )
 }
 
 /*  Get the format of all tables. */
-string Streamer::getFormat( void ) const 
+string Streamer::getFormat( void ) const
 {
     return format_;
 }
@@ -407,7 +407,7 @@ void Streamer::zipWithTime( )
         {
 #if 0
             LOG( moose::debug
-                    , "Table " << tables_[i]->getName( ) << " is not functional. Filling with zero " 
+                    , "Table " << tables_[i]->getName( ) << " is not functional. Filling with zero "
                     );
 #endif
             tVec.resize( numEntriesInEachTable, 0 );
diff --git a/moose-core/cmake_modules/FindGSL.cmake b/moose-core/cmake_modules/FindGSL.cmake
index 99ad9ea8effe8ff7bba87af49978bd14188f9d14..93c2686f78e6fbbdde540e86241d0995934c8813 100644
--- a/moose-core/cmake_modules/FindGSL.cmake
+++ b/moose-core/cmake_modules/FindGSL.cmake
@@ -63,34 +63,28 @@ ELSE(WIN32)
         SET(GSL_CBLAS_LIB_NAMES gslcblas)
     ENDIF( )
 
-    if(GSL_ROOT_DIR)
-        message("  Debug: Searching in user given path " )
-        FIND_LIBRARY(GSL_LIB 
-            NAMES ${GSL_LIB_NAMES} 
-            PATHS ${GSL_ROOT_DIR}/lib ${GSL_ROOT_DIR}/lib64
-            NO_DEFAULT_PATH
-            )
-
-        FIND_LIBRARY(GSLCBLAS_LIB 
-            NAMES ${GSL_CBLAS_LIB_NAMES}
-            PATHS ${GSL_ROOT_DIR}/lib ${GSL_ROOT_DIR}/lib64
-            NO_DEFAULT_PATH
-            )
-
-        FIND_PATH(GSL_INCLUDE_DIRS NAMES gsl/gsl_blas.h
-            PATHS ${GSL_ROOT_DIR}/include 
-            NO_DEFAULT_PATH
-            )
-    else( )
-        FIND_LIBRARY(GSL_LIB NAMES ${GSL_LIB_NAMES} )
-        FIND_LIBRARY(GSLCBLAS_LIB NAMES ${GSL_CBLAS_LIB_NAMES})
-        FIND_PATH(GSL_INCLUDE_DIRS NAMES gsl/gsl_blas.h )
-    endif()
+    FIND_LIBRARY(GSL_LIB 
+        NAMES ${GSL_LIB_NAMES} 
+        PATHS 
+            ${GSL_ROOT_DIR}/lib ${GSL_ROOT_DIR}/lib64
+            /opt/lib /opt/lib64
+        )
 
+    FIND_LIBRARY(GSLCBLAS_LIB 
+        NAMES ${GSL_CBLAS_LIB_NAMES}
+        PATHS 
+            ${GSL_ROOT_DIR}/lib ${GSL_ROOT_DIR}/lib64
+            /opt/lib /opt/lib64
+        )
     IF (GSL_LIB AND GSLCBLAS_LIB)
         SET (GSL_LIBRARIES ${GSL_LIB} ${GSLCBLAS_LIB})
     ENDIF (GSL_LIB AND GSLCBLAS_LIB)
 
+    FIND_PATH(GSL_INCLUDE_DIRS NAMES gsl/gsl_blas.h
+        PATHS ${GSL_ROOT_DIR}/include /opt/include 
+        )
+
+
 ENDIF(WIN32)
 
 # FIND version
@@ -106,7 +100,7 @@ endif(GSL_INCLUDE_DIRS)
 
 IF(GSL_LIBRARIES AND GSL_VERSION)
     IF(GSL_INCLUDE_DIRS)
-        MESSAGE(STATUS "Found GSL: ${GSL_INCLUDE_DIRS}, ${GSL_LIBRARIES}")
+        MESSAGE(STATUS "Found GSL ${GSL_LIBRARIES}")
         SET(GSL_FOUND 1)
     ENDIF(GSL_INCLUDE_DIRS)
 ENDIF()
diff --git a/moose-core/cmake_modules/FindNumPy.cmake b/moose-core/cmake_modules/FindNumPy.cmake
index 83c74d47b7592276d595d0e32be2a96577a9852a..b2813e9cd2c46a747b3ac31ee2c3459c32db59d0 100644
--- a/moose-core/cmake_modules/FindNumPy.cmake
+++ b/moose-core/cmake_modules/FindNumPy.cmake
@@ -52,7 +52,7 @@ if(NOT PYTHONINTERP_FOUND)
     return()
 endif()
 
-execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
+execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
     "import numpy as n; print(n.__version__); print(n.get_include());"
     RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS
     OUTPUT_VARIABLE _NUMPY_VALUES_OUTPUT
diff --git a/moose-core/device/PulseGen.cpp b/moose-core/device/PulseGen.cpp
index 2112191a47399821456e93a1dab3b66d9b523cb7..105aa8282b182ecc8255b352f25fea698065f34f 100644
--- a/moose-core/device/PulseGen.cpp
+++ b/moose-core/device/PulseGen.cpp
@@ -1,31 +1,31 @@
-// PulseGen.cpp --- 
-// 
+// PulseGen.cpp ---
+//
 // Filename: PulseGen.cpp
-// Description: 
+// Description:
 // Author: Subhasis Ray
-// Maintainer: 
+// Maintainer:
 // Created: Mon Feb 20 01:41:12 2012 (+0530)
-// Version: 
+// Version:
 // Last-Updated: Mon May 27 11:49:31 2013 (+0530)
 //           By: subha
 //     Update #: 170
-// URL: 
-// Keywords: 
-// Compatibility: 
-// 
-// 
-
-// Commentary: 
-// 
-// 
-// 
-// 
+// URL:
+// Keywords:
+// Compatibility:
+//
+//
+
+// Commentary:
+//
+//
+//
+//
 
 // Change log:
-// 
+//
 // 2012-02-20 01:41:16 (+0530) - Subha - started porting from old
 // moose.
-// 
+//
 
 // Code:
 
@@ -62,7 +62,7 @@ const Cinfo* PulseGen::initCinfo()
     static ValueFinfo< PulseGen, double > firstDelay("firstDelay",
                                                      "Delay to start of the first pulse in a sequence",
                                                      &PulseGen::setFirstDelay,
-                                                     &PulseGen::getFirstDelay); 
+                                                     &PulseGen::getFirstDelay);
     static ValueFinfo< PulseGen, double > secondLevel("secondLevel",
                                                      "Amplitude of the second pulse in a sequence",
                                                      &PulseGen::setSecondLevel,
@@ -112,7 +112,7 @@ const Cinfo* PulseGen::initCinfo()
     static DestFinfo delayIn("delayIn",
                              "Handle delay value coming from other objects",
                              new OpFunc2< PulseGen, unsigned int, double >(&PulseGen::setDelay));
-    
+
     static DestFinfo input("input",
                            "Handle incoming input that determines gating/triggering onset. "
                            "Note that although this is a double field, the underlying field is"
@@ -131,7 +131,7 @@ const Cinfo* PulseGen::initCinfo()
             {
 		&process, &reinit
             };
-    
+
     static SharedFinfo proc( "proc",
                              "This is a shared message to receive Process messages "
                              "from the scheduler objects."
@@ -169,7 +169,7 @@ const Cinfo* PulseGen::initCinfo()
         "Name", "PulseGen",
         "Author", "Subhasis Ray",
         "Description", "PulseGen: general purpose pulse generator. This can generate any "
-        "number of pulses with specified level and duration.",        
+        "number of pulses with specified level and duration.",
     };
     static Dinfo<PulseGen> dinfo;
     static Cinfo pulseGenCinfo("PulseGen",
@@ -179,8 +179,8 @@ const Cinfo* PulseGen::initCinfo()
                                &dinfo,
                                doc,
                                sizeof(doc)/sizeof(string));
-    return & pulseGenCinfo;    
-    
+    return & pulseGenCinfo;
+
 }
 
 static const Cinfo* pulseGenCinfo = PulseGen::initCinfo();
@@ -211,32 +211,32 @@ PulseGen::~PulseGen()
 
 void PulseGen::setFirstLevel( double level)
 {
-    level_[0] = level;    
+    level_[0] = level;
 }
 
 double PulseGen::getFirstLevel() const
 {
     return level_[0];
 }
-    
+
 void PulseGen::setFirstWidth(double width)
 {
-    width_[0] = width;    
+    width_[0] = width;
 }
 
 double PulseGen::getFirstWidth() const
 {
-    return width_[0];    
+    return width_[0];
 }
 void PulseGen::setFirstDelay( double delay)
 {
-    delay_[0] = delay;    
+    delay_[0] = delay;
 }
 double PulseGen::getFirstDelay() const
 {
     return delay_[0];
 }
-    
+
 void PulseGen::setSecondLevel( double level)
 {
     if (level_.size() >= 2){
@@ -284,15 +284,15 @@ double PulseGen::getSecondDelay() const
 
 void PulseGen::setBaseLevel( double level)
 {
-    baseLevel_ = level;    
+    baseLevel_ = level;
 }
 double PulseGen::getBaseLevel() const
 {
-    return baseLevel_;    
+    return baseLevel_;
 }
 void PulseGen::setTrigMode(unsigned int mode)
 {
-    trigMode_ = mode;    
+    trigMode_ = mode;
 }
 unsigned int PulseGen::getTrigMode() const
 {
@@ -326,7 +326,7 @@ void PulseGen::setCount(unsigned int count)
 
 unsigned int PulseGen::getCount() const
 {
-    return level_.size();        
+    return level_.size();
 }
 
 double PulseGen::getLevel(unsigned int index) const
@@ -338,7 +338,7 @@ double PulseGen::getLevel(unsigned int index) const
         return 0.0;
     }
 }
-    
+
 void PulseGen::setLevel( unsigned int index, double level)
 {
     if (index < level_.size()){
@@ -413,7 +413,7 @@ void PulseGen::process(const Eref& e, ProcPtr p )
         case PulseGen::EXT_TRIG:
             if (input_ == 0){
                 if (trigTime_ < 0){
-                    phase = period;                
+                    phase = period;
                 }else{
                     phase = currentTime - trigTime_;
                 }
@@ -423,7 +423,7 @@ void PulseGen::process(const Eref& e, ProcPtr p )
                 }
                 phase = currentTime - trigTime_;
             }
-            prevInput_ = input_;            
+            prevInput_ = input_;
             break;
         case PulseGen::EXT_GATE:
             if(input_ == 0)
@@ -431,7 +431,7 @@ void PulseGen::process(const Eref& e, ProcPtr p )
                 phase = period;		/* output = baselevel */
             }
             else
-            {				/* gate high */ 
+            {				/* gate high */
                 if(prevInput_ == 0)
                 {	/* low -> high */
                     trigTime_ = currentTime;
@@ -443,7 +443,7 @@ void PulseGen::process(const Eref& e, ProcPtr p )
         default:
             cerr << "ERROR: PulseGen::newProcessFunc( const Conn* , ProcInfo ) - invalid triggerMode - " << trigMode_ << endl;
     }
-    if (phase >= period){ // we have crossed all pulses 
+    if (phase >= period){ // we have crossed all pulses
         output_ = baseLevel_;
         return;
     }
@@ -468,9 +468,9 @@ void PulseGen::reinit(const Eref& e, ProcPtr p)
     trigTime_ = -1;
     prevInput_ = 0;
     output_ = baseLevel_;
-    input_ = 0;    
+    input_ = 0;
     outputOut()->send(e, output_);
 }
 
-// 
+//
 // PulseGen.cpp ends here
diff --git a/moose-core/examples/Ex.cpp b/moose-core/examples/Ex.cpp
index f10cdc49bb21a08936cf752c0c0d084181225e94..49fb32e2b0113e675f73ae3e53a23e07aa864931 100644
--- a/moose-core/examples/Ex.cpp
+++ b/moose-core/examples/Ex.cpp
@@ -84,7 +84,7 @@ const Cinfo* Ex::initCinfo()
 	
 	static SharedFinfo proc(
 		"proc",
-		"Shared message to receive Process messages",
+		"Handles 'reinit' and 'process' calls from a clock.",
 		processShared,
 		sizeof(processShared) / sizeof(Finfo*)
 	);
diff --git a/moose-core/examples/Example.cpp b/moose-core/examples/Example.cpp
index 83897eed33ac09b7c00043e777c56e07434701b4..de4a4d155f1ec9d65184c6e01b0656939d0ffec3 100644
--- a/moose-core/examples/Example.cpp
+++ b/moose-core/examples/Example.cpp
@@ -61,7 +61,7 @@ const Cinfo* Example::initCinfo(){
         &process, &reinit
     };
     static SharedFinfo proc( "proc",
-        "Shared message for process and reinit",
+        "Handles 'reinit' and 'process' calls from a clock.",
         procShared, sizeof( procShared ) / sizeof( const Finfo* )
     );
 
diff --git a/moose-core/hsolve/HSolve.cpp b/moose-core/hsolve/HSolve.cpp
index 2adad4f54ab7bb7668209728703343f904175531..05d5ff8ecbe3bb3e0b35d71f806faf49826e6922 100644
--- a/moose-core/hsolve/HSolve.cpp
+++ b/moose-core/hsolve/HSolve.cpp
@@ -533,4 +533,3 @@ void testHSolvePassiveSingleComp()
 
 
 #endif // if 0
-
diff --git a/moose-core/kinetics/BufPool.cpp b/moose-core/kinetics/BufPool.cpp
index 54e183780a6f76fcb1614878e70e02981b28ae25..230be5d6cebbb52abe1df35e25b93fcac4faee25 100644
--- a/moose-core/kinetics/BufPool.cpp
+++ b/moose-core/kinetics/BufPool.cpp
@@ -78,6 +78,7 @@ void BufPool::vSetConcInit( const Eref& e, double conc )
 	vSetConc( e, conc );
 }
 
+
 //////////////////////////////////////////////////////////////
 // MsgDest Definitions
 //////////////////////////////////////////////////////////////
@@ -96,4 +97,3 @@ void BufPool::vReinit( const Eref& e, ProcPtr p )
 //////////////////////////////////////////////////////////////
 // Field Definitions
 //////////////////////////////////////////////////////////////
-
diff --git a/moose-core/kinetics/CplxEnzBase.cpp b/moose-core/kinetics/CplxEnzBase.cpp
index 2b1498a901610f20ffbf2b0d01ebfec960a95a74..361f672fff1616d1c890107d59be25e59a5ba6ca 100644
--- a/moose-core/kinetics/CplxEnzBase.cpp
+++ b/moose-core/kinetics/CplxEnzBase.cpp
@@ -14,16 +14,16 @@
 #include "CplxEnzBase.h"
 
 static SrcFinfo2< double, double > *enzOut() {
-	static SrcFinfo2< double, double > enzOut( 
-			"enzOut", 
+	static SrcFinfo2< double, double > enzOut(
+			"enzOut",
 			"Sends out increment of molecules on product each timestep"
 			);
 	return &enzOut;
 }
 
 static SrcFinfo2< double, double > *cplxOut() {
-	static SrcFinfo2< double, double > cplxOut( 
-			"cplxOut", 
+	static SrcFinfo2< double, double > cplxOut(
+			"cplxOut",
 			"Sends out increment of molecules on product each timestep"
 			);
 	return &cplxOut;
@@ -40,8 +40,8 @@ DestFinfo* enzDest()
 }
 
 /*
-static DestFinfo* enzDest = 
-	dynamic_cast< DestFinfo* >( 
+static DestFinfo* enzDest =
+	dynamic_cast< DestFinfo* >(
 			const_cast< Finfo* >(
 			EnzBase::initCinfo()->findFinfo( "enzDest" ) ) );
 			*/
@@ -142,11 +142,11 @@ const Cinfo* CplxEnzBase::initCinfo()
 		&cplx,				// SharedFinfo
 	};
 
-	static string doc[] = 
+	static string doc[] =
 	{
 			"Name", "CplxEnzBase",
 			"Author", "Upi Bhalla",
-			"Description:", 
+			"Description:",
 			"Base class for mass-action enzymes in which there is an "
 			" explicit pool for the enzyme-substrate complex. "
  			"It models the reaction: "
@@ -264,7 +264,7 @@ void CplxEnzBase::zombify( Element* orig, const Cinfo* zClass, Id solver )
 	vector< double > kcat( num, 0.0 );
 	for ( unsigned int i = 0; i < num; ++i ) {
 		Eref er( orig, i + start );
-		const CplxEnzBase* ceb = 
+		const CplxEnzBase* ceb =
 			reinterpret_cast< const CplxEnzBase* >( er.data() );
 		concK1[ i ] = ceb->getConcK1( er );
 		k2[ i ] = ceb->getK2( er );
diff --git a/moose-core/kinetics/Enz.cpp b/moose-core/kinetics/Enz.cpp
index 785553943c7001a97b0479a00ebcc386b1f286db..2362c0b32eb83ce2247021aa762da822b0163776 100644
--- a/moose-core/kinetics/Enz.cpp
+++ b/moose-core/kinetics/Enz.cpp
@@ -115,7 +115,7 @@ void Enz::vProcess( const Eref& e, ProcPtr p )
 	cplxOut->send( e, r1_, r3_ + r2_ );
 
 	// cout << "	proc: " << r1_ << ", " << r2_ << ", " << r3_ << endl;
-	
+
 	r1_ = k1_;
 }
 
@@ -181,7 +181,7 @@ double Enz::vGetKcat( const Eref& e ) const
 void Enz::vSetKm( const Eref& e, double v )
 {
 	Km_ = v;
-	double volScale = 
+	double volScale =
 		convertConcToNumRateUsingMesh( e, subOut, 1 );
 	k1_ = ( k2_ + k3_ ) / ( v * volScale );
 }
@@ -207,7 +207,7 @@ double Enz::vGetNumKm( const Eref& e ) const
 void Enz::vSetRatio( const Eref& e, double v )
 {
 	k2_ = v * k3_;
-	double volScale = 
+	double volScale =
 		convertConcToNumRateUsingMesh( e, subOut, 1 );
 
 	k1_ = ( k2_ + k3_ ) / ( Km_ * volScale );
@@ -237,4 +237,3 @@ double Enz::vGetConcK1( const Eref& e ) const
 	}
 	return ( k2_ + k3_ ) / Km_;
 }
-
diff --git a/moose-core/kinetics/EnzBase.cpp b/moose-core/kinetics/EnzBase.cpp
index 76a726f1d04b5edf77f9de59b5678b8aeabfd310..0c4c136ceae179987e213bdcf60aa89d1bc21198 100644
--- a/moose-core/kinetics/EnzBase.cpp
+++ b/moose-core/kinetics/EnzBase.cpp
@@ -15,16 +15,16 @@
 #define EPSILON 1e-15
 
 static SrcFinfo2< double, double > *subOut() {
-	static SrcFinfo2< double, double > subOut( 
-			"subOut", 
+	static SrcFinfo2< double, double > subOut(
+			"subOut",
 			"Sends out increment of molecules on product each timestep"
 			);
 	return &subOut;
 }
 
 static SrcFinfo2< double, double > *prdOut() {
-	static SrcFinfo2< double, double > prdOut( 
-			"prdOut", 
+	static SrcFinfo2< double, double > prdOut(
+			"prdOut",
 			"Sends out increment of molecules on product each timestep"
 			);
 	return &prdOut;
@@ -132,7 +132,7 @@ const Cinfo* EnzBase::initCinfo()
 		&remesh,			// Destfinfo
 	};
 
-	static string doc[] = 
+	static string doc[] =
 	{
 		"Name", "EnzBase",
 		"Author", "Upi Bhalla",
@@ -253,7 +253,7 @@ double EnzBase::getKcat( const Eref& e ) const
 
 unsigned int EnzBase::getNumSub( const Eref& e ) const
 {
-	const vector< MsgFuncBinding >* mfb = 
+	const vector< MsgFuncBinding >* mfb =
 		e.element()->getMsgAndFunc( subOut()->getBindIndex() );
 	assert( mfb );
 	return ( mfb->size() );
@@ -285,7 +285,7 @@ void EnzBase::zombify( Element* orig, const Cinfo* zClass, Id solver )
 	vector< double > kcat( num, 0.0 );
 	for ( unsigned int i = 0; i < num; ++i ) {
 		Eref er( orig, i + start );
-		const EnzBase* eb = 
+		const EnzBase* eb =
 			reinterpret_cast< const EnzBase* >( er.data() );
 		kcat[ i ] = eb->getKcat( er );
 		Km[ i ] = eb->getKm( er );
@@ -305,4 +305,3 @@ void EnzBase::setSolver( Id solver, Id orig )
 {
 	;
 }
-
diff --git a/moose-core/kinetics/Pool.cpp b/moose-core/kinetics/Pool.cpp
index f39b1af84b766a41256edc2339c2d67977cb2a8b..86508cf4429f043e47483bbd419c88f2917d496b 100644
--- a/moose-core/kinetics/Pool.cpp
+++ b/moose-core/kinetics/Pool.cpp
@@ -20,21 +20,54 @@ const Cinfo* Pool::initCinfo()
 		//////////////////////////////////////////////////////////////
 		// Field Definitions: All inherited from PoolBase.
 		//////////////////////////////////////////////////////////////
+		static ElementValueFinfo< Pool, bool > isBuffered(
+			"isBuffered",
+			"Flag: True if Pool is buffered. This field changes the "
+			"type of the Pool object to BufPool, or vice versa. "
+			"None of the messages are affected. "
+			"This object class flip can only be done in the non-zombified "
+			"form of the Pool.",
+			&Pool::setIsBuffered,
+			&Pool::getIsBuffered
+		);
+
 		//////////////////////////////////////////////////////////////
-		// MsgDest Definitions: All inherited
+		// MsgDest Definitions: All but increment and decrement inherited
 		//////////////////////////////////////////////////////////////
+		static DestFinfo increment( "increment",
+			"Increments mol numbers by specified amount. Can be +ve or -ve",
+			new OpFunc1< Pool, double >( &Pool::increment )
+		);
+
+		static DestFinfo decrement( "decrement",
+			"Decrements mol numbers by specified amount. Can be +ve or -ve",
+			new OpFunc1< Pool, double >( &Pool::decrement )
+		);
+
+		static DestFinfo nIn( "nIn",
+			"Set the number of molecules by specified amount",
+			new OpFunc1< Pool, double >( &Pool::nIn )
+		);
+
 		//////////////////////////////////////////////////////////////
 		// SrcFinfo Definitions: All inherited.
 		//////////////////////////////////////////////////////////////
 		//////////////////////////////////////////////////////////////
 		// SharedMsg Definitions: All inherited.
 		//////////////////////////////////////////////////////////////
+	static Finfo* poolFinfos[] = {
+		&isBuffered,		// ElementValueFinfo
+		&increment,			// DestFinfo
+		&decrement,			// DestFinfo
+        &nIn,				// DestFinfo
+	};
+
 	static Dinfo< Pool > dinfo;
 	static Cinfo poolCinfo (
 		"Pool",
 		PoolBase::initCinfo(),
-		0,
-		0,
+		poolFinfos,
+		sizeof( poolFinfos ) / sizeof ( Finfo* ),
 		&dinfo
 	);
 
@@ -45,8 +78,8 @@ const Cinfo* Pool::initCinfo()
 // Class definitions
 //////////////////////////////////////////////////////////////
 static const Cinfo* poolCinfo = Pool::initCinfo();
-const SrcFinfo1< double >& nOut = 
-	*dynamic_cast< const SrcFinfo1< double >* >( 
+const SrcFinfo1< double >& nOut =
+	*dynamic_cast< const SrcFinfo1< double >* >(
 	poolCinfo->findFinfo( "nOut" ) );
 
 Pool::Pool()
@@ -62,13 +95,13 @@ Pool::~Pool()
 /**
  * setIsBuffered is a really nasty operation, made possible only because
  * BufPool is derived from Pool and has no other fields.
- * It uses a low-level replaceCinfo call to just change the 
+ * It uses a low-level replaceCinfo call to just change the
  * identity of the Cinfo used, leaving everything else as is.
  */
-void Pool::vSetIsBuffered( const Eref& e, bool v )
+void Pool::setIsBuffered( const Eref& e, bool v )
 {
 	static const Cinfo* bufPoolCinfo = Cinfo::find( "BufPool" );
-	if (vGetIsBuffered( e ) == v)
+	if (getIsBuffered( e ) == v)
 		return;
 	if (v) {
 		e.element()->replaceCinfo( bufPoolCinfo );
@@ -77,11 +110,8 @@ void Pool::vSetIsBuffered( const Eref& e, bool v )
 	}
 }
 
-bool Pool::vGetIsBuffered( const Eref& e ) const
+bool Pool::getIsBuffered( const Eref& e ) const
 {
-	/// We need this explicit check because when the moose class is
-	/// flipped, the internal C++ class isn't.
-	/// Inherited by BufPool.
 	return e.element()->cinfo()->name() == "BufPool";
 }
 
@@ -95,6 +125,14 @@ void Pool::vProcess( const Eref& e, ProcPtr p )
 {
 	// double A = e.sumBuf( aSlot );
 	// double B = e.sumBuf( bSlot );
+		/*
+	if ( n_ < 0 )
+		cout << "nugh" << e.objId().path() << endl;
+	if ( B_ < 0 )
+		cout << "bugh" << e.objId().path() << endl;
+	if ( p->dt < 0 )
+		cout << "tugh" << e.objId().path() << endl;
+		*/
 
 	if ( n_ > EPSILON && B_ > EPSILON ) {
 		double C = exp( -B_ * p->dt / n_ );
@@ -124,7 +162,7 @@ void Pool::vReac( double A, double B )
 	B_ += B;
 }
 
-void Pool::vIncrement( double val )
+void Pool::increment( double val )
 {
 	if ( val > 0 )
 		A_ += val;
@@ -132,7 +170,7 @@ void Pool::vIncrement( double val )
 		B_ -= val;
 }
 
-void Pool::vDecrement( double val )
+void Pool::decrement( double val )
 {
 	if ( val < 0 )
 		A_ -= val;
@@ -140,13 +178,37 @@ void Pool::vDecrement( double val )
 		B_ += val;
 }
 
-void Pool::vnIn( double val)
+void Pool::nIn( double val)
 {
     n_ = val;
     B_ = 0;
     A_ = 0;
 }
 
+/*
+void Pool::vRemesh( const Eref& e,
+	double oldvol,
+	unsigned int numTotalEntries, unsigned int startEntry,
+	const vector< unsigned int >& localIndices,
+	const vector< double >& vols )
+{
+	if ( e.dataIndex() != 0 )
+		return;
+	Neutral* n = reinterpret_cast< Neutral* >( e.data() );
+	assert( vols.size() > 0 );
+	double concInit = nInit_ / ( NA * oldvol );
+	if ( vols.size() != e.element()->dataHandler()->localEntries() )
+		n->setLastDimension( e, q, vols.size() );
+	// Note that at this point the Pool pointer may be invalid!
+	// But we need to update the concs anyway.
+	assert( e.element()->dataHandler()->localEntries() == vols.size() );
+	Pool* pooldata = reinterpret_cast< Pool* >( e.data() );
+	for ( unsigned int i = 0; i < vols.size(); ++i ) {
+		pooldata[i].nInit_ = pooldata[i].n_ = concInit * vols[i] * NA;
+	}
+}
+*/
+
 void Pool::vHandleMolWt( const Eref& e, double v )
 {
 	; // Here I should update DiffConst too.
@@ -177,7 +239,7 @@ double Pool::vGetNinit( const Eref& e ) const
 }
 
 // Conc is given in millimolar. Volume is in m^3
-void Pool::vSetConc( const Eref& e, double c ) 
+void Pool::vSetConc( const Eref& e, double c )
 {
 	n_ = NA * c * lookupVolumeFromMesh( e );
 }
diff --git a/moose-core/kinetics/Pool.h b/moose-core/kinetics/Pool.h
index 4a6b2d3ca761c2316cb79977dbe59a93b1adbb99..dec4dfa4f136057f79545254448ff89fa2d53227 100644
--- a/moose-core/kinetics/Pool.h
+++ b/moose-core/kinetics/Pool.h
@@ -57,8 +57,8 @@ class Pool: public PoolBase
 		/**
 		 * Functions to examine and change class between Pool and BufPool.
 		 */
-		void vSetIsBuffered( const Eref& e, bool v );
-		bool vGetIsBuffered( const Eref& e) const;
+		void setIsBuffered( const Eref& e, bool v );
+		bool getIsBuffered( const Eref& e ) const;
 
 		//////////////////////////////////////////////////////////////////
 		// Dest funcs. These too override virtual funcs in the Pool base 
@@ -69,13 +69,13 @@ class Pool: public PoolBase
 		void vProcess( const Eref& e, ProcPtr p );
 		void vReinit( const Eref& e, ProcPtr p );
 		void vReac( double A, double B );
-		void vIncrement( double val );
-		void vDecrement( double val );
-        void vnIn( double val );
 
 		//////////////////////////////////////////////////////////////////
 		// Novel Dest funcs not present in Pool base class.
 		//////////////////////////////////////////////////////////////////
+		void increment( double val );
+		void decrement( double val );
+                void nIn( double val );
 
 		//////////////////////////////////////////////////////////////////
 		static const Cinfo* initCinfo();
diff --git a/moose-core/kinetics/PoolBase.cpp b/moose-core/kinetics/PoolBase.cpp
index 0324c05e728e31b9bb97cb9375c103515ffa1bcb..b67e70cf7001372b166554d67311daadbfe7475e 100644
--- a/moose-core/kinetics/PoolBase.cpp
+++ b/moose-core/kinetics/PoolBase.cpp
@@ -84,18 +84,6 @@ const Cinfo* PoolBase::initCinfo()
 			&PoolBase::getSpecies
 		);
 
-		static ElementValueFinfo< PoolBase, bool > isBuffered(
-			"isBuffered",
-			"Flag: True if Pool is buffered. "
-			"In the case of Pool and BufPool the field can be assigned, to "
-			"change the type of the Pool object to BufPool, or vice versa. "
-			"None of the messages are affected. "
-			"This object class flip can only be done in the non-zombified "
-			"form of the Pool/BufPool. In Zombies it is read-only.",
-			&PoolBase::setIsBuffered,
-			&PoolBase::getIsBuffered
-		);
-
 		//////////////////////////////////////////////////////////////
 		// MsgDest Definitions
 		//////////////////////////////////////////////////////////////
@@ -116,36 +104,18 @@ const Cinfo* PoolBase::initCinfo()
 			"Should only be used in SharedMsg with species.",
 			new EpFunc1< PoolBase, double >( &PoolBase::handleMolWt )
 		);
-		//////////////////////////////////////////////////////////////
-		// MsgDest Definitions: These three are used for non-reaction 
-		// calculations involving algebraically defined rate terms.
-		//////////////////////////////////////////////////////////////
-		static DestFinfo increment( "increment",
-			"Increments mol numbers by specified amount. Can be +ve or -ve",
-			new OpFunc1< PoolBase, double >( &PoolBase::increment )
-		);
-
-		static DestFinfo decrement( "decrement",
-			"Decrements mol numbers by specified amount. Can be +ve or -ve",
-			new OpFunc1< PoolBase, double >( &PoolBase::decrement )
-		);
-
-		static DestFinfo nIn( "nIn",
-			"Assigns the number of molecules in Pool to specified value",
-			new OpFunc1< PoolBase, double >( &PoolBase::nIn )
-		);
 
 		//////////////////////////////////////////////////////////////
 		// SrcFinfo Definitions
 		//////////////////////////////////////////////////////////////
 
-		static SrcFinfo1< double > nOut( 
-				"nOut", 
+		static SrcFinfo1< double > nOut(
+				"nOut",
 				"Sends out # of molecules in pool on each timestep"
 		);
 
-		static SrcFinfo0 requestMolWt( 
-				"requestMolWt", 
+		static SrcFinfo0 requestMolWt(
+				"requestMolWt",
 				"Requests Species object for mol wt"
 		);
 
@@ -185,16 +155,12 @@ const Cinfo* PoolBase::initCinfo()
 		&concInit,	// Value
 		&volume,	// Readonly Value
 		&speciesId,	// Value
-		&isBuffered,	// Value
-		&increment,			// DestFinfo
-		&decrement,			// DestFinfo
-        &nIn,				// DestFinfo
 		&reac,				// SharedFinfo
 		&proc,				// SharedFinfo
 		&species,			// SharedFinfo
 	};
 
-	static string doc[] = 
+	static string doc[] =
 	{
 		"Name", "PoolBase",
 		"Author", "Upi Bhalla",
@@ -242,21 +208,6 @@ void PoolBase::reinit( const Eref& e, ProcPtr p )
 	vReinit( e, p );
 }
 
-void PoolBase::increment( double val )
-{
-	vIncrement(val);
-}
-
-void PoolBase::decrement( double val )
-{
-	vDecrement( val );
-}
-
-void PoolBase::nIn( double val)
-{
-	vnIn(val);
-}
-
 void PoolBase::reac( double A, double B )
 {
 	vReac( A, B );
@@ -283,15 +234,6 @@ void PoolBase::vReac( double A, double B )
 void PoolBase::vHandleMolWt( const Eref& e, double v )
 {;}
 
-void PoolBase::vIncrement( double val )
-{;}
-
-void PoolBase::vDecrement( double val )
-{;}
-
-void PoolBase::vnIn( double val)
-{;}
-
 //////////////////////////////////////////////////////////////
 // Field Definitions
 //////////////////////////////////////////////////////////////
@@ -318,7 +260,7 @@ double PoolBase::getNinit( const Eref& e ) const
 }
 
 // Conc is given in millimolar. Volume is in m^3
-void PoolBase::setConc( const Eref& e, double c ) 
+void PoolBase::setConc( const Eref& e, double c )
 {
 	vSetConc( e, c );
 }
@@ -386,19 +328,6 @@ unsigned int PoolBase::getSpecies( const Eref& e ) const
 	return vGetSpecies( e );
 }
 
-/**
- * setIsBuffered is active only for Pool and BufPool. Otherwise ignored.
- */
-void PoolBase::setIsBuffered( const Eref& e, bool v )
-{
-	vSetIsBuffered( e, v );
-}
-
-bool PoolBase::getIsBuffered( const Eref& e ) const
-{
-	return vGetIsBuffered( e );
-}
-
 //////////////////////////////////////////////////////////////
 // Virtual Field Definitions
 //////////////////////////////////////////////////////////////
@@ -412,10 +341,6 @@ double PoolBase::vGetMotorConst(const Eref& e ) const
 	return 0.0;
 }
 
-/// Dummy default function for most pool subclasses.
-void PoolBase::vSetIsBuffered( const Eref& e, bool v )
-{;}
-
 //////////////////////////////////////////////////////////////
 // Zombie conversion routine: Converts Pool subclasses. There
 // will typically be a target specific follow-up function, for example,
@@ -423,7 +348,7 @@ void PoolBase::vSetIsBuffered( const Eref& e, bool v )
 // There should also be a subsequent call to resched for the entire tree.
 //////////////////////////////////////////////////////////////
 // static func
-void PoolBase::zombify( Element* orig, const Cinfo* zClass, 
+void PoolBase::zombify( Element* orig, const Cinfo* zClass,
 				Id ksolve, Id dsolve )
 {
 	if ( orig->cinfo() == zClass )
@@ -438,7 +363,7 @@ void PoolBase::zombify( Element* orig, const Cinfo* zClass,
 	vector< double > motorConst( num, 0.0 );
 	for ( unsigned int i = 0; i < num; ++i ) {
 		Eref er( orig, i + start );
-		const PoolBase* pb = 
+		const PoolBase* pb =
 			reinterpret_cast< const PoolBase* >( er.data() );
 		species[ i ] = pb->getSpecies( er );
 		concInit[ i ] = pb->getConcInit( er );
diff --git a/moose-core/kinetics/PoolBase.h b/moose-core/kinetics/PoolBase.h
index 1bdf0a7822401ef52da6fb8ff7962f521796c18b..ace7ae86924b2b0680a837501d6aea5ff2942591 100644
--- a/moose-core/kinetics/PoolBase.h
+++ b/moose-core/kinetics/PoolBase.h
@@ -68,11 +68,6 @@ class PoolBase
 
 		void setSpecies( const Eref& e, SpeciesId v );
 		SpeciesId getSpecies( const Eref& e ) const;
-		/**
-		 * Functions to examine and change class between Pool and BufPool.
-		 */
-		void setIsBuffered( const Eref& e, bool v );
-		bool getIsBuffered( const Eref& e ) const;
 		
 		//////////////////////////////////////////////////////////////////
 		// Here are the inner virtual funcs for fields. 
@@ -96,9 +91,6 @@ class PoolBase
 		virtual void vSetVolume( const Eref& e, double v ) = 0;
 		virtual void vSetSpecies( const Eref& e, SpeciesId v ) = 0;
 		virtual SpeciesId vGetSpecies( const Eref& e ) const = 0;
-		/// I put in a default empty function for vSetIsBuffered.
-		virtual void vSetIsBuffered( const Eref& e, bool v );
-		virtual bool vGetIsBuffered( const Eref& e) const = 0;
 		/**
 		 * Assign whatever info is needed by the zombie based on the
 		 * solver Element. Encapsulates some unpleasant field extraction,
@@ -134,9 +126,6 @@ class PoolBase
 		void reinit( const Eref& e, ProcPtr p );
 		void reac( double A, double B );
 		void handleMolWt( const Eref& e, double v );
-		void increment( double val );
-		void decrement( double val );
-        void nIn( double val );
 
 		//////////////////////////////////////////////////////////////////
 		// Virtual Dest funcs. Most of these have a generic do-nothing
@@ -147,9 +136,6 @@ class PoolBase
 		virtual void vReinit( const Eref& e, ProcPtr p );
 		virtual void vReac( double A, double B );
 		virtual void vHandleMolWt( const Eref& e, double v);
-		virtual void vIncrement( double val );
-		virtual void vDecrement( double val );
-        virtual void vnIn( double val );
 
 		//////////////////////////////////////////////////////////////////
 		static const Cinfo* initCinfo();
diff --git a/moose-core/kinetics/Reac.cpp b/moose-core/kinetics/Reac.cpp
index 2b094578d309271b34e2cf59bc95ad4ddd3dc9ca..0f680cd536bf346b2d05440fd6df91831c36cb54 100644
--- a/moose-core/kinetics/Reac.cpp
+++ b/moose-core/kinetics/Reac.cpp
@@ -14,6 +14,7 @@
 #include "Reac.h"
 
 #define EPSILON 1e-15
+
 const Cinfo* Reac::initCinfo()
 {
 		//////////////////////////////////////////////////////////////
diff --git a/moose-core/kinetics/ReadCspace.cpp b/moose-core/kinetics/ReadCspace.cpp
index de0cef3e2889324163b1d9f219f53fad31527152..86b1f3f036b24455d2d2f6ee9a48d0ea19448d19 100644
--- a/moose-core/kinetics/ReadCspace.cpp
+++ b/moose-core/kinetics/ReadCspace.cpp
@@ -109,7 +109,7 @@ Id ReadCspace::readModelString( const string& model,
 	// SetGet2< double, unsigned int >::set( compt_, "buildDefaultMesh",     1e-18, 1 );
 	string temp = model.substr( pos + 1 );
 	pos = temp.find_first_of( " 	\n" );
-	
+
 	for (unsigned long i = 0 ; i < temp.length() && i < pos; i += 5 ) {
 		build( temp.c_str() + i );
 		if ( temp[ i + 4 ] != '|' )
@@ -151,7 +151,7 @@ void ReadCspace::makePlots( double plotdt )
     		Id tab = shell->doCreate( "Table2", graphs, plotname, 1 );
 			assert( tab != Id() );
 			// cout << "ReadCspace made plot " << plotname << endl;
-			ObjId mid = shell->doAddMsg( "Single", 
+			ObjId mid = shell->doAddMsg( "Single",
 				tab, "requestOut", children[i], "getConc" );
 			assert( mid != ObjId() );
 		}
@@ -160,7 +160,7 @@ void ReadCspace::makePlots( double plotdt )
     shell->doSetClock( 8, plotdt );
 
     string plotpath = basepath + "/graphs/##[TYPE=Table2]";
-    shell->doUseClock( plotpath, "process", 8 ); 
+    shell->doUseClock( plotpath, "process", 8 );
 	*/
 }
 
@@ -181,33 +181,33 @@ void ReadCspace::makePlots( double plotdt )
 //        else if (line == "A --B--> B + C") type = 'L';
 /////////////////////////////////////////////////////////////////////
 
-void ReadCspace::expandEnzyme( 
+void ReadCspace::expandEnzyme(
 	const char* name, int e, int s, int p, int p2 )
 {
 	static Shell* shell = reinterpret_cast< Shell* >( Id().eref().data() );
 
 	Id enzMolId = mol_[ name[e] - 'a' ];
-	
+
 	Id enzId = shell->doCreate( "Enz", enzMolId, name, 1 );
 	assert( enzId != Id() );
 	string cplxName = name;
 	cplxName += "_cplx";
 	Id cplxId = shell->doCreate( "Pool", enzId, cplxName, 1 );
 	assert( cplxId != Id() );
-	ObjId ret = shell->doAddMsg( "OneToOne", 
+	ObjId ret = shell->doAddMsg( "OneToOne",
 		enzId, "cplx", cplxId, "reac" );
 
-	ret = shell->doAddMsg( "OneToOne", 
+	ret = shell->doAddMsg( "OneToOne",
 		enzMolId, "reac", enzId, "enz" );
 
-	ret = shell->doAddMsg( "OneToOne", 
+	ret = shell->doAddMsg( "OneToOne",
 		mol_[ name[ s ] - 'a' ], "reac", enzId, "sub" );
 
-	ret = shell->doAddMsg( "OneToOne", 
+	ret = shell->doAddMsg( "OneToOne",
 		mol_[ name[ p ] - 'a' ], "reac", enzId, "prd" );
 
 	if ( p2 != 0 )
-		ret = shell->doAddMsg( "OneToOne", 
+		ret = shell->doAddMsg( "OneToOne",
 			mol_[ name[ p2 ] - 'a' ], "reac", enzId, "prd" );
 
 	assert( ret != ObjId() );
@@ -226,12 +226,12 @@ void ReadCspace::expandReaction( const char* name, int nm1 )
 	int i;
 
 	Id reacId = s->doCreate( "Reac", compt_, name, 1 );
-	
+
 	// A is always a substrate
 	for (i = 0; i < nm1; i++ ) {
 		s->doAddMsg( "OneToOne", reacId, "sub", mol_[ name[1] - 'a' ], "reac" );
 	}
-		
+
 	if ( name[0] < 'G' ) { // B is a product
 		s->doAddMsg( "OneToOne", reacId, "prd", mol_[ name[2] - 'a' ], "reac" );
 	} else { // B is a substrate
@@ -308,7 +308,7 @@ void ReadCspace::makeMolecule( char name )
 	unsigned int index = 1 + name - 'a';
 
 	// Put in molecule if it is a new one.
-	if ( find( molseq_.begin(), molseq_.end(), index - 1 ) == 
+	if ( find( molseq_.begin(), molseq_.end(), index - 1 ) ==
 					molseq_.end() )
 			molseq_.push_back( index - 1 );
 
@@ -444,7 +444,7 @@ void ReadCspace::testReadModel( )
 		Id temp( path );
 		r1 = Field< double >::get( temp, "Kf");
 		r2 = Field< double >::get( temp, "Kb");
-		assert( doubleEq( r1, i* 100 + 101 ) && 
+		assert( doubleEq( r1, i* 100 + 101 ) &&
 			doubleEq( r2, i * 100 + 102 ) );
 	}
 
diff --git a/moose-core/kinetics/ReadKkit.cpp b/moose-core/kinetics/ReadKkit.cpp
index 1c145e98d8571b42d621440a3e10a1157aa853c8..2529919a8714fb64013324656d13a545bfda446d 100644
--- a/moose-core/kinetics/ReadKkit.cpp
+++ b/moose-core/kinetics/ReadKkit.cpp
@@ -130,7 +130,7 @@ Id  makeStandardElements( Id pa, const string& modelname )
 		mgr = shell->doCreate( "Neutral", pa, modelname, 1, MooseGlobal );
 	Id kinetics( modelPath + "/kinetics" );
 	if ( kinetics == Id() ) {
-		kinetics = 
+		kinetics =
 		shell->doCreate( "CubeMesh", mgr, "kinetics", 1,  MooseGlobal );
 		SetGet2< double, unsigned int >::set( kinetics, "buildDefaultMesh", 1e-15, 1 );
 	}
@@ -143,7 +143,7 @@ Id  makeStandardElements( Id pa, const string& modelname )
 	Id geometry = shell->doCreate( "Neutral", mgr, "geometry", 1, MooseGlobal );
 	assert( geometry != Id() );
 
-	Id groups = 
+	Id groups =
 		shell->doCreate( "Neutral", mgr, "groups", 1, MooseGlobal );
 	assert( groups != Id() );
 	return mgr;
@@ -162,7 +162,7 @@ static void positionCompt( ObjId compt, double side, bool shiftUp )
 	}
 }
 
-void makeSolverOnCompt( Shell* s, const vector< ObjId >& compts, 
+void makeSolverOnCompt( Shell* s, const vector< ObjId >& compts,
 				bool isGsolve )
 {
 	if ( compts.size() > 3 ) {
@@ -180,8 +180,8 @@ void makeSolverOnCompt( Shell* s, const vector< ObjId >& compts,
 		positionCompt( compts[0], side, true );
 		positionCompt( compts[2], side, false );
 	}
-	
-	for ( vector< ObjId >::const_iterator 
+
+	for ( vector< ObjId >::const_iterator
 					i = compts.begin(); i != compts.end(); ++i ) {
 		string simpath = i->path() + "/##";
 		Id ksolve;
@@ -202,19 +202,19 @@ void makeSolverOnCompt( Shell* s, const vector< ObjId >& compts,
 		SetGet1< Id >::set( stoichVec[1], "buildXreacs", stoichVec[0] );
 		SetGet1< Id >::set( stoichVec[1], "buildXreacs", stoichVec[2] );
 	}
-	for ( vector< Id >::iterator 
+	for ( vector< Id >::iterator
 					i = stoichVec.begin(); i != stoichVec.end(); ++i ) {
 		SetGet0::set( *i, "filterXreacs" );
 	}
 }
 
-void setMethod( Shell* s, Id mgr, double simdt, double plotdt, 
+void setMethod( Shell* s, Id mgr, double simdt, double plotdt,
 				const string& method )
 {
 	vector< ObjId > ret;
 	simpleWildcardFind( mgr.path() + "/#[ISA=ChemCompt]", ret );
 	assert( ret.size() > 0 );
-				
+
 	Id compt( mgr.path() + "/kinetics" );
 	assert( compt != Id() );
 	string simpath2 = mgr.path() + "/##[ISA=StimulusTable]," +
@@ -224,11 +224,11 @@ void setMethod( Shell* s, Id mgr, double simdt, double plotdt,
 	if ( m == "rk4" ) {
 		cout << "Warning, not yet implemented. Using rk5 instead\n";
 		m = "rk5";
-	}	
-	if ( m == "ksolve" || m == "gsl" || 
+	}
+	if ( m == "ksolve" || m == "gsl" ||
 		m == "rk5" || m == "rkf" || m == "rk" ) {
 			makeSolverOnCompt( s, ret, false );
-	} else if ( m == "gssa" || m == "gsolve" || 
+	} else if ( m == "gssa" || m == "gsolve" ||
 		m == "gillespie" || m == "stochastic" ) {
 			makeSolverOnCompt( s, ret, true );
 	} else if ( m == "ee" || m == "neutral" ) {
@@ -257,10 +257,10 @@ void setMethod( Shell* s, Id mgr, double simdt, double plotdt,
  * of parser and is likely to remain a legacy for a while.
  */
 Id ReadKkit::read(
-	const string& filename, 
+	const string& filename,
 	const string& modelname,
 	Id pa, const string& methodArg )
-{   
+{
 	string method = methodArg;
 	ifstream fin( filename.c_str() );
 	if (!fin){
@@ -298,7 +298,7 @@ Id ReadKkit::read(
 	convertParametersToConcUnits();
 
 	// s->doSetClock( 8, plotdt_ );
-	
+
 	// string plotpath = basePath_ + "/graphs/##[TYPE=Table]," + basePath_ + "/moregraphs/##[TYPE=Table]";
 	// s->doUseClock( plotpath, "process", 8 );
 
@@ -335,7 +335,7 @@ void ReadKkit::run()
 	/*
 	string poolpath = basePath_ + "/kinetics/##[ISA=Pool]";
 	string reacpath = basePath_ + "/kinetics/##[ISA!=Pool]";
-	string plotpath = basePath_ + "/graphs/##[TYPE=Table]," + 
+	string plotpath = basePath_ + "/graphs/##[TYPE=Table]," +
 		basePath_ + "/moregraphs/##[TYPE=Table]";
 	shell_->doUseClock( reacpath, "process", 4 );
 	shell_->doUseClock( poolpath, "process", 5 );
@@ -362,10 +362,10 @@ void ReadKkit::dumpPlots( const string& filename )
 {
 	// ofstream fout ( filename.c_str() );
 	vector< ObjId > plots;
-	string plotpath = basePath_ + "/graphs/##[TYPE=Table2]," + 
+	string plotpath = basePath_ + "/graphs/##[TYPE=Table2]," +
 		basePath_ + "/moregraphs/##[TYPE=Table2]";
 	wildcardFind( plotpath, plots );
-	for ( vector< ObjId >::iterator 
+	for ( vector< ObjId >::iterator
 					i = plots.begin(); i != plots.end(); ++i )
 		SetGet2< string, string >::set( *i, "xplot",
 			filename, i->element()->getName() );
@@ -388,8 +388,8 @@ void ReadKkit::innerRead( ifstream& fin )
 		if ( temp.length() == 0 )
 				continue;
 		pos = temp.find_last_not_of( "\t " );
-		if ( pos == string::npos ) { 
-			// Nothing new in line, go with what was left earlier, 
+		if ( pos == string::npos ) {
+			// Nothing new in line, go with what was left earlier,
 			// and clear out line for the next cycle.
 			temp = "";
 			clearLine = 1;
@@ -404,7 +404,7 @@ void ReadKkit::innerRead( ifstream& fin )
 				clearLine = 1;
 			}
 		}
-			
+
 		pos = line.find_first_not_of( "\t " );
 		if ( pos == string::npos )
 				continue;
@@ -412,7 +412,7 @@ void ReadKkit::innerRead( ifstream& fin )
 			line = line.substr( pos );
 		if ( line.substr( 0, 2 ) == "//" )
 				continue;
-		if ( (pos = line.find("//")) != string::npos ) 
+		if ( (pos = line.find("//")) != string::npos )
 			line = line.substr( 0, pos );
 		if ( line.substr( 0, 2 ) == "/*" ) {
 				parseMode = COMMENT;
@@ -434,15 +434,15 @@ void ReadKkit::innerRead( ifstream& fin )
 				parseMode = readInit( line );
 		}
 	}
-	
+
 	/*
 	cout << " innerRead: " <<
-			lineNum_ << " lines read, " << 
-			numCompartments_ << " compartments, " << 
-			numPools_ << " molecules, " << 
-			numReacs_ << " reacs, " << 
-			numEnz_ << " enzs, " << 
-			numMMenz_ << " MM enzs, " << 
+			lineNum_ << " lines read, " <<
+			numCompartments_ << " compartments, " <<
+			numPools_ << " molecules, " <<
+			numReacs_ << " reacs, " <<
+			numEnz_ << " enzs, " <<
+			numMMenz_ << " MM enzs, " <<
 			numOthers_ << " others," <<
 			numPlot_ << " plots," <<
 			" PlotDt = " << plotdt_ <<
@@ -453,7 +453,7 @@ void ReadKkit::innerRead( ifstream& fin )
 ReadKkit::ParseMode ReadKkit::readInit( const string& line )
 {
 	vector< string > argv;
-	chopLine( line, argv ); 
+	chopLine( line, argv );
 	if ( argv.size() < 3 )
 		return INIT;
 
@@ -505,8 +505,8 @@ ReadKkit::ParseMode ReadKkit::readInit( const string& line )
 void ReadKkit::readData( const string& line )
 {
 	vector< string > argv;
-	chopLine( line, argv ); 
-	
+	chopLine( line, argv );
+
 	if ( argv[0] == "simundump" )
 		undump( argv );
 	else if ( argv[0] == "addmsg" )
@@ -526,7 +526,7 @@ string ReadKkit::pathTail( const string& path, string& head ) const
 	string::size_type pos = path.find_last_of( "/" );
 	assert( pos != string::npos );
 
-	head = basePath_ + path.substr( 0, pos ); 
+	head = basePath_ + path.substr( 0, pos );
 	return path.substr( pos + 1 );
 }
 
@@ -535,11 +535,11 @@ string ReadKkit::cleanPath( const string& path ) const
 	// Could surely do this better with STL. But harder to understand.
 	// Harsha: Cleaned up this function
 	// minus was getting replaced with underscore, but in some genesis model
-	// pool and reaction/Enzyme has same string name with 
+	// pool and reaction/Enzyme has same string name with
 	// difference of minus and underscore like eIF4G_A-clx and eIF4G_A_clx,
 	// which later created a problem as the same name exist in moose when minus
 	// was replaced with underscore.
-	//So replacing minus with _minus_ like I do in SBML 
+	//So replacing minus with _minus_ like I do in SBML
 	string ret = path;
 	string cleanString;
 	for ( unsigned int i = 0; i < path.length(); ++i ) {
@@ -680,10 +680,10 @@ Id ReadKkit::buildReac( const vector< string >& args )
 	// the model has been created, once we know the order of each reac.
 
 	Id reac = shell_->doCreate( "Reac", pa, tail, 1 );
-	reacIds_[ clean.substr( 10 ) ] = reac; 
+	reacIds_[ clean.substr( 10 ) ] = reac;
 	// Here is another hack: The native values stored in the reac are
 	// Kf and Kb, in conc units. However the 'clean' values from kkit
-	// are the number values numKf and numKb. In the 
+	// are the number values numKf and numKb. In the
 	// function convertReacRatesToNumUnits we take the numKf and numKb and
 	// do proper conc scaling.
 	Field< double >::set( reac, "Kf", kf );
@@ -709,7 +709,7 @@ void ReadKkit::separateVols( Id pool, double vol )
 	volCategories_.push_back( temp );
 }
 
-bool volCompare( 
+bool volCompare(
 				const pair< unsigned int, double >& A,
 				const pair< unsigned int, double >& B )
 {
@@ -717,7 +717,7 @@ bool volCompare(
 }
 // Returns the ranking of each volume. Largest is 0. This would be the
 // suffix to attach to the compartment name.
-vector< unsigned int > findVolOrder( const vector< double >& vols ) 
+vector< unsigned int > findVolOrder( const vector< double >& vols )
 {
 	vector< pair< unsigned int, double > > p( vols.size() );
 	for ( unsigned int i = 0; i < vols.size(); ++i ) {
@@ -758,7 +758,7 @@ void ReadKkit::assignPoolCompartments()
 			ss << "compartment_" << j;
 			name = ss.str();
 			comptId = Neutral::child( baseId_.eref(), name );
-			if ( comptId == Id() ) 
+			if ( comptId == Id() )
 				comptId = shell_->doCreate( "CubeMesh", baseId_, name, 1 );
 		}
 		SetGet1< double >::set( comptId, "setVolumeNotRates",vols_[i]);
@@ -793,7 +793,7 @@ Id findParentComptOfReac( Id reac )
 		reac.element()->getNeighbors( subVec, subFinfo );
 		if ( subVec.size() == 0 ) // Dangling reaction
 			return Id();
-		// For now just put the reac in the compt belonging to the 
+		// For now just put the reac in the compt belonging to the
 		// first substrate
 		return getCompt( subVec[0] );
 }
@@ -806,7 +806,7 @@ Id findParentComptOfReac( Id reac )
  */
 void ReadKkit::assignReacCompartments()
 {
-	for ( map< string, Id >::iterator i = reacIds_.begin(); 
+	for ( map< string, Id >::iterator i = reacIds_.begin();
 		i != reacIds_.end(); ++i ) {
 		Id compt = findParentComptOfReac( i->second );
 		if ( compt != Id() ) {
@@ -845,7 +845,7 @@ void ReadKkit::assignEnzCompartments()
 {
 		/*
 		Should not be needed, because the parent pool will move.
-	for ( map< string, Id >::iterator i = enzIds_.begin(); 
+	for ( map< string, Id >::iterator i = enzIds_.begin();
 		i != enzIds_.end(); ++i ) {
 		Id compt = getCompt( Neutral::parent( i->second ).id );
 		if ( moveOntoCompartment_ ) {
@@ -866,7 +866,7 @@ void ReadKkit::assignMMenzCompartments()
 {
 		/*
 		Should not be needed, because the parent pool will move.
-	for ( map< string, Id >::iterator i = mmEnzIds_.begin(); 
+	for ( map< string, Id >::iterator i = mmEnzIds_.begin();
 		i != mmEnzIds_.end(); ++i ) {
 		Id compt = getCompt( Neutral::parent( i->second ).id );
 		if ( moveOntoCompartment_ ) {
@@ -889,13 +889,13 @@ Id ReadKkit::buildEnz( const vector< string >& args )
 	double k2 = atof( args[ enzMap_[ "k2" ] ].c_str() );
 	double k3 = atof( args[ enzMap_[ "k3" ] ].c_str() );
 	// double volscale = atof( args[ enzMap_[ "vol" ] ].c_str() );
-	double nComplexInit = 
+	double nComplexInit =
 		atof( args[ enzMap_[ "nComplexInit" ] ].c_str() );
 	// double vol = atof( args[ enzMap_[ "vol" ] ].c_str());
 	bool isMM = atoi( args[ enzMap_[ "usecomplex" ] ].c_str());
 	assert( poolVols_.find( pa ) != poolVols_.end() );
 	double vol = poolVols_[ pa ];
-	
+
 	/**
 	 * vsf is vol scale factor, which is what GENESIS stores in 'vol' field
 	 * n = vsf * conc( uM )
@@ -907,7 +907,7 @@ Id ReadKkit::buildEnz( const vector< string >& args )
 		Id enz = shell_->doCreate( "MMenz", pa, tail, 1 );
 		assert( enz != Id () );
 		string mmEnzPath = clean.substr( 10 );
-		mmEnzIds_[ mmEnzPath ] = enz; 
+		mmEnzIds_[ mmEnzPath ] = enz;
 
 		assert( k1 > EPSILON );
 		double Km = ( k2 + k3 ) / k1;
@@ -922,7 +922,7 @@ Id ReadKkit::buildEnz( const vector< string >& args )
 		// double parentVol = Field< double >::get( pa, "volume" );
 		assert( enz != Id () );
 		string enzPath = clean.substr( 10 );
-		enzIds_[ enzPath ] = enz; 
+		enzIds_[ enzPath ] = enz;
 
 		// Need to figure out what to do about these. Perhaps it is OK
 		// to do this assignments in raw #/cell units.
@@ -939,7 +939,7 @@ Id ReadKkit::buildEnz( const vector< string >& args )
 		string cplxPath = enzPath + "/" + cplxName;
 		Id cplx = shell_->doCreate( "Pool", enz, cplxName, 1 );
 		assert( cplx != Id () );
-		poolIds_[ cplxPath ] = cplx; 
+		poolIds_[ cplxPath ] = cplx;
 		// Field< double >::set( cplx, "nInit", nComplexInit );
 		Field< double >::set( cplx, "nInit", nComplexInit );
 
@@ -947,9 +947,9 @@ Id ReadKkit::buildEnz( const vector< string >& args )
 		enzCplxMols_.push_back( pair< Id, Id >(  pa, cplx ) );
 		separateVols( cplx, -1 ); // -1 vol is a flag to defer mesh assignment for the cplx pool.
 
-		ObjId ret = shell_->doAddMsg( "OneToAll", 
+		ObjId ret = shell_->doAddMsg( "OneToAll",
 			ObjId( enz, 0 ), "cplx",
-			ObjId( cplx, 0 ), "reac" ); 
+			ObjId( cplx, 0 ), "reac" );
 		assert( ret != ObjId() );
 
 
@@ -969,7 +969,7 @@ Id ReadKkit::buildText( const vector< string >& args )
 	return text;
 }
 
-Id ReadKkit::buildInfo( Id parent, 
+Id ReadKkit::buildInfo( Id parent,
 	map< string, int >& m, const vector< string >& args )
 {
 	Id info = shell_->doCreate( "Annotator", parent, "info", 1 );
@@ -982,7 +982,7 @@ Id ReadKkit::buildInfo( Id parent,
 	Field< double >::set( info, "x", x );
 	Field< double >::set( info, "y", y );
 	Field< string >::set( info, "color", args[ m[ "xtree_fg_req" ] ] );
-	Field< string >::set( info, "textColor", 
+	Field< string >::set( info, "textColor",
 		args[ m[ "xtree_textfg_req" ] ] );
 	return info;
 }
@@ -1004,7 +1004,7 @@ Id ReadKkit::buildGroup( const vector< string >& args )
 
 /**
  * There is a problem with this conversion, because of the discrepancy of
- * the correct NA and the version (6e23) used in kkit. I take the 
+ * the correct NA and the version (6e23) used in kkit. I take the
  * concentration as authoritative, not the # of molecules. This is because
  * I use conc units for the rates as well, and to use n for pools and
  * conc for reactions will always introduce errors. This is still not
@@ -1020,7 +1020,7 @@ Id ReadKkit::buildPool( const vector< string >& args )
 	assert( pa != Id() );
 
 	double nInit = atof( args[ poolMap_[ "nInit" ] ].c_str() );
-	double vsf = atof( args[ poolMap_[ "vol" ] ].c_str() ); 
+	double vsf = atof( args[ poolMap_[ "vol" ] ].c_str() );
 	/**
 	 * vsf is vol scale factor, which is what GENESIS stores in 'vol' field
 	 * n = vsf * conc( uM )
@@ -1031,9 +1031,9 @@ Id ReadKkit::buildPool( const vector< string >& args )
 	int slaveEnable = atoi( args[ poolMap_[ "slave_enable" ] ].c_str() );
 	double diffConst = atof( args[ poolMap_[ "DiffConst" ] ].c_str() );
 
-	// I used -ve D as a flag to replace pool-specific D 
+	// I used -ve D as a flag to replace pool-specific D
 	// with the global value of D. Here we just ignore it.
-	if ( diffConst < 0 ) 
+	if ( diffConst < 0 )
 		diffConst = 0;
 
 	Id pool;
@@ -1044,14 +1044,14 @@ Id ReadKkit::buildPool( const vector< string >& args )
 	} else {
 		pool = shell_->doCreate( "Pool", pa, tail, 1 );
 		/*
-		cout << "ReadKkit::buildPool: Unknown slave_enable flag '" << 
+		cout << "ReadKkit::buildPool: Unknown slave_enable flag '" <<
 			slaveEnable << "' on " << clean << "\n";
 			*/
 		poolFlags_[pool] = slaveEnable;
 	}
 	assert( pool != Id() );
 	// skip the 10 chars of "/kinetics/"
-	poolIds_[ clean.substr( 10 ) ] = pool; 
+	poolIds_[ clean.substr( 10 ) ] = pool;
 
 	Field< double >::set( pool, "nInit", nInit );
 	Field< double >::set( pool, "diffConst", diffConst );
@@ -1062,8 +1062,8 @@ Id ReadKkit::buildPool( const vector< string >& args )
 	Id info = buildInfo( pool, poolMap_, args );
 
 	/*
-	cout << setw( 20 ) << head << setw( 15 ) << tail << "	" << 
-		setw( 12 ) << nInit << "	" << 
+	cout << setw( 20 ) << head << setw( 15 ) << tail << "	" <<
+		setw( 12 ) << nInit << "	" <<
 		vol << "	" << diffConst << "	" <<
 		slaveEnable << endl;
 		*/
@@ -1072,13 +1072,13 @@ Id ReadKkit::buildPool( const vector< string >& args )
 }
 
 /**
- * Finds the source pool for a SumTot. It also deals with cases where 
+ * Finds the source pool for a SumTot. It also deals with cases where
  * the source is an enz-substrate complex
  */
 Id ReadKkit::findSumTotSrc( const string& src )
 {
 	map< string, Id >::iterator i = poolIds_.find( src );
-	if ( i != poolIds_.end() ) { 
+	if ( i != poolIds_.end() ) {
 		return i->second;
 	}
 	i = enzIds_.find( src );
@@ -1086,7 +1086,7 @@ Id ReadKkit::findSumTotSrc( const string& src )
 		string head;
 		string cplx = src + '/' + pathTail( src, head ) + "_cplx";
 		i = poolIds_.find( cplx );
-		if ( i != poolIds_.end() ) { 
+		if ( i != poolIds_.end() ) {
 			return i->second;
 		}
 	}
@@ -1100,7 +1100,7 @@ void ReadKkit::buildSumTotal( const string& src, const string& dest )
 	map< string, Id >::iterator i = poolIds_.find( dest );
 	assert( i != poolIds_.end() );
 	Id destId = i->second;
-	
+
 	Id sumId;
 	// Check if the pool has not yet been converted to handle SumTots.
 	if ( destId.element()->cinfo()->name() == "Pool" ) {
@@ -1108,9 +1108,9 @@ void ReadKkit::buildSumTotal( const string& src, const string& dest )
 		// Turn dest into a FuncPool.
 		destId.element()->zombieSwap( BufPool::initCinfo() );
 
-		ObjId ret = shell_->doAddMsg( "single", 
+		ObjId ret = shell_->doAddMsg( "single",
 			ObjId( sumId, 0 ), "valueOut",
-			ObjId( destId, 0 ), "setN" ); 
+			ObjId( destId, 0 ), "setN" );
 		assert( ret != ObjId() );
 	} else {
 		sumId = Neutral::child( destId.eref(), "func" );
@@ -1121,15 +1121,15 @@ void ReadKkit::buildSumTotal( const string& src, const string& dest )
 		<< dest << "'\n";
 		return;
 	}
-	
+
 	Id srcId = findSumTotSrc( src );
 	unsigned int numVars = Field< unsigned int >::get( sumId, "numVars" );
 	ObjId xi( sumId.value() + 1, 0, numVars );
 	Field< unsigned int >::set( sumId, "numVars", numVars + 1 );
 
-	ObjId ret = shell_->doAddMsg( "single", 
+	ObjId ret = shell_->doAddMsg( "single",
 		ObjId( srcId, 0 ), "nOut",
-		xi, "input" ); 
+		xi, "input" );
 	assert( ret != ObjId() );
 
 
@@ -1152,12 +1152,12 @@ Id ReadKkit::buildStim( const vector< string >& args )
 	Id pa = shell_->doFind( head ).id;
 	assert( pa != Id() );
 
-	double level1 = atof( args[ stimMap_[ "firstLevel" ] ].c_str() ); 
-	double width1 = atof( args[ stimMap_[ "firstWidth" ] ].c_str() ); 
-	double delay1 = atof( args[ stimMap_[ "firstDelay" ] ].c_str() ); 
-	double level2 = atof( args[ stimMap_[ "secondLevel" ] ].c_str() ); 
-	double width2 = atof( args[ stimMap_[ "secondWidth" ] ].c_str() ); 
-	double delay2 = atof( args[ stimMap_[ "secondLevel" ] ].c_str() ); 
+	double level1 = atof( args[ stimMap_[ "firstLevel" ] ].c_str() );
+	double width1 = atof( args[ stimMap_[ "firstWidth" ] ].c_str() );
+	double delay1 = atof( args[ stimMap_[ "firstDelay" ] ].c_str() );
+	double level2 = atof( args[ stimMap_[ "secondLevel" ] ].c_str() );
+	double width2 = atof( args[ stimMap_[ "secondWidth" ] ].c_str() );
+	double delay2 = atof( args[ stimMap_[ "secondLevel" ] ].c_str() );
 	double baselevel = atof( args[ stimMap_[ "baseLevel" ] ].c_str() );
 
 	Id stim = shell_->doCreate( "PulseGen", pa, tail, 1 );
@@ -1195,7 +1195,7 @@ Id ReadKkit::buildChan( const vector< string >& args )
 	chanIds_[ chanPath ] = chan;
 	return chan;
 }
-	
+
 
 Id ReadKkit::buildGeometry( const vector< string >& args )
 {
@@ -1231,7 +1231,7 @@ Id ReadKkit::buildPlot( const vector< string >& args )
 	assert( plot != Id() );
 
 	temp = graph + "/" + tail;
-	plotIds_[ temp ] = plot; 
+	plotIds_[ temp ] = plot;
 
 	numPlot_++;
 	return plot;
@@ -1267,7 +1267,7 @@ Id ReadKkit::buildTable( const vector< string >& args )
 
 
 	string temp = clean.substr( 10 );
-	tabIds_[ temp ] = tab; 
+	tabIds_[ temp ] = tab;
 
 	Id info = buildInfo( tab, tableMap_, args );
 
@@ -1306,14 +1306,14 @@ unsigned int ReadKkit::loadTab( const vector< string >& args )
 	Field< vector< double > >::set( tab, "vector", tabEntries_ );
 
 	// cout << "Loading table for " << args[0] << "," << args[1] << "," << clean << endl;
-	
+
 	if ( args[1] == "-end" )
 		lastTab_ = Id();
 
 	return 0;
 }
 
-void ReadKkit::innerAddMsg( 
+void ReadKkit::innerAddMsg(
 	const string& src, const map< string, Id >& m1, const string& srcMsg,
 	const string& dest, const map< string, Id >& m2, const string& destMsg,
 	bool isBackward )
@@ -1328,14 +1328,14 @@ void ReadKkit::innerAddMsg(
 
 	// dest pool is substrate of src reac
 	if ( isBackward ) {
-		ObjId ret = shell_->doAddMsg( "AllToOne", 
+		ObjId ret = shell_->doAddMsg( "AllToOne",
 			ObjId( srcId, 0 ), srcMsg,
-			ObjId( destId, 0 ), destMsg ); 
+			ObjId( destId, 0 ), destMsg );
 		assert( ret != ObjId() );
 	} else {
-		ObjId ret = shell_->doAddMsg( "OneToAll", 
+		ObjId ret = shell_->doAddMsg( "OneToAll",
 			ObjId( srcId, 0 ), srcMsg,
-			ObjId( destId, 0 ), destMsg ); 
+			ObjId( destId, 0 ), destMsg );
 		assert( ret != ObjId() );
 	}
 }
@@ -1345,7 +1345,7 @@ void ReadKkit::addmsg( const vector< string >& args)
 {
 	string src = cleanPath( args[1] ).substr( 10 );
 	string dest = cleanPath( args[2] ).substr( 10 );
-	
+
 	if ( args[3] == "REAC" ) {
 		if ( args[4] == "A" && args[5] == "B" ) {
 			// Ignore kchans
@@ -1353,7 +1353,7 @@ void ReadKkit::addmsg( const vector< string >& args)
 				; // found a kchan, do nothing
 			else
 				innerAddMsg( src, reacIds_, "sub", dest, poolIds_, "reac");
-		} 
+		}
 		else if ( args[4] == "B" && args[5] == "A" ) {
 			// Ignore kchans
 			if ( chanIds_.find( src ) != chanIds_.end() )
@@ -1410,7 +1410,7 @@ void ReadKkit::addmsg( const vector< string >& args)
 				return;
 			}
 			vector< Id > enzcplx;
-			i->second.element()->getNeighbors( enzcplx, 
+			i->second.element()->getNeighbors( enzcplx,
 				i->second.element()->cinfo()->findFinfo( "cplxOut" ) );
 			assert( enzcplx.size() == 1 );
 			pool = enzcplx[0];
@@ -1461,7 +1461,7 @@ void ReadKkit::setupSlaveMsg( const string& src, const string& dest )
 		nameMap = &stimIds_;
 		output = "output";
 	} else {
-		cout << "Error: Unknown source for SLAVE msg: (" << src << 
+		cout << "Error: Unknown source for SLAVE msg: (" << src <<
 			", " << dest << ")\n";
 		return;
 	}
@@ -1469,7 +1469,7 @@ void ReadKkit::setupSlaveMsg( const string& src, const string& dest )
 	// NSLAVE is 1, CONCSLAVE is 2.
 	map< Id, int >::iterator i = poolFlags_.find( destId );
 	if ( i == poolFlags_.end() || !( i->second & 2 ) ) {
-		innerAddMsg( src, *nameMap, output, dest, poolIds_, 
+		innerAddMsg( src, *nameMap, output, dest, poolIds_,
 			"setNInit" );
 	} else {
 		innerAddMsg( src, *nameMap, output, dest, poolIds_,
@@ -1510,7 +1510,7 @@ void ReadKkit::convertParametersToConcUnits()
 void ReadKkit::convertPoolAmountToConcUnits()
 {
 	const double NA_RATIO = KKIT_NA / NA;
-	for ( map< string, Id >::iterator i = poolIds_.begin(); 
+	for ( map< string, Id >::iterator i = poolIds_.begin();
 		i != poolIds_.end(); ++i ) {
 		Id pool = i->second;
 		double nInit = Field< double >::get( pool, "nInit" );
@@ -1526,7 +1526,7 @@ void ReadKkit::convertPoolAmountToConcUnits()
 void ReadKkit::convertReacRatesToConcUnits()
 {
 	const double NA_RATIO = KKIT_NA / NA;
-	for ( map< string, Id >::iterator i = reacIds_.begin(); 
+	for ( map< string, Id >::iterator i = reacIds_.begin();
 		i != reacIds_.end(); ++i ) {
 		Id reac = i->second;
 		double kf = Field< double >::get( reac, "Kf" );
@@ -1537,9 +1537,9 @@ void ReadKkit::convertReacRatesToConcUnits()
 
 		// At this point the kf and kb are off because the
 		// NA for kkit is not accurate. So we correct for this.
-		unsigned int numSub = 
+		unsigned int numSub =
 			Field< unsigned int >::get( reac, "numSubstrates" );
-		unsigned int numPrd = 
+		unsigned int numPrd =
 			Field< unsigned int >::get( reac, "numProducts" );
 
 		if ( numSub > 1 )
@@ -1548,7 +1548,7 @@ void ReadKkit::convertReacRatesToConcUnits()
 		if ( numPrd > 1 )
 			kb *= pow( NA_RATIO, numPrd - 1.0 );
 
-		// Now we have the correct numKf and numKb, plug them into the 
+		// Now we have the correct numKf and numKb, plug them into the
 		// reac, and let it internally fix up the Kf and Kb.
 		Field< double >::set( reac, "numKf", kf );
 		Field< double >::set( reac, "numKb", kb );
@@ -1558,17 +1558,17 @@ void ReadKkit::convertReacRatesToConcUnits()
 void ReadKkit::convertMMenzRatesToConcUnits()
 {
 	const double NA_RATIO = KKIT_NA / NA;
-	for ( map< string, Id >::iterator i = mmEnzIds_.begin(); 
+	for ( map< string, Id >::iterator i = mmEnzIds_.begin();
 		i != mmEnzIds_.end(); ++i ) {
 		Id enz = i->second;
 		// This was set in the original # units.
 		double numKm = Field< double >::get( enz, "Km" );
 		// At this point the numKm is inaaccurate because the
 		// NA for kkit is not accurate. So we correct for this.
-		double numSub = 
+		double numSub =
 			Field< unsigned int >::get( enz, "numSubstrates" );
 		// Note that we always have the enz itself as a substrate term.
-		if ( numSub > 0 ) 
+		if ( numSub > 0 )
 			numKm *= pow( NA_RATIO, -numSub );
 
 		// Now we have the correct numKm, plug it into the MMenz, and
@@ -1584,16 +1584,16 @@ void ReadKkit::convertMMenzRatesToConcUnits()
 void ReadKkit::convertEnzRatesToConcUnits()
 {
 	const double NA_RATIO = KKIT_NA / NA;
-	for ( map< string, Id >::iterator i = enzIds_.begin(); 
+	for ( map< string, Id >::iterator i = enzIds_.begin();
 		i != enzIds_.end(); ++i ) {
 		Id enz = i->second;
 		double k1 = Field< double >::get( enz, "k1" );
 		// At this point the k1 is inaaccurate because the
 		// NA for kkit is not accurate. So we correct for this.
-		double numSub = 
+		double numSub =
 			Field< unsigned int >::get( enz, "numSubstrates" );
 		// Note that we always have the enz itself as a substrate term.
-		if ( numSub > 0 ) 
+		if ( numSub > 0 )
 			k1 *= pow( NA_RATIO, numSub );
 		Field< double >::set( enz, "k1", k1 );
 	}
diff --git a/moose-core/kinetics/WriteKkit.cpp b/moose-core/kinetics/WriteKkit.cpp
index 6546c9d49b6b92cd8f36dde17bc7899a839b564e..0f8533c05c0df96ed788913205ee10f0c4eac097 100644
--- a/moose-core/kinetics/WriteKkit.cpp
+++ b/moose-core/kinetics/WriteKkit.cpp
@@ -25,13 +25,13 @@
 #include <set>
 
 
-void writeHeader( ofstream& fout, 
+void writeHeader( ofstream& fout,
 		double simdt, double plotdt, double maxtime, double defaultVol)
 {
 	time_t rawtime;
 	time( &rawtime );
 
-	fout << 
+	fout <<
 	"//genesis\n"
 	"// kkit Version 11 flat dumpfile\n\n";
 	fout << "// Saved on " << ctime( &rawtime ) << endl;
@@ -48,7 +48,7 @@ void writeHeader( ofstream& fout,
 	"setfield /file/modpath value ~/scripts/modules\n"
 	"kparms\n\n";
 
-	fout << 
+	fout <<
 	"initdump -version 3 -ignoreorphans 1\n"
 	"simobjdump table input output alloced step_mode stepsize x y z\n"
 	"simobjdump xtree path script namemode sizescale\n"
@@ -77,7 +77,7 @@ void writeHeader( ofstream& fout,
 }
 
 string trimPath(Id id, Id  comptid)
-{	
+{
 	string msgpath = Field <string> :: get(id,"path");
 	ObjId compartment(msgpath);
 	string path1;
@@ -95,7 +95,7 @@ string trimPath(Id id, Id  comptid)
 		else
 			{
 				path1 = msgpath;
-				
+
 			}
 	}
 	else
@@ -130,9 +130,9 @@ void writeEnz( ofstream& fout, Id id,
 			 	double x, double y, Id comptid )
 {
 	string path = id.path();
-	string comptname = Field < string > :: get(comptid,"name"); 
+	string comptname = Field < string > :: get(comptid,"name");
 	string poolpath = trimPath(id,comptid);
-	
+
 
 	double k1 = 0;
 	double k2 = 0;
@@ -143,7 +143,7 @@ void writeEnz( ofstream& fout, Id id,
 	double conc = 0;
 	Id enzMol = getEnzMol( id );
 	assert( enzMol != Id() );
-	double vol = Field< double >::get( enzMol, "volume" ) * NA * 1e-3; 
+	double vol = Field< double >::get( enzMol, "volume" ) * NA * 1e-3;
 	unsigned int isMichaelisMenten = 0;
 	string enzClass = Field < string > :: get(id,"className");
 	if (enzClass == "ZombieMMenz" or enzClass == "MMenz")
@@ -164,9 +164,9 @@ void writeEnz( ofstream& fout, Id id,
 		concInit = Field< double >::get( cplx, "concInit" );
 		conc = Field< double >::get( cplx, "conc" );
 	}
-	fout << "simundump kenz /kinetics" << poolpath << " 0 " << 
+	fout << "simundump kenz /kinetics" << poolpath << " 0 " <<
 			concInit << " " <<
-			conc << " " << 
+			conc << " " <<
 			nInit << " " <<
 			n << " " <<
 			vol << " " <<
@@ -175,8 +175,8 @@ void writeEnz( ofstream& fout, Id id,
 			k3 << " " <<
 			0 << " " <<
 			isMichaelisMenten << " " <<
-			"\"\"" << " " << 
-			colour << " " << textcolour << " \"\"" << 
+			"\"\"" << " " <<
+			colour << " " << textcolour << " \"\"" <<
 			" " << x << " " << y << " 0\n";
 }
 
@@ -188,21 +188,21 @@ void writeReac( ofstream& fout, Id id,
 	string reacname = Field<string> :: get(id, "name");
 	double kf = Field< double >::get( id, "numKf" );
 	double kb = Field< double >::get( id, "numKb" );
-	
-	unsigned int numSub = 
+
+	unsigned int numSub =
 			Field< unsigned int >::get( id, "numSubstrates" );
-	unsigned int numPrd = 
+	unsigned int numPrd =
 			Field< unsigned int >::get( id, "numProducts" );
-	fout << "simundump kreac /kinetics" << trimPath(id,comptid) << " 0 " << 
-			kf << " " << kb << " \"\" " << 
+	fout << "simundump kreac /kinetics" << trimPath(id,comptid) << " 0 " <<
+			kf << " " << kb << " \"\" " <<
 			colour << " " << textcolour << " " << x << " " << y << " 0\n";
 }
 
 unsigned int getSlaveEnable( Id id )
 {
-	static const Finfo* setNinitFinfo = 
+	static const Finfo* setNinitFinfo =
 			PoolBase::initCinfo()->findFinfo( "set_nInit" );
-	static const Finfo* setConcInitFinfo = 
+	static const Finfo* setConcInitFinfo =
 			PoolBase::initCinfo()->findFinfo( "set_concInit" );
 	unsigned int ret = 0;
 	vector< Id > src;
@@ -219,7 +219,7 @@ unsigned int getSlaveEnable( Id id )
 			return 4; // Just simple buffered molecule
 	if ( src[0].element()->cinfo()->isA( "StimulusTable" ) )
 			return ret; // Following a table, this is fine.
-	
+
 	// Fallback: I have no idea what sent it the input, assume it is legit.
 	return ret;
 }
@@ -243,7 +243,7 @@ void writePool( ofstream& fout, Id id,
 	{	vector< Id > children = Field< vector< Id > >::get( id, "children" );
 		if (children.size() == 0)
 			slave_enable = 4;
-		for ( vector< Id >::iterator i = children.begin(); i != children.end(); ++i ) 
+		for ( vector< Id >::iterator i = children.begin(); i != children.end(); ++i )
 		{	string funcpath = Field <string> :: get(*i,"path");
 		  	string clsname = Field <string> :: get(*i,"className");
 		  	if (clsname == "Function" or clsname == "ZombieFunction")
@@ -252,13 +252,13 @@ void writePool( ofstream& fout, Id id,
 		  		slave_enable = 4;
 
 		}
-	}	
+	}
 	if (comptIndex > 0)
 		geometryTemp << "/geometry[" << comptIndex <<"]";
 	else
 		geometryTemp << "/geometry";
 
-	// simobjdump kpool DiffConst CoInit Co n nInit mwt nMin vol slave_enable 
+	// simobjdump kpool DiffConst CoInit Co n nInit mwt nMin vol slave_enable
 
 	fout << "simundump kpool /kinetics" << trimPath(id,comptid) << " 0 " <<
 			diffConst << " " <<
@@ -270,21 +270,21 @@ void writePool( ofstream& fout, Id id,
 			volume * NA * 1e-3 << " " << // volscale
 			slave_enable << //GENESIS FIELD HERE.
 			" /kinetics"<< geometryTemp.str() << " " <<
-			colour << " " << textcolour << " " << x << " " << y << " 0\n"; 
+			colour << " " << textcolour << " " << x << " " << y << " 0\n";
 }
 void writePlot( ofstream& fout, Id id,
 				string colour, string textcolour,
 			 	double x, double y )
-{	
+{
 	string path = id.path();
 	size_t pos = path.find( "/graphs" );
-	if ( pos == string::npos ) 
+	if ( pos == string::npos )
 		pos = path.find( "/moregraphs" );
-		if ( pos == string::npos ) 
+		if ( pos == string::npos )
 			return;
 	path = path.substr( pos );
-	fout << "simundump xplot " << path << " 3 524288 \\\n" << 
-	"\"delete_plot.w <s> <d>; edit_plot.D <w>\" " << textcolour << " 0 0 1\n";	
+	fout << "simundump xplot " << path << " 3 524288 \\\n" <<
+	"\"delete_plot.w <s> <d>; edit_plot.D <w>\" " << textcolour << " 0 0 1\n";
 }
 
 void writeGui( ofstream& fout )
@@ -313,7 +313,7 @@ void storeMMenzMsgs( Id enz, vector< string >& msgs, Id comptid )
 
 	vector < Id > srct = LookupField <string,vector < Id> >::get(enz, "neighbors","sub");
 	for (vector <Id> :: iterator rsub = srct.begin();rsub != srct.end();rsub++)
-	{	
+	{
 		string s = "addmsg /kinetics" + trimPath(*rsub, comptid) + " /kinetics" + trimPath(enz, comptid) + " SUBSTRATE n";
 		msgs.push_back( s );
 		s = "addmsg /kinetics" + trimPath(enz, comptid) + " /kinetics" + trimPath( *rsub, comptid ) + 	" REAC sA B";
@@ -340,7 +340,7 @@ void storeCplxEnzMsgs( Id enz, vector< string >& msgs, Id comptid )
 
 	vector < Id > srct = LookupField <string,vector < Id> >::get(enz, "neighbors","sub");
 	for (vector <Id> :: iterator rsub = srct.begin();rsub != srct.end();rsub++)
-	{	
+	{
 		string s = "addmsg /kinetics" + trimPath(*rsub, comptid) + " /kinetics" + trimPath(enz, comptid) + " SUBSTRATE n";
 		msgs.push_back( s );
 		s = "addmsg /kinetics" + trimPath(enz, comptid) + " /kinetics" + trimPath( *rsub, comptid ) + 	" REAC sA B";
@@ -372,7 +372,7 @@ void storeEnzMsgs( Id enz, vector< string >& msgs, Id comptid )
 }
 
 void storeReacMsgs( Id reac, vector< string >& msgs, Id comptid )
-{	
+{
 	vector < Id > srct = LookupField <string,vector < Id> >::get(reac, "neighbors","sub");
 	for (vector <Id> :: iterator rsub = srct.begin();rsub != srct.end();rsub++)
 	{	string s = "addmsg /kinetics" + trimPath(*rsub, comptid) + " /kinetics" + trimPath(reac, comptid) + " SUBSTRATE n";
@@ -401,7 +401,7 @@ void storeFunctionMsgs( Id func, vector< string >& msgs,map < double, pair<Id, i
 	string poolParent = Field <string> :: get(compt_vol[poolvol].first,"name");
 	Id xi(func.value()+1);
 	vector < Id > func_input = LookupField <string,vector < Id> >::get(xi, "neighbors","input");
-	
+
 	for (vector <Id> :: iterator funcIp = func_input.begin();funcIp != func_input.end();funcIp++)
 	{	string funcIp_path = Field < string > :: get(*funcIp,"path");
 		double vol = Field < double > :: get(*funcIp,"Volume");
@@ -419,17 +419,17 @@ void storePlotMsgs( Id tab, vector< string >& msgs, Id pool, string bg, Id compt
 	string poolName = Field <string> :: get(pool,"name");
 
 	size_t pos = tabPath.find( "/graphs" );
-	if ( pos == string::npos ) 
+	if ( pos == string::npos )
 		pos = tabPath.find( "/moregraphs" );
 		assert( pos != string::npos );
 	tabPath = tabPath.substr( pos );
-	string s = "addmsg /kinetics" + trimPath( poolPath, comptid) + " " + tabPath + 
+	string s = "addmsg /kinetics" + trimPath( poolPath, comptid) + " " + tabPath +
 	 			" PLOT Co *" + poolName + " *" + bg;
 	msgs.push_back( s );
 }
 
 /**
- * A bunch of heuristics to find good SimTimes to use for kkit. 
+ * A bunch of heuristics to find good SimTimes to use for kkit.
  * Returns runTime.
  */
 double estimateSimTimes( double& simDt, double& plotDt )
@@ -437,9 +437,9 @@ double estimateSimTimes( double& simDt, double& plotDt )
 		double runTime = Field< double >::get( Id( 1 ), "runTime" );
 		if ( runTime <= 0 )
 				runTime = 100.0;
-		vector< double > dts = 
+		vector< double > dts =
 				Field< vector< double> >::get( Id( 1 ), "dts" );
-		
+
 		simDt = dts[11];
 		plotDt = dts[18];
 		cout <<  "estimatesimtimes" << simDt << plotDt;
@@ -456,18 +456,18 @@ double estimateSimTimes( double& simDt, double& plotDt )
 /// Returns an estimate of the default volume used in the model.
 double estimateDefaultVol( Id model )
 {
-		vector< Id > children = 
+		vector< Id > children =
 				Field< vector< Id > >::get( model, "children" );
 		vector< double > vols;
 		double maxVol = 0;
-		for ( vector< Id >::iterator i = children.begin(); 
+		for ( vector< Id >::iterator i = children.begin();
 						i != children.end(); ++i ) {
 				if ( i->element()->cinfo()->isA( "ChemCompt" ) ) {
 						double v = Field< double >::get( *i, "volume" );
 						if ( i->element()->getName() == "kinetics" )
 								return v;
 						vols.push_back( v );
-						if ( maxVol < v ) 
+						if ( maxVol < v )
 								maxVol = v;
 				}
 		}
@@ -482,19 +482,19 @@ void writeMsgs( ofstream& fout, const vector< string >& msgs )
 			fout << *i << endl;
 }
 void writeGroup(ofstream& fout,Id model)
-{ 	
+{
     vector < ObjId> group;
     int x = 10;
     int y = 20;
     int num = wildcardFind( model.path() + "/##[TYPE=Neutral]", group );
     for ( vector< ObjId >::iterator itr = group.begin(); itr != group.end();itr++)
-    {	
+    {
         string path = Field<string>::get(*itr,"path");
         size_t pos = path.find( "/kinetics" );
         if (pos != std::string::npos)
         {
             path = path.substr( pos );
-            fout << "simundump group " << path << " 0 " << 
+            fout << "simundump group " << path << " 0 " <<
                 "blue" << " " << "green"	 << " x 0 0 \"\" defaultfile \\\n";
             fout << "  defaultfile.g 0 0 0 " << x << " " << y << " 0\n";
         }
@@ -514,17 +514,17 @@ void writeKkit( Id model, const string& fname )
 		string fg = "black";
 		double x = 0;
 		double y = 0;
-			
+
 		map < double, pair<Id, int> > compt_vol;
-		
+
 		unsigned int num = wildcardFind( model.path() + "/##[ISA=ChemCompt]", chemCompt );
 		if ( num == 0 ) {
-			cout << "Warning: writeKkit:: No model found on " << model << 
+			cout << "Warning: writeKkit:: No model found on " << model <<
 					endl;
 			return;
 		}
 		for ( vector< ObjId >::iterator itr = chemCompt.begin(); itr != chemCompt.end();itr++)
-		{	
+		{
 			vector < unsigned int>dims;
       		unsigned int dims_size;
       		dims_size = 1;
@@ -533,7 +533,7 @@ void writeKkit( Id model, const string& fname )
       		string comptname = Field<string>::get(*itr,"name");
       		if (comptname != "kinetics")
       		{
-      			fout << "simundump group /kinetics/" << comptname << " 0 " << 
+      			fout << "simundump group /kinetics/" << comptname << " 0 " <<
 			"blue" << " " << "green"	 << " x 0 0 \"\" defaultfile \\\n";
 				fout << "  defaultfile.g 0 0 0 " << rand() % 10 + 1 << " " << rand() % 10 + 1 << " 0\n";
       		}
@@ -544,8 +544,8 @@ void writeKkit( Id model, const string& fname )
       		if (vecIndex > 0)
 		   		geometry << "simundump geometry /kinetics" <<  "/geometry[" << vecIndex <<"] 0 " << size << " " << ndim << " sphere " <<" \"\" white black 0 0 0\n";
 		   	else
-		  		geometry << "simundump geometry /kinetics"  <<  "/geometry 0 " << size << " " << ndim << " sphere " <<" \"\" white black 0 0 0\n"; 		
-			fout << geometry.str();	
+		  		geometry << "simundump geometry /kinetics"  <<  "/geometry 0 " << size << " " << ndim << " sphere " <<" \"\" white black 0 0 0\n";
+			fout << geometry.str();
 			compt_vol.insert(make_pair(size,make_pair(*itr,vecIndex)));
 		} // compartmentclose
 		writeGroup(fout, model);
@@ -553,7 +553,7 @@ void writeKkit( Id model, const string& fname )
        	for (compt = compt_vol.begin(); compt != compt_vol.end(); compt++)
        	{
         	string comptPath = Field<string>::get(compt->second.first,"path");
-			//  Species 
+			//  Species
 			vector< ObjId > Compt_spe;
 		  	wildcardFind(comptPath+"/##[ISA=PoolBase]",Compt_spe);
 		  	int species_size = 1;
@@ -578,11 +578,11 @@ void writeKkit( Id model, const string& fname )
 			for (vector <ObjId> :: iterator itrF= Compt_Func.begin();itrF != Compt_Func.end();itrF++)
 			{	storeFunctionMsgs( *itrF, msgs,compt_vol);
 			}
-	  		// Reaction 
+	  		// Reaction
 			vector< ObjId > Compt_Reac;
 			wildcardFind(comptPath+"/##[ISA=ReacBase]",Compt_Reac);
 			for (vector <ObjId> :: iterator itrR= Compt_Reac.begin();itrR != Compt_Reac.end();itrR++)
-			{ 	
+			{
 				string path = Field<string> :: get(*itrR,"path");
 				Id annotaId( path+"/info");
 			    string noteClass = Field<string> :: get(annotaId,"className");
@@ -608,7 +608,7 @@ void writeKkit( Id model, const string& fname )
 			    writeEnz( fout, *itrE, bg, fg, x, y, compt->second.first);
 			    storeEnzMsgs( *itrE, msgs, compt->second.first);
 			}// reaction
-			
+
 		} //compatment loop
 	writeGui ( fout);
 
@@ -623,7 +623,7 @@ void writeKkit( Id model, const string& fname )
 		{ 	string path = Field <string> :: get(*tabItem,"path");
 			double vol = Field < double> :: get (*tabItem,"Volume");
 			//Trying to find the compartment name via volume
-			//otherwise if we go via parent, sometimes it might 
+			//otherwise if we go via parent, sometimes it might
 			// get groupname so maped compartment Id and volume
 
 			Id parentId = compt_vol[vol].first;
diff --git a/moose-core/kinetics/lookupVolumeFromMesh.cpp b/moose-core/kinetics/lookupVolumeFromMesh.cpp
index 0b4e7ec38fcc0fcb67b3b7dbd74de13c46fb1d9e..84f9ebf925d0a6bf9a00f91039994a733454bd0e 100644
--- a/moose-core/kinetics/lookupVolumeFromMesh.cpp
+++ b/moose-core/kinetics/lookupVolumeFromMesh.cpp
@@ -46,21 +46,21 @@ double lookupVolumeFromMesh( const Eref& e )
  * Figures out all the volumes of the substrates or products on the
  * specified reaction 'reac'. The SrcFinfo is for the sub or prd msg.
  * Returns the index of the smallest vol. Passes back a vector of volumes.
- * The meshIndex is zero. Reasoning is as follows: both in the case of 
+ * The meshIndex is zero. Reasoning is as follows: both in the case of
  * well-stirred (single mesh entry) models, and in the case of spatial
- * models with consistent mesh sizes and alignments, the mesh entry 
+ * models with consistent mesh sizes and alignments, the mesh entry
  * volumes are in the same ratio.
  * Cases with more complex arrangements may also use the current vols as
  * a starting point, but will need to add index-specific scaling factors
  * to their reaction system.
  */
 
-unsigned int getReactantVols( const Eref& reac, const SrcFinfo* pools, 
+unsigned int getReactantVols( const Eref& reac, const SrcFinfo* pools,
 	vector< double >& vols )
 {
 	static const unsigned int meshIndex = 0;
 
-	const vector< MsgFuncBinding >* mfb = 
+	const vector< MsgFuncBinding >* mfb =
 		reac.element()->getMsgAndFunc( pools->getBindIndex() );
 	unsigned int smallIndex = 0;
 
@@ -88,22 +88,22 @@ unsigned int getReactantVols( const Eref& reac, const SrcFinfo* pools,
 }
 
 /**
- * Returns conversion factor to convert rates from concentration to 
+ * Returns conversion factor to convert rates from concentration to
  * mol# units.
  * Handles arbitrary combinations of volumes.
- * Assumes that the reference volume for computing rates is the 
+ * Assumes that the reference volume for computing rates is the
  * smallest volume.
  * 26 Feb 2013: This is now changed to use the volume of the first entry.
  * Should only be used for substrates. For products need to find the
  * first substrate, separately, and use that to scale down the conv factor.
  * Assumes all calculations are in SI: cubic metres and millimolar.
- * 27 Feb 2013: This is changed to use the volume of a voxel of the 
+ * 27 Feb 2013: This is changed to use the volume of a voxel of the
  * the home compartment of the reac.
  * Be warned: this can cause unexpected problems if the home compartment
- * isn't according to convention. For example, if there is a single 
+ * isn't according to convention. For example, if there is a single
  * substrate and the home compartment is elsewhere, you will get very odd
  * Kf:kf values.
- * 9 Oct 2013: This is now changed to use the volume of the first 
+ * 9 Oct 2013: This is now changed to use the volume of the first
  * substrate. Note that if the conversion is for products, then the
  * routine has to look up the substrate list to get the first substrate.
  * Reason is that the home compartment was often wrong in ReadKkit.
@@ -111,7 +111,7 @@ unsigned int getReactantVols( const Eref& reac, const SrcFinfo* pools,
  * conventions they use for cross-compartment reactions.
  */
 
-double convertConcToNumRateUsingMesh( const Eref& e, const SrcFinfo* pools, 
+double convertConcToNumRateUsingMesh( const Eref& e, const SrcFinfo* pools,
 	bool doPartialConversion )
 {
 	vector< double > vols;
@@ -157,10 +157,10 @@ double convertConcToNumRateUsingMesh( const Eref& e, const SrcFinfo* pools,
  * This variant already knows the volume, but has to figure out # of
  * reactants.
  */
-double convertConcToNumRateUsingVol( const Eref& e, const SrcFinfo* pools, 
+double convertConcToNumRateUsingVol( const Eref& e, const SrcFinfo* pools,
 	double volume, double scale, bool doPartialConversion )
 {
-	const vector< MsgFuncBinding >* mfb = 
+	const vector< MsgFuncBinding >* mfb =
 		e.element()->getMsgAndFunc( pools->getBindIndex() );
 	double conversion = 1.0;
 	if ( mfb && mfb->size() > 0 ) {
@@ -171,7 +171,7 @@ double convertConcToNumRateUsingVol( const Eref& e, const SrcFinfo* pools,
 				conversion = pow( conversion, power );
 			}
 		}
-		if ( conversion <= 0 ) 
+		if ( conversion <= 0 )
 			conversion = 1.0;
 	}
 
@@ -184,7 +184,7 @@ double convertConcToNumRateUsingVol( const Eref& e, const SrcFinfo* pools,
  * or mesh entries, and may therefore have different volumes.
  * We already know the reactants and their affiliations.
  */
-double convertConcToNumRateInTwoCompts( double v1, unsigned int n1, 
+double convertConcToNumRateInTwoCompts( double v1, unsigned int n1,
 	double v2, unsigned int n2, double scale )
 {
 	double conversion = 1.0;
@@ -194,7 +194,7 @@ double convertConcToNumRateInTwoCompts( double v1, unsigned int n1,
 	for ( unsigned int i = 0; i < n2; ++i )
 		conversion *= scale * NA * v2;
 
-	if ( conversion <= 0 ) 
+	if ( conversion <= 0 )
 			conversion = 1.0;
 
 	return conversion;
diff --git a/moose-core/ksolve/Gsolve.cpp b/moose-core/ksolve/Gsolve.cpp
index 736ca1f84a9499a35a6a43a1a36934aaf501ccc0..a1c576ac18c65fe39c7570050a2f6456fa6f7123 100644
--- a/moose-core/ksolve/Gsolve.cpp
+++ b/moose-core/ksolve/Gsolve.cpp
@@ -30,199 +30,195 @@
 const unsigned int OFFNODE = ~0;
 
 // static function
-SrcFinfo2< Id, vector< double > >* Gsolve::xComptOut()
-{
-    static SrcFinfo2< Id, vector< double > > xComptOut( "xComptOut",
-            "Sends 'n' of all molecules participating in cross-compartment "
-            "reactions between any juxtaposed voxels between current compt "
-            "and another compartment. This includes molecules local to this "
-            "compartment, as well as proxy molecules belonging elsewhere. "
-            "A(t+1) = (Alocal(t+1) + AremoteProxy(t+1)) - Alocal(t) "
-            "A(t+1) = (Aremote(t+1) + Aproxy(t+1)) - Aproxy(t) "
-            "Then we update A on the respective solvers with: "
-            "Alocal(t+1) = Aproxy(t+1) = A(t+1) "
-            "This is equivalent to sending dA over on each timestep. "
-                                                      );
-    return &xComptOut;
+SrcFinfo2< Id, vector< double > >* Gsolve::xComptOut() {
+	static SrcFinfo2< Id, vector< double > > xComptOut( "xComptOut",
+		"Sends 'n' of all molecules participating in cross-compartment "
+		"reactions between any juxtaposed voxels between current compt "
+		"and another compartment. This includes molecules local to this "
+		"compartment, as well as proxy molecules belonging elsewhere. "
+		"A(t+1) = (Alocal(t+1) + AremoteProxy(t+1)) - Alocal(t) "
+		"A(t+1) = (Aremote(t+1) + Aproxy(t+1)) - Aproxy(t) "
+		"Then we update A on the respective solvers with: "
+		"Alocal(t+1) = Aproxy(t+1) = A(t+1) "
+		"This is equivalent to sending dA over on each timestep. "
+   	);
+	return &xComptOut;
 }
 
 const Cinfo* Gsolve::initCinfo()
 {
-    ///////////////////////////////////////////////////////
-    // Field definitions
-    ///////////////////////////////////////////////////////
-
-    static ValueFinfo< Gsolve, Id > stoich (
-        "stoich",
-        "Stoichiometry object for handling this reaction system.",
-        &Gsolve::setStoich,
-        &Gsolve::getStoich
-    );
-
-    static ValueFinfo< Gsolve, Id > compartment (
-        "compartment",
-        "Compartment that contains this reaction system.",
-        &Gsolve::setCompartment,
-        &Gsolve::getCompartment
-    );
-
-    static ReadOnlyValueFinfo< Gsolve, unsigned int > numLocalVoxels(
-        "numLocalVoxels",
-        "Number of voxels in the core reac-diff system, on the "
-        "current solver. ",
-        &Gsolve::getNumLocalVoxels
-    );
-    static LookupValueFinfo<
-    Gsolve, unsigned int, vector< double > > nVec(
-        "nVec",
-        "vector of pool counts",
-        &Gsolve::setNvec,
-        &Gsolve::getNvec
-    );
-    static ValueFinfo< Gsolve, unsigned int > numAllVoxels(
-        "numAllVoxels",
-        "Number of voxels in the entire reac-diff system, "
-        "including proxy voxels to represent abutting compartments.",
-        &Gsolve::setNumAllVoxels,
-        &Gsolve::getNumAllVoxels
-    );
-
-    static ValueFinfo< Gsolve, unsigned int > numPools(
-        "numPools",
-        "Number of molecular pools in the entire reac-diff system, "
-        "including variable, function and buffered.",
-        &Gsolve::setNumPools,
-        &Gsolve::getNumPools
-    );
-
-    static ValueFinfo< Gsolve, bool > useRandInit(
-        "useRandInit",
-        "Flag: True when using probabilistic (random) rounding.\n "
-        "Default: True.\n "
-        "When initializing the mol# from floating-point Sinit values, "
-        "we have two options. One is to look at each Sinit, and round "
-        "to the nearest integer. The other is to look at each Sinit, "
-        "and probabilistically round up or down depending on the  "
-        "value. For example, if we had a Sinit value of 1.49,  "
-        "this would always be rounded to 1.0 if the flag is false, "
-        "and would be rounded to 1.0 and 2.0 in the ratio 51:49 if "
-        "the flag is true. ",
-        &Gsolve::setRandInit,
-        &Gsolve::getRandInit
-    );
-
-    static ValueFinfo< Gsolve, bool > useClockedUpdate(
-        "useClockedUpdate",
-        "Flag: True to cause all reaction propensities to be updated "
-        "on every clock tick.\n"
-        "Default: False.\n"
-        "This flag should be set when the reaction system "
-        "includes a function with a dependency on time or on external "
-        "events. It has a significant speed penalty so the flag "
-        "should not be set unless there are such functions. " ,
-        &Gsolve::setClockedUpdate,
-        &Gsolve::getClockedUpdate
-    );
-    static ReadOnlyLookupValueFinfo<
-    Gsolve, unsigned int, vector< unsigned int > > numFire(
-        "numFire",
-        "Vector of the number of times each reaction has fired."
-        "Indexed by the voxel number."
-        "Zeroed out at reinit.",
-        &Gsolve::getNumFire
-    );
-
-    ///////////////////////////////////////////////////////
-    // DestFinfo definitions
-    ///////////////////////////////////////////////////////
-
-    static DestFinfo process( "process",
-                              "Handles process call",
-                              new ProcOpFunc< Gsolve >( &Gsolve::process ) );
-    static DestFinfo reinit( "reinit",
-                             "Handles reinit call",
-                             new ProcOpFunc< Gsolve >( &Gsolve::reinit ) );
-
-    static DestFinfo voxelVol( "voxelVol",
-                               "Handles updates to all voxels. Comes from parent "
-                               "ChemCompt object.",
-                               new OpFunc1< Gsolve, vector< double > >(
-                                   &Gsolve::updateVoxelVol )
-                             );
-
-    static DestFinfo initProc( "initProc",
-                               "Handles initProc call from Clock",
-                               new ProcOpFunc< Gsolve >( &Gsolve::initProc ) );
-    static DestFinfo initReinit( "initReinit",
-                                 "Handles initReinit call from Clock",
-                                 new ProcOpFunc< Gsolve >( &Gsolve::initReinit ) );
-
-    static DestFinfo xComptIn( "xComptIn",
-                               "Handles arriving pool 'n' values used in cross-compartment "
-                               "reactions.",
-                               new EpFunc2< Gsolve, Id, vector< double > >( &Gsolve::xComptIn )
-                             );
-    ///////////////////////////////////////////////////////
-    // Shared definitions
-    ///////////////////////////////////////////////////////
-    static Finfo* procShared[] =
-    {
-        &process, &reinit
-    };
-    static SharedFinfo proc( "proc",
-                             "Shared message for process and reinit",
-                             procShared, sizeof( procShared ) / sizeof( const Finfo* )
-                           );
-
-    static Finfo* initShared[] =
-    {
-        &initProc, &initReinit
-    };
-    static SharedFinfo init( "init",
-                             "Shared message for initProc and initReinit. This is used"
-                             " when the system has cross-compartment reactions. ",
-                             initShared, sizeof( initShared ) / sizeof( const Finfo* )
-                           );
-
-    static Finfo* xComptShared[] =
-    {
-        xComptOut(), &xComptIn
-    };
-    static SharedFinfo xCompt( "xCompt",
-                               "Shared message for pool exchange for cross-compartment "
-                               "reactions. Exchanges latest values of all pools that "
-                               "participate in such reactions.",
-                               xComptShared, sizeof( xComptShared ) / sizeof( const Finfo* )
-                             );
-    ///////////////////////////////////////////////////////
-
-    static Finfo* gsolveFinfos[] =
-    {
-        &stoich,			// Value
-        &numLocalVoxels,	// ReadOnlyValue
-        &nVec,				// LookupValue
-        &numAllVoxels,		// ReadOnlyValue
-        &numPools,			// Value
-        &voxelVol,			// DestFinfo
-        &proc,				// SharedFinfo
-        &init,				// SharedFinfo
-        &xCompt,			// SharedFinfo
-        // Here we put new fields that were not there in the Ksolve.
-        &useRandInit,		// Value
-        &useClockedUpdate,	// Value
-        &numFire,			// ReadOnlyLookupValue
-    };
-
-    static Dinfo< Gsolve > dinfo;
-    static  Cinfo gsolveCinfo(
-        "Gsolve",
-        Neutral::initCinfo(),
-        gsolveFinfos,
-        sizeof(gsolveFinfos)/sizeof(Finfo *),
-        &dinfo
-    );
-
-    return &gsolveCinfo;
+		///////////////////////////////////////////////////////
+		// Field definitions
+		///////////////////////////////////////////////////////
+		
+		static ValueFinfo< Gsolve, Id > stoich (
+			"stoich",
+			"Stoichiometry object for handling this reaction system.",
+			&Gsolve::setStoich,
+			&Gsolve::getStoich
+		);
+
+		static ValueFinfo< Gsolve, Id > compartment (
+			"compartment",
+			"Compartment that contains this reaction system.",
+			&Gsolve::setCompartment,
+			&Gsolve::getCompartment
+		);
+
+		static ReadOnlyValueFinfo< Gsolve, unsigned int > numLocalVoxels(
+			"numLocalVoxels",
+			"Number of voxels in the core reac-diff system, on the "
+			"current solver. ",
+			&Gsolve::getNumLocalVoxels
+		);
+		static LookupValueFinfo< 
+				Gsolve, unsigned int, vector< double > > nVec(
+			"nVec",
+			"vector of pool counts",
+			&Gsolve::setNvec,
+			&Gsolve::getNvec
+		);
+		static ValueFinfo< Gsolve, unsigned int > numAllVoxels(
+			"numAllVoxels",
+			"Number of voxels in the entire reac-diff system, "
+			"including proxy voxels to represent abutting compartments.",
+			&Gsolve::setNumAllVoxels,
+			&Gsolve::getNumAllVoxels
+		);
+
+		static ValueFinfo< Gsolve, unsigned int > numPools(
+			"numPools",
+			"Number of molecular pools in the entire reac-diff system, "
+			"including variable, function and buffered.",
+			&Gsolve::setNumPools,
+			&Gsolve::getNumPools
+		);
+
+		static ValueFinfo< Gsolve, bool > useRandInit(
+			"useRandInit",
+			"Flag: True when using probabilistic (random) rounding.\n "
+			"Default: True.\n "
+			"When initializing the mol# from floating-point Sinit values, "
+			"we have two options. One is to look at each Sinit, and round "
+			"to the nearest integer. The other is to look at each Sinit, "
+			"and probabilistically round up or down depending on the  "
+			"value. For example, if we had a Sinit value of 1.49,  "
+			"this would always be rounded to 1.0 if the flag is false, "
+			"and would be rounded to 1.0 and 2.0 in the ratio 51:49 if "
+			"the flag is true. ",
+			&Gsolve::setRandInit,
+			&Gsolve::getRandInit
+		);
+
+		static ValueFinfo< Gsolve, bool > useClockedUpdate(
+			"useClockedUpdate",
+			"Flag: True to cause all reaction propensities to be updated "
+			"on every clock tick.\n"
+			"Default: False.\n"
+			"This flag should be set when the reaction system "
+			"includes a function with a dependency on time or on external "
+			"events. It has a significant speed penalty so the flag "
+			"should not be set unless there are such functions. " ,
+			&Gsolve::setClockedUpdate,
+			&Gsolve::getClockedUpdate
+		);
+		static ReadOnlyLookupValueFinfo< 
+				Gsolve, unsigned int, vector< unsigned int > > numFire(
+			"numFire",
+			"Vector of the number of times each reaction has fired."
+			"Indexed by the voxel number."
+			"Zeroed out at reinit.",
+			&Gsolve::getNumFire
+		);
+
+		///////////////////////////////////////////////////////
+		// DestFinfo definitions
+		///////////////////////////////////////////////////////
+
+		static DestFinfo process( "process",
+			"Handles process call",
+			new ProcOpFunc< Gsolve >( &Gsolve::process ) );
+		static DestFinfo reinit( "reinit",
+			"Handles reinit call",
+			new ProcOpFunc< Gsolve >( &Gsolve::reinit ) );
+		
+		static DestFinfo voxelVol( "voxelVol",
+			"Handles updates to all voxels. Comes from parent "
+			"ChemCompt object.",
+			new OpFunc1< Gsolve, vector< double > >(
+			&Gsolve::updateVoxelVol )
+		);
+
+		static DestFinfo initProc( "initProc",
+			"Handles initProc call from Clock",
+			new ProcOpFunc< Gsolve >( &Gsolve::initProc ) );
+		static DestFinfo initReinit( "initReinit",
+			"Handles initReinit call from Clock",
+			new ProcOpFunc< Gsolve >( &Gsolve::initReinit ) );
+
+		static DestFinfo xComptIn( "xComptIn",
+			"Handles arriving pool 'n' values used in cross-compartment "
+			"reactions.",
+			new EpFunc2< Gsolve, Id, vector< double > >( &Gsolve::xComptIn )
+		);
+		///////////////////////////////////////////////////////
+		// Shared definitions
+		///////////////////////////////////////////////////////
+		static Finfo* procShared[] = {
+			&process, &reinit
+		};
+		static SharedFinfo proc( "proc",
+			"Shared message for process and reinit",
+			procShared, sizeof( procShared ) / sizeof( const Finfo* )
+		);
+
+		static Finfo* initShared[] = {
+			&initProc, &initReinit
+		};
+		static SharedFinfo init( "init",
+			"Shared message for initProc and initReinit. This is used"
+		    " when the system has cross-compartment reactions. ",
+			initShared, sizeof( initShared ) / sizeof( const Finfo* )
+		);
+
+		static Finfo* xComptShared[] = {
+			xComptOut(), &xComptIn
+		};
+		static SharedFinfo xCompt( "xCompt",
+			"Shared message for pool exchange for cross-compartment "
+			"reactions. Exchanges latest values of all pools that "
+			"participate in such reactions.",
+			xComptShared, sizeof( xComptShared ) / sizeof( const Finfo* )
+		);
+		///////////////////////////////////////////////////////
+
+	static Finfo* gsolveFinfos[] =
+	{
+		&stoich,			// Value
+		&numLocalVoxels,	// ReadOnlyValue
+		&nVec,				// LookupValue
+		&numAllVoxels,		// ReadOnlyValue
+		&numPools,			// Value
+		&voxelVol,			// DestFinfo
+		&proc,				// SharedFinfo
+		&init,				// SharedFinfo
+		&xCompt,			// SharedFinfo
+		// Here we put new fields that were not there in the Ksolve. 
+		&useRandInit,		// Value
+		&useClockedUpdate,	// Value
+		&numFire,			// ReadOnlyLookupValue
+	};
+	
+	static Dinfo< Gsolve > dinfo;
+	static  Cinfo gsolveCinfo(
+		"Gsolve",
+		Neutral::initCinfo(),
+		gsolveFinfos,
+		sizeof(gsolveFinfos)/sizeof(Finfo *),
+		&dinfo
+	);
+
+	return &gsolveCinfo;
 }
 
 static const Cinfo* gsolveCinfo = Gsolve::initCinfo();
@@ -232,20 +228,16 @@ static const Cinfo* gsolveCinfo = Gsolve::initCinfo();
 //////////////////////////////////////////////////////////////
 
 Gsolve::Gsolve()
-    :
-    pools_( 1 ),
-    startVoxel_( 0 ),
-    dsolve_(),
-    dsolvePtr_( 0 ),
-    useClockedUpdate_( false )
-{
-    ;
-}
+	: 
+		pools_( 1 ),
+		startVoxel_( 0 ),
+		dsolve_(),
+		dsolvePtr_( 0 ),
+		useClockedUpdate_( false )
+{;}
 
 Gsolve::~Gsolve()
-{
-    ;
-}
+{;}
 
 //////////////////////////////////////////////////////////////
 // Field Access functions
@@ -253,131 +245,121 @@ Gsolve::~Gsolve()
 
 Id Gsolve::getStoich() const
 {
-    return stoich_;
+	return stoich_;
 }
 
 void Gsolve::setCompartment( Id compt )
 {
-    if ( ( compt.element()->cinfo()->isA( "ChemCompt" ) ) )
-    {
-        compartment_ = compt;
-        vector< double > vols =
-            Field< vector< double > >::get( compt, "voxelVolume" );
-        if ( vols.size() > 0 )
-        {
-            pools_.resize( vols.size() );
-            for ( unsigned int i = 0; i < vols.size(); ++i )
-            {
-                pools_[i].setVolume( vols[i] );
-            }
-        }
-    }
+	if ( ( compt.element()->cinfo()->isA( "ChemCompt" ) ) ) {
+		compartment_ = compt;
+		vector< double > vols = 
+			Field< vector< double > >::get( compt, "voxelVolume" );
+		if ( vols.size() > 0 ) {
+			pools_.resize( vols.size() );
+			for ( unsigned int i = 0; i < vols.size(); ++i ) {
+				pools_[i].setVolume( vols[i] );
+			}
+		}
+	}
 }
 
 Id Gsolve::getCompartment() const
 {
-    return compartment_;
+	return compartment_;
 }
 
 void Gsolve::setStoich( Id stoich )
 {
-    // This call is done _before_ setting the path on stoich
-    assert( stoich.element()->cinfo()->isA( "Stoich" ) );
-    stoich_ = stoich;
-    stoichPtr_ = reinterpret_cast< Stoich* >( stoich.eref().data() );
-    if ( stoichPtr_->getNumAllPools() == 0 )
-    {
-        stoichPtr_ = 0;
-        return;
-    }
-    sys_.stoich = stoichPtr_;
-    sys_.isReady = false;
-    for ( unsigned int i = 0; i < pools_.size(); ++i )
-        pools_[i].setStoich( stoichPtr_ );
+	// This call is done _before_ setting the path on stoich
+	assert( stoich.element()->cinfo()->isA( "Stoich" ) );
+	stoich_ = stoich;
+	stoichPtr_ = reinterpret_cast< Stoich* >( stoich.eref().data() );
+    if ( stoichPtr_->getNumAllPools() == 0 ) {
+		stoichPtr_ = 0;
+		return;
+	}
+	sys_.stoich = stoichPtr_;
+	sys_.isReady = false;
+	for ( unsigned int i = 0; i < pools_.size(); ++i )
+		pools_[i].setStoich( stoichPtr_ );
 }
 
 unsigned int Gsolve::getNumLocalVoxels() const
 {
-    return pools_.size();
+	return pools_.size();
 }
 
 unsigned int Gsolve::getNumAllVoxels() const
 {
-    return pools_.size(); // Need to redo.
+	return pools_.size(); // Need to redo.
 }
 
 // If we're going to do this, should be done before the zombification.
 void Gsolve::setNumAllVoxels( unsigned int numVoxels )
 {
-    if ( numVoxels == 0 )
-    {
-        return;
-    }
-    pools_.resize( numVoxels );
-    sys_.isReady = false;
+	if ( numVoxels == 0 ) {
+		return;
+	}
+	pools_.resize( numVoxels );
+	sys_.isReady = false;
 }
 
 vector< double > Gsolve::getNvec( unsigned int voxel) const
 {
-    static vector< double > dummy;
-    if ( voxel < pools_.size() )
-    {
-        return const_cast< GssaVoxelPools* >( &( pools_[ voxel ]) )->Svec();
-    }
-    return dummy;
+	static vector< double > dummy;
+	if ( voxel < pools_.size() ) {
+		return const_cast< GssaVoxelPools* >( &( pools_[ voxel ]) )->Svec();
+	}
+	return dummy;
 }
 
 void Gsolve::setNvec( unsigned int voxel, vector< double > nVec )
 {
-    if ( voxel < pools_.size() )
-    {
-        if ( nVec.size() != pools_[voxel].size() )
-        {
-            cout << "Warning: Gsolve::setNvec: size mismatch ( " <<
-                 nVec.size() << ", " << pools_[voxel].size() << ")\n";
-            return;
-        }
-        double* s = pools_[voxel].varS();
-        for ( unsigned int i = 0; i < nVec.size(); ++i )
-        {
-            s[i] = round( nVec[i] );
-            if ( s[i] < 0.0 )
-                s[i] = 0.0;
-        }
-        if ( sys_.isReady )
-            pools_[voxel].refreshAtot( &sys_ );
-    }
+	if ( voxel < pools_.size() ) {
+		if ( nVec.size() != pools_[voxel].size() ) {
+			cout << "Warning: Gsolve::setNvec: size mismatch ( " <<
+				nVec.size() << ", " << pools_[voxel].size() << ")\n";
+			return;
+		}
+		double* s = pools_[voxel].varS();
+		for ( unsigned int i = 0; i < nVec.size(); ++i ) {
+			s[i] = round( nVec[i] );
+			if ( s[i] < 0.0 ) 
+				s[i] = 0.0;
+		}
+		if ( sys_.isReady )
+			pools_[voxel].refreshAtot( &sys_ );
+	}
 }
 
 vector< unsigned int > Gsolve::getNumFire( unsigned int voxel) const
 {
-    static vector< unsigned int > dummy;
-    if ( voxel < pools_.size() )
-    {
-        return const_cast< GssaVoxelPools* >( &( pools_[ voxel ]) )->numFire();
-    }
-    return dummy;
+	static vector< unsigned int > dummy;
+	if ( voxel < pools_.size() ) {
+		return const_cast< GssaVoxelPools* >( &( pools_[ voxel ]) )->numFire();
+	}
+	return dummy;
 }
 
 
 bool Gsolve::getRandInit() const
 {
-    return sys_.useRandInit;
+	return sys_.useRandInit;
 }
 
 void Gsolve::setRandInit( bool val )
 {
-    sys_.useRandInit = val;
+	sys_.useRandInit = val;
 }
 
 bool Gsolve::getClockedUpdate() const
 {
-    return useClockedUpdate_;
+	return useClockedUpdate_;
 }
 
 void Gsolve::setClockedUpdate( bool val )
 {
-    useClockedUpdate_ = val;
+	useClockedUpdate_ = val;
 }
 
 //////////////////////////////////////////////////////////////
@@ -385,143 +367,122 @@ void Gsolve::setClockedUpdate( bool val )
 //////////////////////////////////////////////////////////////
 void Gsolve::process( const Eref& e, ProcPtr p )
 {
-    // cout << stoichPtr_ << "	dsolve = " <<	dsolvePtr_ << endl;
-    if ( !stoichPtr_ )
-        return;
-
-    // First, handle incoming diffusion values. Note potential for
-    // issues with roundoff if diffusion is not integral.
-    if ( dsolvePtr_ )
-    {
-        vector< double > dvalues( 4 );
-        dvalues[0] = 0;
-        dvalues[1] = getNumLocalVoxels();
-        dvalues[2] = 0;
-        dvalues[3] = stoichPtr_->getNumVarPools();
-        dsolvePtr_->getBlock( dvalues );
-
-        // Here we need to convert to integers, just in case. Normally
-        // one would use a stochastic (integral) diffusion method with
-        // the GSSA, but in mixed models it may be more complicated.
-        vector< double >::iterator i = dvalues.begin() + 4;
-
-        for ( ; i != dvalues.end(); ++i )
-        {
-            //	cout << *i << "	" << round( *i ) << "		";
+	// cout << stoichPtr_ << "	dsolve = " <<	dsolvePtr_ << endl;
+	if ( !stoichPtr_ )
+		return;
+	// First, handle incoming diffusion values. Note potential for
+	// issues with roundoff if diffusion is not integral.
+	if ( dsolvePtr_ ) {
+		vector< double > dvalues( 4 );
+		dvalues[0] = 0;
+		dvalues[1] = getNumLocalVoxels();
+		dvalues[2] = 0;
+		dvalues[3] = stoichPtr_->getNumVarPools();
+		dsolvePtr_->getBlock( dvalues );
+		// Here we need to convert to integers, just in case. Normally
+		// one would use a stochastic (integral) diffusion method with 
+		// the GSSA, but in mixed models it may be more complicated.
+		vector< double >::iterator i = dvalues.begin() + 4;
+		for ( ; i != dvalues.end(); ++i ) {
+		//	cout << *i << "	" << round( *i ) << "		";
 #if SIMPLE_ROUNDING
-            *i = round( *i );
+			*i = round( *i );
 #else
-            double base = floor( *i );
-            if ( mtrand() >= (*i - base) )
-                *i = base;
-            else
-                *i = base + 1.0;
+			double base = floor( *i );
+			if ( mtrand() > *i - base )
+				*i = base;
+			else
+				*i = base + 1.0;
 #endif
-        }
-        setBlock( dvalues );
-    }
-    // Second, take the arrived xCompt reac values and update S with them.
-    // Here the roundoff issues are handled by the GssaVoxelPools functions
-    for ( unsigned int i = 0; i < xfer_.size(); ++i )
-    {
-        XferInfo& xf = xfer_[i];
-        // cout << xfer_.size() << "	" << xf.xferVoxel.size() << endl;
-        for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j )
-        {
-            pools_[xf.xferVoxel[j]].xferIn( xf, j, &sys_ );
-        }
-    }
-    // Third, record the current value of pools as the reference for the
-    // next cycle.
-    for ( unsigned int i = 0; i < xfer_.size(); ++i )
-    {
-        XferInfo& xf = xfer_[i];
-        for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j )
-        {
-            pools_[xf.xferVoxel[j]].xferOut( j, xf.lastValues, xf.xferPoolIdx );
-        }
-    }
-
-    // Fourth: Fix the rates if we have had any diffusion or xreacs
-    // happening. This is very inefficient at this point, need to fix.
-    if ( dsolvePtr_ || xfer_.size() > 0 )
-    {
-        for ( vector< GssaVoxelPools >::iterator
-                i = pools_.begin(); i != pools_.end(); ++i )
-        {
-            i->refreshAtot( &sys_ );
-        }
-    }
-    // Fifth, update the mol #s.
-    // First we advance the simulation.
-    for ( vector< GssaVoxelPools >::iterator
-            i = pools_.begin(); i != pools_.end(); ++i )
-    {
-        i->advance( p, &sys_ );
-    }
-    if ( useClockedUpdate_ )   // Check if a clocked stim is to be updated
-    {
-        for ( vector< GssaVoxelPools >::iterator
-                i = pools_.begin(); i != pools_.end(); ++i )
-        {
-            i->recalcTime( &sys_, p->currTime );
-        }
-    }
-
-    // Finally, assemble and send the integrated values off for the Dsolve.
-    if ( dsolvePtr_ )
-    {
-        vector< double > kvalues( 4 );
-        kvalues[0] = 0;
-        kvalues[1] = getNumLocalVoxels();
-        kvalues[2] = 0;
-        kvalues[3] = stoichPtr_->getNumVarPools();
-        getBlock( kvalues );
-        dsolvePtr_->setBlock( kvalues );
-    }
+		}
+		setBlock( dvalues );
+	}
+	// Second, take the arrived xCompt reac values and update S with them.
+	// Here the roundoff issues are handled by the GssaVoxelPools functions
+	for ( unsigned int i = 0; i < xfer_.size(); ++i ) {
+		XferInfo& xf = xfer_[i];
+		// cout << xfer_.size() << "	" << xf.xferVoxel.size() << endl;
+		for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j ) {
+			pools_[xf.xferVoxel[j]].xferIn( xf, j, &sys_ );
+		}
+	}
+	// Third, record the current value of pools as the reference for the
+	// next cycle.
+	for ( unsigned int i = 0; i < xfer_.size(); ++i ) {
+		XferInfo& xf = xfer_[i];
+		for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j ) {
+			pools_[xf.xferVoxel[j]].xferOut( j, xf.lastValues, xf.xferPoolIdx );
+		}
+	}
+
+	// Fourth: Fix the rates if we have had any diffusion or xreacs 
+	// happening. This is very inefficient at this point, need to fix.
+	if ( dsolvePtr_ || xfer_.size() > 0 ) {
+		for ( vector< GssaVoxelPools >::iterator 
+					i = pools_.begin(); i != pools_.end(); ++i ) {
+			i->refreshAtot( &sys_ );
+		}
+	}
+	// Fifth, update the mol #s.
+	// First we advance the simulation.
+	for ( vector< GssaVoxelPools >::iterator 
+					i = pools_.begin(); i != pools_.end(); ++i ) {
+		i->advance( p, &sys_ );
+	}
+	if ( useClockedUpdate_ ) { // Check if a clocked stim is to be updated
+		for ( vector< GssaVoxelPools >::iterator 
+					i = pools_.begin(); i != pools_.end(); ++i ) {
+			i->recalcTime( &sys_, p->currTime );
+		}
+	} 
+
+	// Finally, assemble and send the integrated values off for the Dsolve.
+	if ( dsolvePtr_ ) {
+		vector< double > kvalues( 4 );
+		kvalues[0] = 0;
+		kvalues[1] = getNumLocalVoxels();
+		kvalues[2] = 0;
+		kvalues[3] = stoichPtr_->getNumVarPools();
+		getBlock( kvalues );
+		dsolvePtr_->setBlock( kvalues );
+	}
 }
 
 void Gsolve::reinit( const Eref& e, ProcPtr p )
 {
-    if ( !stoichPtr_ )
-        return;
-    if ( !sys_.isReady )
-        rebuildGssaSystem();
-    // First reinit concs.
-    for ( vector< GssaVoxelPools >::iterator
-            i = pools_.begin(); i != pools_.end(); ++i )
-    {
-        i->reinit( &sys_ );
-    }
-
-    // Second, take the arrived xCompt reac values and update S with them.
-    // Here the roundoff issues are handled by the GssaVoxelPools functions
-    for ( unsigned int i = 0; i < xfer_.size(); ++i )
-    {
-        const XferInfo& xf = xfer_[i];
-        for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j )
-        {
-            pools_[xf.xferVoxel[j]].xferInOnlyProxies(
-                xf.xferPoolIdx, xf.values,
-                stoichPtr_->getNumProxyPools(), j );
-        }
-    }
-    // Third, record the current value of pools as the reference for the
-    // next cycle.
-    for ( unsigned int i = 0; i < xfer_.size(); ++i )
-    {
-        XferInfo& xf = xfer_[i];
-        for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j )
-        {
-            pools_[xf.xferVoxel[j]].xferOut( j, xf.lastValues, xf.xferPoolIdx );
-        }
-    }
-    // Fourth, update the atots.
-    for ( vector< GssaVoxelPools >::iterator
-            i = pools_.begin(); i != pools_.end(); ++i )
-    {
-        i->refreshAtot( &sys_ );
-    }
+	if ( !stoichPtr_ )
+		return;
+	if ( !sys_.isReady )
+		rebuildGssaSystem();
+	// First reinit concs.
+	for ( vector< GssaVoxelPools >::iterator 
+					i = pools_.begin(); i != pools_.end(); ++i ) {
+		i->reinit( &sys_ );
+	}
+	
+	// Second, take the arrived xCompt reac values and update S with them.
+	// Here the roundoff issues are handled by the GssaVoxelPools functions
+	for ( unsigned int i = 0; i < xfer_.size(); ++i ) {
+		const XferInfo& xf = xfer_[i];
+		for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j ) {
+			pools_[xf.xferVoxel[j]].xferInOnlyProxies( 
+					xf.xferPoolIdx, xf.values, 
+					stoichPtr_->getNumProxyPools(), j );
+		}
+	}
+	// Third, record the current value of pools as the reference for the
+	// next cycle.
+	for ( unsigned int i = 0; i < xfer_.size(); ++i ) {
+		XferInfo& xf = xfer_[i];
+		for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j ) {
+			pools_[xf.xferVoxel[j]].xferOut( j, xf.lastValues, xf.xferPoolIdx );
+		}
+	}
+	// Fourth, update the atots.
+	for ( vector< GssaVoxelPools >::iterator 
+					i = pools_.begin(); i != pools_.end(); ++i ) {
+		i->refreshAtot( &sys_ );
+	}
 }
 
 //////////////////////////////////////////////////////////////
@@ -529,46 +490,41 @@ void Gsolve::reinit( const Eref& e, ProcPtr p )
 //////////////////////////////////////////////////////////////
 void Gsolve::initProc( const Eref& e, ProcPtr p )
 {
-    if ( !stoichPtr_ )
-        return;
-    // vector< vector< double > > values( xfer_.size() );
-    for ( unsigned int i = 0; i < xfer_.size(); ++i )
-    {
-        XferInfo& xf = xfer_[i];
-        unsigned int size = xf.xferPoolIdx.size() * xf.xferVoxel.size();
-        // values[i].resize( size, 0.0 );
-        vector< double > values( size, 0.0 );
-        for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j )
-        {
-            unsigned int vox = xf.xferVoxel[j];
-            pools_[vox].xferOut( j, values, xf.xferPoolIdx );
-        }
-        xComptOut()->sendTo( e, xf.ksolve, e.id(), values );
-    }
+	if ( !stoichPtr_ )
+		return;
+	// vector< vector< double > > values( xfer_.size() );
+	for ( unsigned int i = 0; i < xfer_.size(); ++i ) {
+		XferInfo& xf = xfer_[i];
+		unsigned int size = xf.xferPoolIdx.size() * xf.xferVoxel.size();
+		// values[i].resize( size, 0.0 );
+		vector< double > values( size, 0.0 );
+		for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j ) {
+			unsigned int vox = xf.xferVoxel[j];
+			pools_[vox].xferOut( j, values, xf.xferPoolIdx );
+		}
+		xComptOut()->sendTo( e, xf.ksolve, e.id(), values );
+	}
 }
 
 void Gsolve::initReinit( const Eref& e, ProcPtr p )
 {
-    if ( !stoichPtr_ )
-        return;
-    for ( unsigned int i = 0 ; i < pools_.size(); ++i )
-    {
-        pools_[i].reinit( &sys_ );
-    }
-    // vector< vector< double > > values( xfer_.size() );
-    for ( unsigned int i = 0; i < xfer_.size(); ++i )
-    {
-        XferInfo& xf = xfer_[i];
-        unsigned int size = xf.xferPoolIdx.size() * xf.xferVoxel.size();
-        xf.lastValues.assign( size, 0.0 );
-        for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j )
-        {
-            unsigned int vox = xf.xferVoxel[j];
-            pools_[ vox ].xferOut( j, xf.lastValues, xf.xferPoolIdx );
-            // values[i] = xf.lastValues;
-        }
-        xComptOut()->sendTo( e, xf.ksolve, e.id(), xf.lastValues );
-    }
+	if ( !stoichPtr_ )
+		return;
+	for ( unsigned int i = 0 ; i < pools_.size(); ++i ) {
+		pools_[i].reinit( &sys_ );
+	}
+	// vector< vector< double > > values( xfer_.size() );
+	for ( unsigned int i = 0; i < xfer_.size(); ++i ) {
+		XferInfo& xf = xfer_[i];
+		unsigned int size = xf.xferPoolIdx.size() * xf.xferVoxel.size();
+		xf.lastValues.assign( size, 0.0 );
+		for ( unsigned int j = 0; j < xf.xferVoxel.size(); ++j ) {
+			unsigned int vox = xf.xferVoxel[j];
+			pools_[ vox ].xferOut( j, xf.lastValues, xf.xferPoolIdx );
+			// values[i] = xf.lastValues;
+		}
+		xComptOut()->sendTo( e, xf.ksolve, e.id(), xf.lastValues );
+	}
 }
 //////////////////////////////////////////////////////////////
 // Solver setup
@@ -576,28 +532,26 @@ void Gsolve::initReinit( const Eref& e, ProcPtr p )
 
 void Gsolve::rebuildGssaSystem()
 {
-    stoichPtr_->convertRatesToStochasticForm();
-    sys_.transposeN = stoichPtr_->getStoichiometryMatrix();
-    sys_.transposeN.transpose();
-    sys_.transposeN.truncateRow( stoichPtr_->getNumVarPools() + stoichPtr_->getNumProxyPools() );
-    vector< vector< unsigned int > > & dep = sys_.dependency;
-    dep.resize( stoichPtr_->getNumRates() );
-    for ( unsigned int i = 0; i < stoichPtr_->getNumRates(); ++i )
-    {
-        sys_.transposeN.getGillespieDependence( i, dep[i] );
-    }
-    fillMmEnzDep();
-    fillPoolFuncDep();
-    fillIncrementFuncDep();
-    makeReacDepsUnique();
-    for ( vector< GssaVoxelPools >::iterator
-            i = pools_.begin(); i != pools_.end(); ++i )
-    {
-        i->setNumReac( stoichPtr_->getNumRates() );
-        i->updateAllRateTerms( stoichPtr_->getRateTerms(),
-                               stoichPtr_->getNumCoreRates() );
-    }
-    sys_.isReady = true;
+	stoichPtr_->convertRatesToStochasticForm();
+	sys_.transposeN = stoichPtr_->getStoichiometryMatrix();
+	sys_.transposeN.transpose();
+	sys_.transposeN.truncateRow( stoichPtr_->getNumVarPools() + stoichPtr_->getNumProxyPools() );
+	vector< vector< unsigned int > > & dep = sys_.dependency;
+	dep.resize( stoichPtr_->getNumRates() );
+	for ( unsigned int i = 0; i < stoichPtr_->getNumRates(); ++i ) {
+		sys_.transposeN.getGillespieDependence( i, dep[i] );
+	}
+	fillMmEnzDep();
+	fillPoolFuncDep();
+	fillIncrementFuncDep();
+	makeReacDepsUnique();
+	for ( vector< GssaVoxelPools >::iterator 
+					i = pools_.begin(); i != pools_.end(); ++i ) {
+		i->setNumReac( stoichPtr_->getNumRates() );
+		i->updateAllRateTerms( stoichPtr_->getRateTerms(), 
+						stoichPtr_->getNumCoreRates() );
+	}
+	sys_.isReady = true;
 }
 
 /**
@@ -608,48 +562,44 @@ void Gsolve::rebuildGssaSystem()
  */
 void Gsolve::fillMmEnzDep()
 {
-    unsigned int numRates = stoichPtr_->getNumRates();
-    vector< unsigned int > indices;
-
-    // Make a map to look up enzyme RateTerm using
-    // the key of the enzyme molecule.
-    map< unsigned int, unsigned int > enzMolMap;
-    for ( unsigned int i = 0; i < numRates; ++i )
-    {
-        const MMEnzymeBase* mme = dynamic_cast< const MMEnzymeBase* >(
-                                      stoichPtr_->rates( i ) );
-        if ( mme )
-        {
-            vector< unsigned int > reactants;
-            mme->getReactants( reactants );
-            if ( reactants.size() > 1 )
-                enzMolMap[ reactants.front() ] = i; // front is enzyme.
-        }
-    }
-
-    // Use the map to fill in deps.
-    for ( unsigned int i = 0; i < numRates; ++i )
-    {
-        // Extract the row of all molecules that depend on the reac.
-        const int* entry;
-        const unsigned int* colIndex;
-
-        unsigned int numInRow =
-            sys_.transposeN.getRow( i, &entry, &colIndex );
-        for( unsigned int j = 0; j < numInRow; ++j )
-        {
-            map< unsigned int, unsigned int >::iterator pos =
-                enzMolMap.find( colIndex[j] );
-            if ( pos != enzMolMap.end() )
-                sys_.dependency[i].push_back( pos->second );
-        }
-    }
+	unsigned int numRates = stoichPtr_->getNumRates();
+	vector< unsigned int > indices;
+
+	// Make a map to look up enzyme RateTerm using 
+	// the key of the enzyme molecule.
+	map< unsigned int, unsigned int > enzMolMap;
+	for ( unsigned int i = 0; i < numRates; ++i ) {
+		const MMEnzymeBase* mme = dynamic_cast< const MMEnzymeBase* >(
+			stoichPtr_->rates( i ) );
+		if ( mme ) {
+			vector< unsigned int > reactants;
+			mme->getReactants( reactants );
+			if ( reactants.size() > 1 )
+				enzMolMap[ reactants.front() ] = i; // front is enzyme.
+		}
+	}
+
+	// Use the map to fill in deps.
+	for ( unsigned int i = 0; i < numRates; ++i ) {
+		// Extract the row of all molecules that depend on the reac.
+		const int* entry;
+		const unsigned int* colIndex;
+
+		unsigned int numInRow = 
+				sys_.transposeN.getRow( i, &entry, &colIndex );
+		for( unsigned int j = 0; j < numInRow; ++j ) {
+			map< unsigned int, unsigned int >::iterator pos = 
+				enzMolMap.find( colIndex[j] );
+			if ( pos != enzMolMap.end() )
+				sys_.dependency[i].push_back( pos->second );
+		}
+	}
 }
 
 /**
  * Here we fill in the dependencies involving poolFuncs. These are
  * the functions that evaluate an expression and assign directly to the
- * # of a target molecule.
+ * # of a target molecule. 
  * There are two dependencies:
  * 1. When a reaction fires, all the Functions that depend on the reactants
  * must update their target molecule. This is in sys_.dependentMathExpn[].
@@ -659,59 +609,55 @@ void Gsolve::fillMmEnzDep()
  */
 void Gsolve::fillPoolFuncDep()
 {
-    // create map of funcs that depend on specified molecule.
-    vector< vector< unsigned int > > funcMap(
-        stoichPtr_->getNumAllPools() );
-    unsigned int numFuncs = stoichPtr_->getNumFuncs();
-    for ( unsigned int i = 0; i < numFuncs; ++i )
-    {
-        const FuncTerm *f = stoichPtr_->funcs( i );
-        vector< unsigned int > molIndex = f->getReactantIndex();
-        for ( unsigned int j = 0; j < molIndex.size(); ++j )
-            funcMap[ molIndex[j] ].push_back( i );
-    }
-    // The output of each func is a mol indexed as
-    // numVarMols + numBufMols + i
-    unsigned int numRates = stoichPtr_->getNumRates();
-    sys_.dependentMathExpn.resize( numRates );
-    vector< unsigned int > indices;
-    for ( unsigned int i = 0; i < numRates; ++i )
-    {
-        vector< unsigned int >& dep = sys_.dependentMathExpn[ i ];
-        dep.resize( 0 );
-        // Extract the row of all molecules that depend on the reac.
-        const int* entry;
-        const unsigned int* colIndex;
-        unsigned int numInRow =
-            sys_.transposeN.getRow( i, &entry, &colIndex );
-        for ( unsigned int j = 0; j < numInRow; ++j )
-        {
-            unsigned int molIndex = colIndex[j];
-            vector< unsigned int >& funcs = funcMap[ molIndex ];
-            dep.insert( dep.end(), funcs.begin(), funcs.end() );
-            for ( unsigned int k = 0; k < funcs.size(); ++k )
-            {
-                // unsigned int outputMol = funcs[k] + funcOffset;
-                unsigned int outputMol = stoichPtr_->funcs( funcs[k] )->getTarget();
-                // Insert reac deps here. Columns are reactions.
-                vector< int > e; // Entries: we don't need.
-                vector< unsigned int > c; // Column index: the reactions.
-                stoichPtr_->getStoichiometryMatrix().
-                getRow( outputMol, e, c );
-                // Each of the reacs (col entries) depend on this func.
-                vector< unsigned int > rdep = sys_.dependency[i];
-                rdep.insert( rdep.end(), c.begin(), c.end() );
-            }
-        }
-    }
+	// create map of funcs that depend on specified molecule.
+	vector< vector< unsigned int > > funcMap( 
+			stoichPtr_->getNumAllPools() );
+	unsigned int numFuncs = stoichPtr_->getNumFuncs();
+	for ( unsigned int i = 0; i < numFuncs; ++i ) {
+		const FuncTerm *f = stoichPtr_->funcs( i );
+		vector< unsigned int > molIndex = f->getReactantIndex();
+		for ( unsigned int j = 0; j < molIndex.size(); ++j )
+			funcMap[ molIndex[j] ].push_back( i );
+	}
+	// The output of each func is a mol indexed as 
+	// numVarMols + numBufMols + i
+	unsigned int numRates = stoichPtr_->getNumRates();
+	sys_.dependentMathExpn.resize( numRates );
+	vector< unsigned int > indices;
+	for ( unsigned int i = 0; i < numRates; ++i ) {
+		vector< unsigned int >& dep = sys_.dependentMathExpn[ i ];
+		dep.resize( 0 );
+		// Extract the row of all molecules that depend on the reac.
+		const int* entry;
+		const unsigned int* colIndex;
+		unsigned int numInRow = 
+				sys_.transposeN.getRow( i, &entry, &colIndex );
+		for ( unsigned int j = 0; j < numInRow; ++j ) {
+			unsigned int molIndex = colIndex[j];
+			vector< unsigned int >& funcs = funcMap[ molIndex ];
+			dep.insert( dep.end(), funcs.begin(), funcs.end() );
+			for ( unsigned int k = 0; k < funcs.size(); ++k ) {
+				// unsigned int outputMol = funcs[k] + funcOffset;
+				unsigned int outputMol = stoichPtr_->funcs( funcs[k] )->getTarget();
+				// Insert reac deps here. Columns are reactions.
+				vector< int > e; // Entries: we don't need.
+				vector< unsigned int > c; // Column index: the reactions.
+				stoichPtr_->getStoichiometryMatrix().
+						getRow( outputMol, e, c );
+				// Each of the reacs (col entries) depend on this func.
+				vector< unsigned int > rdep = sys_.dependency[i];
+				rdep.insert( rdep.end(), c.begin(), c.end() );
+			}
+		}
+	}
 }
 
 /**
  * Here we fill in the dependencies involving incrementFuncs. These are
  * the functions that evaluate an expression that specifies rate of change
- * of # of a target molecule.
+ * of # of a target molecule. 
  * There are two dependencies:
- * 1. When a reaction fires, all the incrementFuncs that depend on the
+ * 1. When a reaction fires, all the incrementFuncs that depend on the 
  * reactants must update their rates. This is added to sys_.dependency[]
  * which is the usual handler for reac dependencies. Note that the inputs
  * to the incrementFuncs are NOT present in the stoichiometry matrix, so
@@ -722,67 +668,62 @@ void Gsolve::fillPoolFuncDep()
  */
 void Gsolve::fillIncrementFuncDep()
 {
-    // create map of funcs that depend on specified molecule.
-    vector< vector< unsigned int > > funcMap(
-        stoichPtr_->getNumAllPools() );
-    const vector< RateTerm* >& rates = stoichPtr_->getRateTerms();
-    vector< FuncRate* > incrementRates;
-    vector< unsigned int > incrementRateIndex;
-    const vector< RateTerm* >::const_iterator q;
-    for ( unsigned int i = 0; i < rates.size(); ++i )
-    {
-        FuncRate *term =
-            dynamic_cast< FuncRate* >( rates[i] );
-        if (term)
-        {
-            incrementRates.push_back( term );
-            incrementRateIndex.push_back( i );
-        }
-    }
-
-    for ( unsigned int k = 0; k < incrementRates.size(); ++k )
-    {
-        const vector< unsigned int >& molIndex =
-            incrementRates[k]->getFuncArgIndex();
-        for ( unsigned int j = 0; j < molIndex.size(); ++j )
-            funcMap[ molIndex[j] ].push_back( incrementRateIndex[k] );
-    }
-
-    unsigned int numRates = stoichPtr_->getNumRates();
-    sys_.dependentMathExpn.resize( numRates );
-    vector< unsigned int > indices;
-    for ( unsigned int i = 0; i < numRates; ++i )
-    {
-        // Algorithm:
-        // 1.Go through stoich matrix finding all the poolIndices affected
-        // by each Rate Term.
-        // 2.Use funcMap to look up FuncRateTerms affected by these indices
-        // 3. Add the rateTerm->FuncRateTerm mapping to the dependencies.
-
-        const int* entry;
-        const unsigned int* colIndex;
-        unsigned int numInRow =
-            sys_.transposeN.getRow( i, &entry, &colIndex );
-        // 1.Go through stoich matrix finding all the poolIndices affected
-        // by each Rate Term.
-        for ( unsigned int j = 0; j < numInRow; ++j )
-        {
-            unsigned int molIndex = colIndex[j]; // Affected poolIndex
-
-            // 2.Use funcMap to look up FuncRateTerms affected by these indices
-            vector< unsigned int >& funcs = funcMap[ molIndex ];
-            // 3. Add the rateTerm->FuncRateTerm mapping to the dependencies.
-            vector< unsigned int >& rdep = sys_.dependency[i];
-            rdep.insert( rdep.end(), funcs.begin(), funcs.end() );
-        }
-    }
+	// create map of funcs that depend on specified molecule.
+	vector< vector< unsigned int > > funcMap( 
+			stoichPtr_->getNumAllPools() );
+	const vector< RateTerm* >& rates = stoichPtr_->getRateTerms();
+	vector< FuncRate* > incrementRates;
+	vector< unsigned int > incrementRateIndex;
+	const vector< RateTerm* >::const_iterator q;
+	for ( unsigned int i = 0; i < rates.size(); ++i ) {
+		FuncRate *term = 
+			dynamic_cast< FuncRate* >( rates[i] );
+		if (term) {
+			incrementRates.push_back( term );
+			incrementRateIndex.push_back( i );
+		}
+	}
+
+	for ( unsigned int k = 0; k < incrementRates.size(); ++k ) {
+		const vector< unsigned int >& molIndex = 
+				incrementRates[k]->getFuncArgIndex();
+		for ( unsigned int j = 0; j < molIndex.size(); ++j )
+			funcMap[ molIndex[j] ].push_back( incrementRateIndex[k] );
+	}
+		
+	unsigned int numRates = stoichPtr_->getNumRates();
+	sys_.dependentMathExpn.resize( numRates );
+	vector< unsigned int > indices;
+	for ( unsigned int i = 0; i < numRates; ++i ) {
+		// Algorithm:
+		// 1.Go through stoich matrix finding all the poolIndices affected
+		// by each Rate Term.
+		// 2.Use funcMap to look up FuncRateTerms affected by these indices
+		// 3. Add the rateTerm->FuncRateTerm mapping to the dependencies.
+
+		const int* entry;
+		const unsigned int* colIndex;
+		unsigned int numInRow = 
+				sys_.transposeN.getRow( i, &entry, &colIndex );
+		// 1.Go through stoich matrix finding all the poolIndices affected
+		// by each Rate Term.
+		for ( unsigned int j = 0; j < numInRow; ++j ) { 
+			unsigned int molIndex = colIndex[j]; // Affected poolIndex
+
+		// 2.Use funcMap to look up FuncRateTerms affected by these indices
+			vector< unsigned int >& funcs = funcMap[ molIndex ];
+		// 3. Add the rateTerm->FuncRateTerm mapping to the dependencies.
+			vector< unsigned int >& rdep = sys_.dependency[i];
+			rdep.insert( rdep.end(), funcs.begin(), funcs.end() );
+		}
+	}
 }
 
 /*
 void Gsolve::fillMathDep()
 {
 	// create map of funcs that depend on specified molecule.
-	vector< vector< unsigned int > > funcMap(
+	vector< vector< unsigned int > > funcMap( 
 			stoichPtr_->getNumAllPools() );
 	unsigned int numFuncs = stoichPtr_->getNumFuncs();
 	for ( unsigned int i = 0; i < numFuncs; ++i ) {
@@ -791,9 +732,9 @@ void Gsolve::fillMathDep()
 		for ( unsigned int j = 0; j < molIndex.size(); ++j )
 			funcMap[ molIndex[j] ].push_back( i );
 	}
-	// The output of each func is a mol indexed as
+	// The output of each func is a mol indexed as 
 	// numVarMols + numBufMols + i
-	unsigned int funcOffset =
+	unsigned int funcOffset = 
 			stoichPtr_->getNumVarPools() + stoichPtr_->getNumProxyPools() + stoichPtr_->getNumBufPools();
 	unsigned int numRates = stoichPtr_->getNumRates();
 	sys_.dependentMathExpn.resize( numRates );
@@ -804,7 +745,7 @@ void Gsolve::fillMathDep()
 		// Extract the row of all molecules that depend on the reac.
 		const int* entry;
 		const unsigned int* colIndex;
-		unsigned int numInRow =
+		unsigned int numInRow = 
 				sys_.transposeN.getRow( i, &entry, &colIndex );
 		for ( unsigned int j = 0; j < numInRow; ++j ) {
 			unsigned int molIndex = colIndex[j];
@@ -832,39 +773,38 @@ void Gsolve::fillMathDep()
  * Later.
  */
 void Gsolve::insertMathDepReacs( unsigned int mathDepIndex,
-                                 unsigned int firedReac )
+	unsigned int firedReac )
 {
-    /*
-    unsigned int molIndex = sumTotals_[ mathDepIndex ].target( S_ );
-    vector< unsigned int > reacIndices;
-
-    // Extract the row of all reacs that depend on the target molecule
-    if ( N_.getRowIndices( molIndex, reacIndices ) > 0 ) {
-    	vector< unsigned int >& dep = dependency_[ firedReac ];
-    	dep.insert( dep.end(), reacIndices.begin(), reacIndices.end() );
-    }
-    */
+	/*
+	unsigned int molIndex = sumTotals_[ mathDepIndex ].target( S_ );
+	vector< unsigned int > reacIndices;
+
+	// Extract the row of all reacs that depend on the target molecule
+	if ( N_.getRowIndices( molIndex, reacIndices ) > 0 ) {
+		vector< unsigned int >& dep = dependency_[ firedReac ];
+		dep.insert( dep.end(), reacIndices.begin(), reacIndices.end() );
+	}
+	*/
 }
 
 // Clean up dependency lists: Ensure only unique entries.
 // Also a reac cannot depend on itself.
 void Gsolve::makeReacDepsUnique()
 {
-    unsigned int numRates = stoichPtr_->getNumRates();
-    for ( unsigned int i = 0; i < numRates; ++i )
-    {
-        vector< unsigned int >& dep = sys_.dependency[ i ];
-        // Here we want to remove self-entries as well as duplicates.
-        sort( dep.begin(), dep.end() );
-        vector< unsigned int >::iterator k = dep.begin();
-
-        /// STL stuff follows, with the usual weirdness.
-        vector< unsigned int >::iterator pos =
-            unique( dep.begin(), dep.end() );
-        dep.resize( pos - dep.begin() );
-        /*
-        */
-    }
+	unsigned int numRates = stoichPtr_->getNumRates();
+	for ( unsigned int i = 0; i < numRates; ++i ) {
+		vector< unsigned int >& dep = sys_.dependency[ i ];
+		// Here we want to remove self-entries as well as duplicates.
+		sort( dep.begin(), dep.end() );
+		vector< unsigned int >::iterator k = dep.begin();
+
+		/// STL stuff follows, with the usual weirdness.
+		vector< unsigned int >::iterator pos = 
+			unique( dep.begin(), dep.end() );
+		dep.resize( pos - dep.begin() );
+		/*
+		*/
+	}
 }
 
 //////////////////////////////////////////////////////////////
@@ -872,36 +812,31 @@ void Gsolve::makeReacDepsUnique()
 //////////////////////////////////////////////////////////////
 unsigned int Gsolve::getPoolIndex( const Eref& e ) const
 {
-    return stoichPtr_->convertIdToPoolIndex( e.id() );
+	return stoichPtr_->convertIdToPoolIndex( e.id() );
 }
 
 unsigned int Gsolve::getVoxelIndex( const Eref& e ) const
 {
-    unsigned int ret = e.dataIndex();
-    if ( ret < startVoxel_  || ret >= startVoxel_ + pools_.size() )
-        return OFFNODE;
-    return ret - startVoxel_;
+	unsigned int ret = e.dataIndex();
+	if ( ret < startVoxel_  || ret >= startVoxel_ + pools_.size() ) 
+		return OFFNODE;
+	return ret - startVoxel_;
 }
 
 void Gsolve::setDsolve( Id dsolve )
 {
-    if ( dsolve == Id () )
-    {
-        dsolvePtr_ = 0;
-        dsolve_ = Id();
-    }
-    else if ( dsolve.element()->cinfo()->isA( "Dsolve" ) )
-    {
-        dsolve_ = dsolve;
-        dsolvePtr_ = reinterpret_cast< ZombiePoolInterface* >(
-                         dsolve.eref().data() );
-    }
-    else
-    {
-        cout << "Warning: Gsolve::setDsolve: Object '" << dsolve.path() <<
-             "' should be class Dsolve, is: " <<
-             dsolve.element()->cinfo()->name() << endl;
-    }
+	if ( dsolve == Id () ) {
+		dsolvePtr_ = 0;
+		dsolve_ = Id();
+	} else if ( dsolve.element()->cinfo()->isA( "Dsolve" ) ) {
+		dsolve_ = dsolve;
+		dsolvePtr_ = reinterpret_cast< ZombiePoolInterface* >( 
+						dsolve.eref().data() );
+	} else {
+		cout << "Warning: Gsolve::setDsolve: Object '" << dsolve.path() <<
+				"' should be class Dsolve, is: " << 
+				dsolve.element()->cinfo()->name() << endl;
+	}
 }
 
 
@@ -911,185 +846,166 @@ void Gsolve::setDsolve( Id dsolve )
 
 void Gsolve::setN( const Eref& e, double v )
 {
-    unsigned int vox = getVoxelIndex( e );
-    if ( vox != OFFNODE )
-    {
-        if ( e.element()->cinfo()->isA( "ZombieBufPool" ) )
-        {
-            // Do NOT round it here, it is folded into rate term.
-            pools_[vox].setN( getPoolIndex( e ), v );
-            // refresh rates because nInit controls ongoing value of n.
-            if ( sys_.isReady )
-                pools_[vox].refreshAtot( &sys_ );
-        }
-        else
-        {
-            pools_[vox].setN( getPoolIndex( e ), round( v ) );
-        }
-    }
+	unsigned int vox = getVoxelIndex( e );
+	if ( vox != OFFNODE ) {
+		if ( e.element()->cinfo()->isA( "ZombieBufPool" ) ) {
+			// Do NOT round it here, it is folded into rate term.
+			pools_[vox].setN( getPoolIndex( e ), v );
+			// refresh rates because nInit controls ongoing value of n.
+			if ( sys_.isReady )
+				pools_[vox].refreshAtot( &sys_ ); 
+		} else {
+			pools_[vox].setN( getPoolIndex( e ), round( v ) );
+		}
+	}
 }
 
 double Gsolve::getN( const Eref& e ) const
 {
-    unsigned int vox = getVoxelIndex( e );
-    if ( vox != OFFNODE )
-        return pools_[vox].getN( getPoolIndex( e ) );
-    return 0.0;
+	unsigned int vox = getVoxelIndex( e );
+	if ( vox != OFFNODE )
+		return pools_[vox].getN( getPoolIndex( e ) );
+	return 0.0;
 }
 
 void Gsolve::setNinit( const Eref& e, double v )
 {
-    unsigned int vox = getVoxelIndex( e );
-    if ( vox != OFFNODE )
-    {
-        if ( e.element()->cinfo()->isA( "ZombieBufPool" ) )
-        {
-            // Do NOT round it here, it is folded into rate term.
-            pools_[vox].setNinit( getPoolIndex( e ), v );
-            // refresh rates because nInit controls ongoing value of n.
-            if ( sys_.isReady )
-                pools_[vox].refreshAtot( &sys_ );
-        }
-        else
-        {
-            // I now do the rounding at reinit time. It is better there as
-            // it can give a distinct value each cycle. It is also better
-            // to keep the full resolution of Ninit for volume scaling.
-            // pools_[vox].setNinit( getPoolIndex( e ), round( v ) );
-            pools_[vox].setNinit( getPoolIndex( e ), v );
-        }
-    }
+	unsigned int vox = getVoxelIndex( e );
+	if ( vox != OFFNODE ) {
+		if ( e.element()->cinfo()->isA( "ZombieBufPool" ) ) {
+			// Do NOT round it here, it is folded into rate term.
+			pools_[vox].setNinit( getPoolIndex( e ), v );
+			// refresh rates because nInit controls ongoing value of n.
+			if ( sys_.isReady )
+				pools_[vox].refreshAtot( &sys_ ); 
+		} else {
+			// I now do the rounding at reinit time. It is better there as
+			// it can give a distinct value each cycle. It is also better
+			// to keep the full resolution of Ninit for volume scaling.
+			// pools_[vox].setNinit( getPoolIndex( e ), round( v ) );
+			pools_[vox].setNinit( getPoolIndex( e ), v );
+		}
+	}
 }
 
 double Gsolve::getNinit( const Eref& e ) const
 {
-    unsigned int vox = getVoxelIndex( e );
-    if ( vox != OFFNODE )
-        return pools_[vox].getNinit( getPoolIndex( e ) );
-    return 0.0;
+	unsigned int vox = getVoxelIndex( e );
+	if ( vox != OFFNODE )
+		return pools_[vox].getNinit( getPoolIndex( e ) );
+	return 0.0;
 }
 
 void Gsolve::setDiffConst( const Eref& e, double v )
 {
-    ; // Do nothing.
+		; // Do nothing.
 }
 
 double Gsolve::getDiffConst( const Eref& e ) const
 {
-    return 0;
+		return 0;
 }
 
 void Gsolve::setNumPools( unsigned int numPoolSpecies )
 {
-    sys_.isReady = false;
-    unsigned int numVoxels = pools_.size();
-    for ( unsigned int i = 0 ; i < numVoxels; ++i )
-    {
-        pools_[i].resizeArrays( numPoolSpecies );
-    }
+	sys_.isReady = false;
+	unsigned int numVoxels = pools_.size();
+	for ( unsigned int i = 0 ; i < numVoxels; ++i ) {
+		pools_[i].resizeArrays( numPoolSpecies );
+	}
 }
 
 unsigned int Gsolve::getNumPools() const
 {
-    if ( pools_.size() > 0 )
-        return pools_[0].size();
-    return 0;
+	if ( pools_.size() > 0 )
+		return pools_[0].size();
+	return 0;
 }
 
 void Gsolve::getBlock( vector< double >& values ) const
 {
-    unsigned int startVoxel = values[0];
-    unsigned int numVoxels = values[1];
-    unsigned int startPool = values[2];
-    unsigned int numPools = values[3];
-
-    assert( startVoxel >= startVoxel_ );
-    assert( numVoxels <= pools_.size() );
-    assert( pools_.size() > 0 );
-    assert( numPools + startPool <= pools_[0].size() );
-    values.resize( 4 + numVoxels * numPools );
-
-    for ( unsigned int i = 0; i < numVoxels; ++i )
-    {
-        const double* v = pools_[ startVoxel + i ].S();
-        for ( unsigned int j = 0; j < numPools; ++j )
-        {
-            values[ 4 + j * numVoxels + i]  = v[ j + startPool ];
-        }
-    }
+	unsigned int startVoxel = values[0];
+	unsigned int numVoxels = values[1];
+	unsigned int startPool = values[2];
+	unsigned int numPools = values[3];
+
+	assert( startVoxel >= startVoxel_ );
+	assert( numVoxels <= pools_.size() );
+	assert( pools_.size() > 0 );
+	assert( numPools + startPool <= pools_[0].size() );
+	values.resize( 4 + numVoxels * numPools );
+
+	for ( unsigned int i = 0; i < numVoxels; ++i ) {
+		const double* v = pools_[ startVoxel + i ].S();
+		for ( unsigned int j = 0; j < numPools; ++j ) {
+			values[ 4 + j * numVoxels + i]  = v[ j + startPool ];
+		}
+	}
 }
 
 void Gsolve::setBlock( const vector< double >& values )
 {
-    unsigned int startVoxel = values[0];
-    unsigned int numVoxels = values[1];
-    unsigned int startPool = values[2];
-    unsigned int numPools = values[3];
-
-    assert( startVoxel >= startVoxel_ );
-    assert( numVoxels <= pools_.size() );
-    assert( pools_.size() > 0 );
-    assert( numPools + startPool <= pools_[0].size() );
-
-    for ( unsigned int i = 0; i < numVoxels; ++i )
-    {
-        double* v = pools_[ startVoxel + i ].varS();
-        for ( unsigned int j = 0; j < numPools; ++j )
-        {
-            v[ j + startPool ] = values[ 4 + j * numVoxels + i ];
-        }
-    }
+	unsigned int startVoxel = values[0];
+	unsigned int numVoxels = values[1];
+	unsigned int startPool = values[2];
+	unsigned int numPools = values[3];
+
+	assert( startVoxel >= startVoxel_ );
+	assert( numVoxels <= pools_.size() );
+	assert( pools_.size() > 0 );
+	assert( numPools + startPool <= pools_[0].size() );
+
+	for ( unsigned int i = 0; i < numVoxels; ++i ) {
+		double* v = pools_[ startVoxel + i ].varS();
+		for ( unsigned int j = 0; j < numPools; ++j ) {
+			v[ j + startPool ] = values[ 4 + j * numVoxels + i ];
+		}
+	}
 }
 
 //////////////////////////////////////////////////////////////////////////
 void Gsolve::updateVoxelVol( vector< double > vols )
 {
-    // For now we assume identical numbers of voxels. Also assume
-    // identical voxel junctions. But it should not be too hard to
-    // update those too.
-    if ( vols.size() == pools_.size() )
-    {
-        for ( unsigned int i = 0; i < vols.size(); ++i )
-        {
-            pools_[i].setVolumeAndDependencies( vols[i] );
-        }
-        stoichPtr_->setupCrossSolverReacVols();
-        updateRateTerms( ~0U );
-    }
+	// For now we assume identical numbers of voxels. Also assume
+	// identical voxel junctions. But it should not be too hard to
+	// update those too.
+	if ( vols.size() == pools_.size() ) {
+		for ( unsigned int i = 0; i < vols.size(); ++i ) {
+			pools_[i].setVolumeAndDependencies( vols[i] );
+		}
+		stoichPtr_->setupCrossSolverReacVols();
+		updateRateTerms( ~0U );
+	}
 }
 
 void Gsolve::updateRateTerms( unsigned int index )
 {
-    if ( index == ~0U )
-    {
-        // unsigned int numCrossRates = stoichPtr_->getNumRates() - stoichPtr_->getNumCoreRates();
-        for ( unsigned int i = 0 ; i < pools_.size(); ++i )
-        {
-            // pools_[i].resetXreacScale( numCrossRates );
-            pools_[i].updateAllRateTerms( stoichPtr_->getRateTerms(),
-                                          stoichPtr_->getNumCoreRates() );
-        }
-    }
-    else if ( index < stoichPtr_->getNumRates() )
-    {
-        for ( unsigned int i = 0 ; i < pools_.size(); ++i )
-            pools_[i].updateRateTerms( stoichPtr_->getRateTerms(),
-                                       stoichPtr_->getNumCoreRates(), index );
-    }
+	if ( index == ~0U ) {
+		// unsigned int numCrossRates = stoichPtr_->getNumRates() - stoichPtr_->getNumCoreRates();
+		for ( unsigned int i = 0 ; i < pools_.size(); ++i ) {
+			// pools_[i].resetXreacScale( numCrossRates );
+			pools_[i].updateAllRateTerms( stoichPtr_->getRateTerms(),
+						   stoichPtr_->getNumCoreRates() );
+		}
+	} else if ( index < stoichPtr_->getNumRates() ) {
+		for ( unsigned int i = 0 ; i < pools_.size(); ++i )
+			pools_[i].updateRateTerms( stoichPtr_->getRateTerms(),
+						   stoichPtr_->getNumCoreRates(), index );
+	}
 }
 
 //////////////////////////////////////////////////////////////////////////
 
 VoxelPoolsBase* Gsolve::pools( unsigned int i )
 {
-    if ( pools_.size() > i )
-        return &pools_[i];
-    return 0;
+	if ( pools_.size() > i )
+		return &pools_[i];
+	return 0;
 }
 
 double Gsolve::volume( unsigned int i ) const
 {
-    if ( pools_.size() > i )
-        return pools_[i].getVolume();
-    return 0.0;
+	if ( pools_.size() > i )
+		return pools_[i].getVolume();
+	return 0.0;
 }
diff --git a/moose-core/ksolve/GssaVoxelPools.cpp b/moose-core/ksolve/GssaVoxelPools.cpp
index 810c9481ee376fd7f87732bad02a3ee88c2b99f3..b74900aa7bf9183474b51e4144c234bb4eaf183a 100644
--- a/moose-core/ksolve/GssaVoxelPools.cpp
+++ b/moose-core/ksolve/GssaVoxelPools.cpp
@@ -205,10 +205,10 @@ void GssaVoxelPools::advance( const ProcInfo* p, const GssaSystem* g )
 		numFire_[rindex]++;
 		
         double r = rng_.uniform();
-
-        while ( r == 0.0 )
+        while ( r <= 0.0 )
+        {
             r = rng_.uniform();
-
+        }
         t_ -= ( 1.0 / atot_ ) * log( r );
         // g->stoich->updateFuncs( varS(), t_ ); // Handled next line.
         updateDependentMathExpn( g, rindex, t_ );
@@ -234,7 +234,7 @@ void GssaVoxelPools::reinit( const GssaSystem* g )
             double base = floor( n[i] );
             assert( base >= 0.0 );
             double frac = n[i] - base;
-            if ( rng_.uniform() >= frac )
+            if ( rng_.uniform() > frac )
                 n[i] = base;
             else
                 n[i] = base + 1.0;
@@ -369,9 +369,9 @@ void GssaVoxelPools::xferIn( XferInfo& xf,
     {
         double& x = s[*k];
         // cout << x << "	i = " << *i << *j << "	m = " << *m << endl;
-        double dx = *(i++) - *(j++);
+        double dx = *i++ - *j++;
         double base = floor( dx );
-        if ( rng_.uniform() >= (dx - base) )
+        if ( rng_.uniform() > dx - base )
             x += base;
         else
             x += base + 1.0;
@@ -425,7 +425,7 @@ void GssaVoxelPools::xferInOnlyProxies(
         if ( *k >= stoichPtr_->getNumVarPools() && *k < proxyEndIndex )
         {
             double base = floor( *i );
-            if ( rng_.uniform() >= (*i - base) )
+            if ( rng_.uniform() > *i - base )
                 varSinit()[*k] = (varS()[*k] += base );
             else
                 varSinit()[*k] = (varS()[*k] += base + 1.0 );
diff --git a/moose-core/ksolve/KinSparseMatrix.cpp b/moose-core/ksolve/KinSparseMatrix.cpp
index 431fb858fd2c7ad30a7a1298e2df3c22e8fda1c6..a83e12ae75c6624ee0eb5b988b73c313350cf483 100644
--- a/moose-core/ksolve/KinSparseMatrix.cpp
+++ b/moose-core/ksolve/KinSparseMatrix.cpp
@@ -164,6 +164,21 @@ void makeVecUnique( vector< unsigned int >& v )
 	v.resize( pos - v.begin() );
 }
 
+vector< int > KinSparseMatrix::matrixEntry() const 
+{
+	return N_;
+}
+
+vector< unsigned int > KinSparseMatrix::colIndex() const
+{
+	return colIndex_;
+}
+
+vector< unsigned int > KinSparseMatrix::rowStart() const
+{
+	return rowStart_;
+}
+
 
 #ifdef DO_UNIT_TESTS
 #include "header.h"
diff --git a/moose-core/ksolve/KinSparseMatrix.h b/moose-core/ksolve/KinSparseMatrix.h
index 3d316738f63ba2e7544a65cdbde639ef78be8337..9d18c262d32f8ff147e20ab0d04fd0b79fcec787 100644
--- a/moose-core/ksolve/KinSparseMatrix.h
+++ b/moose-core/ksolve/KinSparseMatrix.h
@@ -61,6 +61,10 @@ class KinSparseMatrix: public SparseMatrix< int >
         */
         void truncateRow( unsigned int maxColumnIndex );
 
+		/// Here we expose the sparse matrix for MOOSE use.
+		vector< int > matrixEntry() const;
+		vector< unsigned int > colIndex() const;
+		vector< unsigned int > rowStart() const;
 	private:
  		/**
          * End colIndex for rows (molecules in the transposed matrix)
diff --git a/moose-core/ksolve/ZombieBufPool.cpp b/moose-core/ksolve/ZombieBufPool.cpp
index 826655299061397f79ccd60177a83c4310831960..a00a6499c7fb5a5351a48ba6270c8ed21078287c 100644
--- a/moose-core/ksolve/ZombieBufPool.cpp
+++ b/moose-core/ksolve/ZombieBufPool.cpp
@@ -72,7 +72,3 @@ void ZombieBufPool::vSetConcInit( const Eref& e, double conc )
 	vSetConc( e, conc );
 }
 
-bool ZombieBufPool::vGetIsBuffered( const Eref& e ) const
-{
-	return true;
-}
diff --git a/moose-core/ksolve/ZombieBufPool.h b/moose-core/ksolve/ZombieBufPool.h
index 6ebdf8bca32e39f69f0ea9856ce0779734239254..72d0a2006e671badde6e67bd0d0eef8e51f1c693 100644
--- a/moose-core/ksolve/ZombieBufPool.h
+++ b/moose-core/ksolve/ZombieBufPool.h
@@ -21,7 +21,6 @@ class ZombieBufPool: public ZombiePool
 		void vSetNinit( const Eref& e, double v );
 		void vSetConc( const Eref& e, double v );
 		void vSetConcInit( const Eref& e, double v );
-		bool vGetIsBuffered( const Eref& e ) const;
 
 		static const Cinfo* initCinfo();
 	private:
diff --git a/moose-core/ksolve/ZombiePool.cpp b/moose-core/ksolve/ZombiePool.cpp
index 4ab7e1f8ffc3d2ac53567f7c42dd458f964c32e8..af4a26326c4237f33e60b53d6879debc9927e98a 100644
--- a/moose-core/ksolve/ZombiePool.cpp
+++ b/moose-core/ksolve/ZombiePool.cpp
@@ -179,11 +179,6 @@ double ZombiePool::vGetVolume( const Eref& e ) const
 	return lookupVolumeFromMesh( e );
 }
 
-bool ZombiePool::vGetIsBuffered( const Eref& e ) const
-{
-	return false;
-}
-
 //////////////////////////////////////////////////////////////
 // Zombie conversion functions.
 //////////////////////////////////////////////////////////////
diff --git a/moose-core/ksolve/ZombiePool.h b/moose-core/ksolve/ZombiePool.h
index 8e9b6ddbc347b467d2790d57482098132a26870f..6771b2cebdddc8cf88f4608fe72692f69d5d4267 100644
--- a/moose-core/ksolve/ZombiePool.h
+++ b/moose-core/ksolve/ZombiePool.h
@@ -46,7 +46,6 @@ class ZombiePool: public PoolBase
 
 		void vSetMotorConst( const Eref& e, double v );
 		double vGetMotorConst( const Eref& e ) const;
-		bool vGetIsBuffered( const Eref& e ) const;
 		//////////////////////////////////////////////////////////////////
 		// Dest funcs
 		//////////////////////////////////////////////////////////////////
diff --git a/moose-core/msg/SparseMsg.cpp b/moose-core/msg/SparseMsg.cpp
index 46d3fb5e1fb4b0a3da80bb34fc7ecaf0b54c1596..44f79d135eac65ea8109b40d370e3d816af26c8e 100644
--- a/moose-core/msg/SparseMsg.cpp
+++ b/moose-core/msg/SparseMsg.cpp
@@ -42,40 +42,6 @@ const Cinfo* SparseMsg::initCinfo()
 		&SparseMsg::getNumEntries
 	);
 
-	static ValueFinfo< SparseMsg, vector< unsigned int > > connectionList(
-		"connectionList",
-		"Pairwise specification of connection matrix where each x,y value "
-		"represents a connection from src[x] to dest[y]. "
-		"The (x,y) entries are ordered in a single vector as \n"
-		"(x0, x1,... x_n-1, y0, y1,... y_n-1)\n",
-		&SparseMsg::setEntryPairs,
-		&SparseMsg::getEntryPairs
-	);
-
-    /// Connection matrix entries to manipulate in Python.
-    static ReadOnlyValueFinfo< SparseMsg, vector< unsigned int > >
-    matrixEntry(
-        "matrixEntry",
-        "The non-zero matrix entries in the sparse matrix. Their"
-        "column indices are in a separate vector and the row"
-        "informatino in a third",
-        &SparseMsg::getMatrixEntry
-    );
-    /// connection matrix column indices to manipulate in Python.
-    static ReadOnlyValueFinfo< SparseMsg, vector< unsigned int > >
-    columnIndex(
-        "columnIndex",
-        "Column Index of each matrix entry",
-        &SparseMsg::getColIndex
-    );
-    /// connection matrix rowStart to manipulate in Python.
-    static ReadOnlyValueFinfo< SparseMsg, vector< unsigned int > >
-    rowStart(
-        "rowStart",
-        "Row start for each block of entries and column indices",
-        &SparseMsg::getRowStart
-    );
-
 	static ValueFinfo< SparseMsg, double > probability(
 		"probability",
 		"connection probability for random connectivity.",
@@ -135,13 +101,6 @@ const Cinfo* SparseMsg::initCinfo()
 			vector< unsigned int >	>( 
 		&SparseMsg::tripletFill ) );
 
-	static DestFinfo tripletFill1( "tripletFill1",
-		"Single contiguous array to fill entire connection matrix using "
-		"triplets of (x,y, fieldindex) ordered as \n"
-		"(x0, x1,... xn-1, y0, y1,... yn-1, fi0, fi1,... fi_n-1)\n",
-		new OpFunc1< SparseMsg, vector< unsigned int > >( 
-		&SparseMsg::tripletFill1 ) );
-
 ////////////////////////////////////////////////////////////////////////
 // Assemble it all.
 ////////////////////////////////////////////////////////////////////////
@@ -150,10 +109,6 @@ const Cinfo* SparseMsg::initCinfo()
 		&numRows,			// readonly value
 		&numColumns,		// readonly value
 		&numEntries,		// readonly value
-		&connectionList,	// value
-        &matrixEntry,		// ReadOnlyValue
-        &columnIndex,		// ReadOnlyValue
-        &rowStart,			// ReadOnlyValue
 		&probability,		// value
 		&seed,				// value
 		&setRandomConnectivity,	// dest
@@ -163,7 +118,6 @@ const Cinfo* SparseMsg::initCinfo()
 		&transpose,			//dest
 		&pairFill,			//dest
 		&tripletFill,		//dest
-		&tripletFill1,		//dest
 	};
 
 	static Dinfo< short > dinfo;
@@ -222,43 +176,6 @@ unsigned int SparseMsg::getNumEntries() const
 	return matrix_.nEntries();
 }
 
-vector< unsigned int > SparseMsg::getMatrixEntry() const
-{
-    return matrix_.matrixEntry();
-}
-
-vector< unsigned int > SparseMsg::getColIndex() const
-{
-    return matrix_.colIndex();
-}
-
-vector< unsigned int > SparseMsg::getRowStart() const
-{
-    return matrix_.rowStart();
-}
-
-void SparseMsg::setEntryPairs( vector< unsigned int > v )
-{
-	vector< unsigned int > src( v.begin(), v.begin() + v.size()/2 );
-	vector< unsigned int > dest( v.begin() + v.size()/2, v.end() );
-	pairFill( src, dest );
-}
-
-vector< unsigned int > SparseMsg::getEntryPairs() const
-{
-	vector< unsigned int > cols = matrix_.colIndex();
-	vector< unsigned int > y;
-	for ( unsigned int row = 0; row < matrix_.nRows(); ++row ) {
-		unsigned int begin = matrix_.rowStart()[row];
-		unsigned int end = matrix_.rowStart()[row+1];
-		for ( unsigned int j = begin; j < end; ++j )
-			y.push_back( row );
-	}
-	assert( cols.size() == y.size() );
-	y.insert( y.end(), cols.begin(), cols.end() );
-	return y;
-}
-
 //////////////////////////////////////////////////////////////////
 //    DestFields
 //////////////////////////////////////////////////////////////////
@@ -298,57 +215,21 @@ void SparseMsg::updateAfterFill()
 {
 	unsigned int startData = e2_->localDataStart();
 	unsigned int endData = startData + e2_->numLocalData();
-	SparseMatrix< unsigned int > temp( matrix_);
-	temp.transpose();
-	for ( unsigned int i = 0; i < temp.nRows(); ++ i ) {
+	for ( unsigned int i = 0; i < matrix_.nRows(); ++ i ) {
 		const unsigned int* colIndex;
 		const unsigned int* entry;
-		unsigned int num = temp.getRow( i, &entry, &colIndex );
+		unsigned int num = matrix_.getRow( i, &entry, &colIndex );
 		if ( i >= startData && i < endData ) {
-			// Inefficient. Better to do it in one pass after getting 
-			// the max num
-			e2_->resizeField( i - startData, num + 1 );
+			e2_->resizeField( i - startData, num );
 		}
 	}
 	e1()->markRewired();
 	e2()->markRewired();
 }
-
 void SparseMsg::pairFill( vector< unsigned int > src,
 			vector< unsigned int> dest )
 {
-	// Sanity check
-	vector< unsigned int >::const_iterator i;
-	for ( i = src.begin(); i != src.end(); ++i ) {
-		if (*i >= e1()->numData() ) {
-			cout << "Warning: SparseMsg::pairFill: Src index " << *i <<
-				   " exceeds Src array size " << e1()->numData() << 
-				   ". Aborting\n";
-			return;
-		}
-	}
-	for ( i = dest.begin(); i != dest.end(); ++i ) {
-		if (*i >= e2()->numData() ) {
-			cout << "Warning: SparseMsg::pairFill: Dest index " << *i <<
-				   " exceeds Dest array size " << e2()->numData() << 
-				   ". Aborting\n";
-			return;
-		}
-	}
-	
-	vector< unsigned int > numAtDest( dest.size(), 0 );
-	vector< unsigned int > fieldIndex( dest.size(), 0 );
-	for ( unsigned int i = 0; i < dest.size(); ++i ) {
-		fieldIndex[i] = numAtDest[ dest[i] ]; 
-		// Could do on previous line, but clarity
-		++numAtDest[ dest[i] ];
-	}
-
-	/**
-	 * We set retainSize flag to true since the # of src/dest objects
-	 * doesn't change. We can explicitly assign it elsewhere if needed.
-	 */
-	matrix_.tripletFill( src, dest, fieldIndex, true );
+	matrix_.pairFill( src, dest, 0 );
 	updateAfterFill();
 }
 
@@ -356,20 +237,10 @@ void SparseMsg::tripletFill( vector< unsigned int > src,
 			vector< unsigned int> destDataIndex,
 			vector< unsigned int> destFieldIndex )
 {
-	// We set retainSize flag to true
-	matrix_.tripletFill( src, destDataIndex, destFieldIndex, true );
+	matrix_.tripletFill( src, destDataIndex, destFieldIndex );
 	updateAfterFill();
 }
 
-void SparseMsg::tripletFill1( vector< unsigned int > v )
-{
-	unsigned int s3 = v.size() / 3;
-	vector< unsigned int > src( v.begin(), v.begin() + s3 );
-	vector< unsigned int > dest( v.begin() + s3, v.begin() + 2 * s3 );
-	vector< unsigned int > fieldIndex( v.begin() + 2 * s3, v.end() );
-	tripletFill( src, dest, fieldIndex );
-}
-
 //////////////////////////////////////////////////////////////////
 //    Here are the actual class functions
 //////////////////////////////////////////////////////////////////
@@ -377,10 +248,7 @@ void SparseMsg::tripletFill1( vector< unsigned int > v )
 
 SparseMsg::SparseMsg( Element* e1, Element* e2, unsigned int msgIndex )
 	: Msg( ObjId( managerId_, (msgIndex != 0) ? msgIndex: msg_.size() ),
-					e1, e2 ), 
-				numThreads_( 1 ), 
-				nrows_( 0 ),
-				p_( 0.0 ), seed_( 0 )
+					e1, e2 )
 {
 	unsigned int nrows = 0;
 	unsigned int ncolumns = 0;
diff --git a/moose-core/msg/SparseMsg.h b/moose-core/msg/SparseMsg.h
index d6fbf80b04306c1c333a94ff96b1f3649a1fa787..2dffb9af75d8e2e756ebc6308d0c66dde84d4ec8 100644
--- a/moose-core/msg/SparseMsg.h
+++ b/moose-core/msg/SparseMsg.h
@@ -82,23 +82,16 @@ class SparseMsg: public Msg
 		long getSeed() const;
 		void setSeed( long value );
 
-		vector< unsigned int > getEntryPairs() const;
-		void setEntryPairs( vector< unsigned int > entries );
-
 		void setEntry( unsigned int row, unsigned int column, 
 			unsigned int value );
 
 		void unsetEntry( unsigned int row, unsigned int column );
 
+		// Still need to implement array field gets.
+
 		unsigned int getNumRows() const;
 		unsigned int getNumColumns() const;
 		unsigned int getNumEntries() const;
-		/// Return array entries in sparse matrix form
-		vector< unsigned int > getMatrixEntry() const;
-		/// Return column index for each array entry
-		vector< unsigned int > getColIndex() const;
-		/// row start number for each array entry
-		vector< unsigned int > getRowStart() const;
 		void clear();
 		void transpose();
 
@@ -116,14 +109,6 @@ class SparseMsg: public Msg
 		void tripletFill( vector< unsigned int > src, 
 					vector< unsigned int> dest,
 					vector< unsigned int > field );
-
-		/**
-		 * Fills up the entire message based on triplets of 
-		 * src,destDataIndex,destFieldIndex, but catenates them all into
-		 * a single long vector since PyMoose doesn't know how to handle
-		 * multiple vectors.
-		 */
-		void tripletFill1( vector< unsigned int > entries ); 
 		
 		/**
 		 * Utility function to update all sorts of values after we've
diff --git a/moose-core/pymoose/CMakeLists.txt b/moose-core/pymoose/CMakeLists.txt
index cd7de488f0d9b7630c7bf242eaefc6e036582af4..83397de45054b7cc470f3c144ec6632ad3978c05 100644
--- a/moose-core/pymoose/CMakeLists.txt
+++ b/moose-core/pymoose/CMakeLists.txt
@@ -1,8 +1,6 @@
 add_definitions(-DPYMOOSE)
 include_directories(../basecode ../msg)
 
-find_package( PythonInterp REQUIRED )
-
 set(PYMOOSE_SRCS 
     moosemodule.cpp
     vec.cpp
@@ -20,18 +18,10 @@ EXEC_PROGRAM(${PYTHON_EXECUTABLE}
 except Exception: pass'"
     OUTPUT_VARIABLE PYTHON_SO_EXTENSION
     )
-
-message( STATUS "Python path ${PYTHON_EXECUTABLE}" )
 message( STATUS "Python so extension ${PYTHON_SO_EXTENSION}" )
 
 find_package(NumPy REQUIRED)
-find_package(PythonLibs REQUIRED)
-
-include_directories( ${NUMPY_INCLUDE_DIRS} )
-include_directories( ${PYTHON_INCLUDE_DIRS} )
-
-message( STATUS "Python include dir : ${PYTHON_INCLUDE_DIRS} " )
-
+include_directories(${NUMPY_INCLUDE_DIRS})
 add_definitions(-DUSE_NUMPY)
 
 add_definitions(-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
@@ -44,12 +34,7 @@ execute_process( COMMAND ${PYTHON_EXECUTABLE}-config --libs
     OUTPUT_VARIABLE PYTHON_LIBRARIES
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-
-if( NOT PYTHON_INCLUDE_FLAGS )
-    set( PYTHON_INCLUDE_FLAGS "-I ${PYTHON_INCLUDE_DIRS} " )
-endif( )
 message( STATUS "Python include flags: ${PYTHON_INCLUDE_FLAGS}" )
-
 set_target_properties(_moose PROPERTIES 
     COMPILE_DEFINITIONS "PYMOOSE"
     COMPILE_FLAGS "${PYTHON_INCLUDE_FLAGS}"
@@ -58,6 +43,11 @@ set_target_properties(_moose PROPERTIES
     SUFFIX ".so"
     )
 
+#if(NOT(PYTHON_SO_EXTENSION STREQUAL ""))
+#    set_target_properties(_moose PROPERTIES
+#    SUFFIX ${PYTHON_SO_EXTENSION})
+#endif()
+
 # see issue #80
 if(HDF5_LIBRARY_DIRS)
     set_target_properties( _moose PROPERTIES LINK_FLAGS "-L${HDF5_LIBRARY_DIRS}" )
@@ -93,6 +83,8 @@ endif(MACOSX)
 add_custom_target(copy_python_files ALL
     COMMAND ${CMAKE_COMMAND} -E copy_directory
         ${CMAKE_SOURCE_DIR}/python ${CMAKE_BINARY_DIR}/python
+    COMMAND ${CMAKE_COMMAND} -E copy 
+        ${CMAKE_SOURCE_DIR}/VERSION ${CMAKE_BINARY_DIR}/VERSION 
     COMMENT "Copying required python files and other files to build directory"
     VERBATIM
     )
diff --git a/moose-core/pymoose/PyRun.cpp b/moose-core/pymoose/PyRun.cpp
index 73d88c0cf8f643eb37318bf17321aa1df1fe3f94..5b3db0daec6cfb73d78516a2ee6acf404788ba6a 100644
--- a/moose-core/pymoose/PyRun.cpp
+++ b/moose-core/pymoose/PyRun.cpp
@@ -1,47 +1,47 @@
-// PyRun.cpp --- 
-// 
+// PyRun.cpp ---
+//
 // Filename: PyRun.cpp
-// Description: 
+// Description:
 // Author: subha
-// Maintainer: 
+// Maintainer:
 // Created: Sat Oct 11 14:47:22 2014 (+0530)
-// Version: 
+// Version:
 // Last-Updated: Fri Jun 19 18:56:06 2015 (-0400)
 //           By: Subhasis Ray
 //     Update #: 15
-// URL: 
-// Keywords: 
-// Compatibility: 
-// 
-// 
-
-// Commentary: 
-// 
-// 
-// 
-// 
+// URL:
+// Keywords:
+// Compatibility:
+//
+//
+
+// Commentary:
+//
+//
+//
+//
 
 // Change log:
-// 
-// 
-// 
-// 
+//
+//
+//
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
 // published by the Free Software Foundation; either version 3, or
 // (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU General Public License
 // along with this program; see the file COPYING.  If not, write to
 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth
 // Floor, Boston, MA 02110-1301, USA.
-// 
-// 
+//
+//
 
 // Code:
 
@@ -77,6 +77,7 @@ const Cinfo * PyRun::initCinfo()
         "String to be executed at initialization (reinit).",
         &PyRun::setInitString,
         &PyRun::getInitString);
+
     static ValueFinfo< PyRun, string > inputvar(
         "inputVar",
         "Name of local variable in which input balue is to be stored. Default"
@@ -87,13 +88,13 @@ const Cinfo * PyRun::initCinfo()
 
     static ValueFinfo< PyRun, string > outputvar(
         "outputVar",
-        "Name of local variable for storing output. Default is `output`",
+        "Name of local variable for storing output. Default is `output`.",
         &PyRun::setOutputVar,
         &PyRun::getOutputVar);
 
     static ValueFinfo< PyRun, int > mode(
         "mode",
-        "Flag to indicate whether runString should be executed for both trigger and process, or one of them",
+        "Flag to indicate whether runString should be executed for both trigger and process, or one of them.",
         &PyRun::setMode,
         &PyRun::getMode);
 
@@ -118,7 +119,7 @@ const Cinfo * PyRun::initCinfo()
         " builtin function `input`). If debug is True, it prints the input"
         " value.",
         new EpFunc1< PyRun, double >(&PyRun::trigger));
-    
+
     static DestFinfo run(
         "run",
         "Runs a specified string. Does not modify existing run or init strings.",
@@ -133,7 +134,7 @@ const Cinfo * PyRun::initCinfo()
         "reinit",
         "Handles reinit call. Runs the current initString.",
         new ProcOpFunc< PyRun >( &PyRun::reinit ));
-    
+
     static Finfo * processShared[] = { &process, &reinit };
     static SharedFinfo proc(
         "proc",
@@ -195,7 +196,7 @@ PyRun::PyRun():mode_(0), initstr_(""), runstr_(""),
     }
     if (PyDict_SetItemString(locals_, inputvar_.c_str(), value)){
         PyErr_Print();
-    }    
+    }
 }
 
 PyRun::~PyRun()
@@ -264,7 +265,7 @@ void PyRun::trigger(const Eref& e, double input)
     if (mode_ == 1){
         return;
     }
-    
+
     PyObject * value = PyDict_GetItemString(locals_, inputvar_.c_str());
     if (value){
         Py_DECREF(value);
@@ -335,12 +336,12 @@ void handleError(bool syntax)
 {
     PyObject *exc, *val, *trb;
     char * msg;
-    
-    if (syntax && PyErr_ExceptionMatches (PyExc_SyntaxError)){           
+
+    if (syntax && PyErr_ExceptionMatches (PyExc_SyntaxError)){
         PyErr_Fetch (&exc, &val, &trb);        /* clears exception! */
-        
+
         if (PyArg_ParseTuple (val, "sO", &msg, &trb) &&
-            !strcmp (msg, "unexpected EOF while parsing")){ /* E_EOF */            
+            !strcmp (msg, "unexpected EOF while parsing")){ /* E_EOF */
             Py_XDECREF (exc);
             Py_XDECREF (val);
             Py_XDECREF (trb);
@@ -350,21 +351,21 @@ void handleError(bool syntax)
         }
     } else {                                     /* some non-syntax error */
         PyErr_Print ();
-    }                
+    }
 }
 
 void PyRun::reinit(const Eref& e, ProcPtr p)
 {
     PyObject * main_module;
     if (globals_ == NULL){
-        main_module = PyImport_AddModule("__main__");        
+        main_module = PyImport_AddModule("__main__");
         globals_ = PyModule_GetDict(main_module);
         Py_XINCREF(globals_);
     }
     if (locals_ == NULL){
         locals_ = PyDict_New();
         if (!locals_){
-            cerr << "Could not initialize locals dict" << endl;            
+            cerr << "Could not initialize locals dict" << endl;
         }
     }
     initcompiled_ = (PYCODEOBJECT*)Py_CompileString(
@@ -396,5 +397,5 @@ void PyRun::reinit(const Eref& e, ProcPtr p)
 }
 
 
-// 
+//
 // PyRun.cpp ends here
diff --git a/moose-core/pymoose/melement.cpp b/moose-core/pymoose/melement.cpp
index 7cd4ee914d7162e3296717cc0c3b71d96d1fec7a..fdceba80eb347dfcb87ce921311da7dd88fb909a 100644
--- a/moose-core/pymoose/melement.cpp
+++ b/moose-core/pymoose/melement.cpp
@@ -1,48 +1,48 @@
-// melement.cpp --- 
-// 
+// melement.cpp ---
+//
 // Filename: melement.cpp
-// Description: 
-// Author: 
-// Maintainer: 
+// Description:
+// Author:
+// Maintainer:
 // Created: Mon Jul 22 16:50:41 2013 (+0530)
-// Version: 
+// Version:
 // Last-Updated: Fri Sep 25 23:02:53 2015 (-0400)
 //           By: subha
 //     Update #: 76
-// URL: 
-// Keywords: 
-// Compatibility: 
-// 
-// 
-
-// Commentary: 
-// 
+// URL:
+// Keywords:
+// Compatibility:
+//
+//
+
+// Commentary:
+//
 // Mon Jul 22 16:50:47 IST 2013 - Taking out ObjId stuff from
 // moosemodule.cpp
-// 
-// 
+//
+//
 
 // Change log:
-// 
-// 
-// 
-// 
+//
+//
+//
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
 // published by the Free Software Foundation; either version 3, or
 // (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU General Public License
 // along with this program; see the file COPYING.  If not, write to
 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth
 // Floor, Boston, MA 02110-1301, USA.
-// 
-// 
+//
+//
 
 // Code:
 
@@ -122,7 +122,7 @@ int moose_ObjId_init_from_id(_ObjId * self, PyObject * args, PyObject * kwargs)
         if (Id_Check(obj)){
             if (!Id::isValid(((_Id*)obj)->id_)){
                 RAISE_INVALID_ID(-1, "moose_ObjId_init_from_id");
-            }                    
+            }
             self->oid_ = ObjId(((_Id*)obj)->id_, data, field );
             if (self->oid_.bad()){
                 PyErr_SetString(PyExc_ValueError, "Invalid dataIndex/fieldIndex.");
@@ -132,7 +132,7 @@ int moose_ObjId_init_from_id(_ObjId * self, PyObject * args, PyObject * kwargs)
         } else if (PyObject_IsInstance(obj, (PyObject*)&ObjIdType)){
             if (!Id::isValid(((_ObjId*)obj)->oid_.id)){
                 RAISE_INVALID_ID(-1, "moose_ObjId_init_from_id");
-            }                    
+            }
             self->oid_ = ((_ObjId*)obj)->oid_;
             if (self->oid_.bad()){
                 PyErr_SetString(PyExc_ValueError, "Invalid ObjId");
@@ -156,7 +156,7 @@ int moose_ObjId_init_from_path(_ObjId * self, PyObject * args,
     self->oid_ = ObjId( 0, BADINDEX );
     PyTypeObject * mytype = Py_TYPE(self);
     string mytypename(mytype->tp_name);
-    
+
     // First try to parse the arguments as (parsedPath, n, g, dtype)
     bool parse_success = false;
     if (PyArg_ParseTupleAndKeywords(args, kwargs,
@@ -167,14 +167,14 @@ int moose_ObjId_init_from_path(_ObjId * self, PyObject * args,
     }
     // we need to clear the parse error so that the callee can try
     // other alternative: moose_ObjId_init_from_id
-    PyErr_Clear(); 
+    PyErr_Clear();
     if (!parse_success){
         return -2;
     }
 
     string path(parsedPath);
     // Remove one or more instances of '/' by a single '/' e.g. //a -> /a,
-    // /a//b -> /a/b etc. 
+    // /a//b -> /a/b etc.
     path = moose::fix(path);
 
     ostringstream err;
@@ -189,7 +189,7 @@ int moose_ObjId_init_from_path(_ObjId * self, PyObject * args,
         }
         basetype_str = string(basetype->tp_name).substr(6); // remove `moose.` prefix from type name
     } else {
-        basetype_str = string(type);            
+        basetype_str = string(type);
     }
 
 
@@ -211,7 +211,7 @@ int moose_ObjId_init_from_path(_ObjId * self, PyObject * args,
         // If the current class is a subclass of some predefined
         // moose class, do nothing.
         string className = self->oid_.element()->cinfo()->name();
-        map <string, PyTypeObject * >::iterator ii = 
+        map <string, PyTypeObject * >::iterator ii =
         	get_moose_classes().find( className );
         PyTypeObject * basetype = 0;
         if ( ii != get_moose_classes().end() ) {
@@ -227,7 +227,7 @@ int moose_ObjId_init_from_path(_ObjId * self, PyObject * args,
         // element exists at this path, but it does not inherit from any moose class.
         // throw an error
         err << "cannot convert "
-			<< className 
+			<< className
             << " to "
             << mytypename
             << ". To get the existing object use `moose.element(obj)` instead.";
@@ -245,7 +245,7 @@ int moose_ObjId_init_from_path(_ObjId * self, PyObject * args,
     self->oid_ = ObjId(new_id);
     return 0;
 }
-    
+
 int moose_ObjId_init(_ObjId * self, PyObject * args,
                      PyObject * kwargs)
 {
@@ -267,7 +267,7 @@ int moose_ObjId_init(_ObjId * self, PyObject * args,
     PyErr_SetString(PyExc_ValueError,
                     "Could not parse arguments. "
                     " Call __init__(path, n, g, dtype) or"
-                    " __init__(id, dataIndex, fieldIndex)");        
+                    " __init__(id, dataIndex, fieldIndex)");
     return -1;
 }
 
@@ -327,14 +327,20 @@ PyObject * moose_ObjId_str(_ObjId * self)
 PyDoc_STRVAR(moose_ObjId_getId_documentation,
              "getId() -> vec\n"
              "\n"
-             "Get the vec of this object\n"
+             "Returns the information of the object's classtype, Id, and path \n"
+             "in form of a vector.\n"
+             "\nExample\n"
+             "-------\n"
+             "    >>> com = moose.Compartment('/com')\n"
+             "    >>> com.getId()\n"
+             "        moose.vec: class=Compartment, id=481, path=/com>"
              "\n");
 PyObject* moose_ObjId_getId(_ObjId * self)
 {
     if (!Id::isValid(self->oid_.id)){
         RAISE_INVALID_ID(NULL, "moose_ObjId_getId");
     }
-    extern PyTypeObject IdType;        
+    extern PyTypeObject IdType;
     _Id * ret = PyObject_New(_Id, &IdType);
     ret->id_ = self->oid_.id;
     return (PyObject*)ret;
@@ -343,12 +349,15 @@ PyObject* moose_ObjId_getId(_ObjId * self)
 PyDoc_STRVAR(moose_ObjId_getFieldType_documentation,
              "getFieldType(fieldname)\n"
              "\n"
-             "Get the string representation of the type of the field `fieldname`.\n"
+             "Returns the type of the field `fieldname` (as a string).\n"
              "\n"
              "Parameters\n"
              "----------\n"
              "fieldname : string\n"
              "    Name of the field to be queried.\n"
+             "\n"
+             "      >>> comp.getFieldType('neighbors')\n"
+             "      >>> 'string,vector<Id>' \n"
              "\n");
 
 PyObject * moose_ObjId_getFieldType(_ObjId * self, PyObject * args)
@@ -379,18 +388,21 @@ PyObject * moose_ObjId_getFieldType(_ObjId * self, PyObject * args)
 PyDoc_STRVAR(moose_ObjId_getField_documentation,
              "getField(fieldname)\n"
              "\n"
-             "Get the value of the field `fieldname`.\n"
+             "Returns the value of the field `fieldname`.\n"
              "\n"
              "Parameters\n"
              "----------\n"
              "fieldname : string\n"
-             "    Name of the field.");
+             "    Name of the field.\n"
+             "\n"
+             "      >>> comp.getField('x0')\n"
+             "      >>> 0.0 \n");
 PyObject * moose_ObjId_getField(_ObjId * self, PyObject * args)
 {
     if (!Id::isValid(self->oid_.id)){
         RAISE_INVALID_ID(NULL, "moose_ObjId_getField");
     }
-    PyObject * attr;        
+    PyObject * attr;
     if (!PyArg_ParseTuple(args, "O:moose_ObjId_getField", &attr)){
         return NULL;
     }
@@ -399,7 +411,7 @@ PyObject * moose_ObjId_getField(_ObjId * self, PyObject * args)
 
 /**
    2011-03-28 13:59:41 (+0530)
-   
+
    Get a specified field. Re-done on: 2011-03-23 14:42:03 (+0530)
 
    I wonder how to cleanly do this. The Id - ObjId dichotomy is
@@ -436,7 +448,7 @@ PyObject * moose_ObjId_getattro(_ObjId * self, PyObject * attr)
             break;
         }
     }
-            
+
     string type = getFieldType(className, fieldName);
     if (type.empty() || !isValueField ){
         // Check if this field name is aliased and update fieldName and type if so.
@@ -520,12 +532,12 @@ PyObject * moose_ObjId_getattro(_ObjId * self, PyObject * attr)
             _ret = to_py(&value, ftype);
             break;
         }
-        case 'x': {                    
+        case 'x': {
             Id value = Field<Id>::get(self->oid_, fieldName);
             _ret = to_py(&value, ftype);
             break;
         }
-        case 'y': {                    
+        case 'y': {
             ObjId value = Field<ObjId>::get(self->oid_, fieldName);
             _ret = to_py(&value, ftype);
             break;
@@ -544,12 +556,12 @@ PyObject * moose_ObjId_getattro(_ObjId * self, PyObject * attr)
             vector < Id > value = Field<vector <Id> >::get(self->oid_, fieldName);
             _ret = to_py(&value, ftype);
             break;
-        } 
+        }
         case 'Y': { // vector<ObjId>
             vector < ObjId > value = Field<vector <ObjId> >::get(self->oid_, fieldName);
             _ret = to_py(&value, ftype);
             break;
-        } 
+        }
         case 'M': {
             vector< long > value = Field< vector <long> >::get(self->oid_, fieldName);
             _ret = to_py(&value, ftype);
@@ -579,12 +591,12 @@ PyObject * moose_ObjId_getattro(_ObjId * self, PyObject * attr)
             vector < vector < unsigned int > > value = Field<vector <vector < unsigned int > > >::get(self->oid_, fieldName);
             _ret = to_py(&value, ftype);
             break;
-        } 
+        }
         case 'Q': { // vector< vector < int > >
             vector <  vector < int >  > value = Field<vector < vector < int > > >::get(self->oid_, fieldName);
             _ret = to_py(&value, ftype);
             break;
-        } 
+        }
         case 'R': { // vector< vector < double > >
             vector <  vector < double >  > value = Field<vector < vector < double > > >::get(self->oid_, fieldName);
             _ret = to_py(&value, ftype);
@@ -635,12 +647,12 @@ PyObject * moose_ObjId_getattro(_ObjId * self, PyObject * attr)
 
         default:
             _ret = PyObject_GenericGetAttr((PyObject*)self, attr);
-            
+
     }
     if (new_attr){
         Py_DECREF(attr);
     }
-    return _ret;        
+    return _ret;
 }
 
 /**
@@ -657,7 +669,12 @@ PyDoc_STRVAR(moose_ObjId_setField_documentation,
              "    Field to be assigned value to.\n"
              "\n"
              "value : python datatype compatible with the type of the field\n"
-             "    The value to be assigned to the field.");
+             "    The value to be assigned to the field."
+             "\n"
+             "\n"
+             "        >>> comp.setField('x0', 45.25) \n"
+             "        >>> print comp.x0\n"
+             "            45.25\n");
 
 PyObject * moose_ObjId_setField(_ObjId * self, PyObject * args)
 {
@@ -694,7 +711,7 @@ int  moose_ObjId_setattro(_ObjId * self, PyObject * attr, PyObject * value)
         // typos). Otherwise, it must have been subclassed in
         // Python. Then we allow normal Pythonic behaviour and
         // consider such mistakes user's responsibility.
-        string className = ((PyTypeObject*)PyObject_Type((PyObject*)self))->tp_name;            
+        string className = ((PyTypeObject*)PyObject_Type((PyObject*)self))->tp_name;
         if (get_moose_classes().find(className) == get_moose_classes().end()){
             return PyObject_GenericSetAttr((PyObject*)self, PyString_FromString(field), value);
         }
@@ -727,7 +744,7 @@ int  moose_ObjId_setattro(_ObjId * self, PyObject * attr, PyObject * value)
             unsigned long _value = PyInt_AsUnsignedLongMask(value);
             ret = Field<unsigned long>::set(self->oid_, string(field), _value);
             break;
-        }                
+        }
         case 'f': {
             float _value = PyFloat_AsDouble(value);
             ret = Field<float>::set(self->oid_, string(field), _value);
@@ -899,7 +916,7 @@ int  moose_ObjId_setattro(_ObjId * self, PyObject * attr, PyObject * value)
                 ret = Field< vector < float > >::set(self->oid_, string(field), _value);
             }
             break;
-        }              
+        }
         case 'S': {
             if (!PySequence_Check(value)){
                 PyErr_SetString(PyExc_TypeError, "For setting vector<string> field, specified value must be a sequence." );
@@ -955,7 +972,7 @@ int  moose_ObjId_setattro(_ObjId * self, PyObject * attr, PyObject * value)
                 ret = Field< vector < Id > >::set(self->oid_, string(field), _value);
             }
             break;
-        }              
+        }
         case 'Y': {//SET_VECFIELD(ObjId, f)
             if (!PySequence_Check(value)){
                 PyErr_SetString(PyExc_TypeError, "For setting vector<ObjId> field, specified value must be a sequence." );
@@ -971,8 +988,8 @@ int  moose_ObjId_setattro(_ObjId * self, PyObject * attr, PyObject * value)
                 ret = Field< vector < ObjId > >::set(self->oid_, string(field), _value);
             }
             break;
-        }              
-        default:                
+        }
+        default:
             break;
     }
     // MOOSE Field::set returns 1 for success 0 for
@@ -1007,10 +1024,10 @@ PyObject * moose_ObjId_getItem(_ObjId * self, Py_ssize_t index)
     // what is s0[1]? ObjId(X
     // syn[0][1]->ObjId(X, 0, 1) =syn[0][0][0] - which is an ObjId.
     // Now, what is syn[0][1][2] ?
-    
+
     // In PyMOOSE, user is allowed to directly put in the numbers
     // for Id, dataIndex and fieldIndex directly and construct an
-    // ObjId. 
+    // ObjId.
     _ObjId * ret = PyObject_New(_ObjId, &ObjIdType);
     ret->oid_ = ObjId(self->oid_.id, self->oid_.dataIndex, index);
     return (PyObject*)ret;
@@ -1031,8 +1048,8 @@ PyObject * moose_ObjId_getSlice(_ObjId * self, Py_ssize_t start, Py_ssize_t end)
         return PyTuple_New(0);
     }
     PyObject * ret = PyTuple_New((Py_ssize_t)(end - start));
-    
-    // Py_XINCREF(ret);        
+
+    // Py_XINCREF(ret);
     for ( int ii = start; ii < end; ++ii){
         _ObjId * value = PyObject_New(_ObjId, &ObjIdType);
         value->oid_ = ObjId(self->oid_.id, self->oid_.dataIndex, ii);
@@ -1095,39 +1112,39 @@ PyObject * getLookupField(ObjId target, char * fieldName, PyObject * key)
         case 'h': {
             ret = lookup_value <short> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }            
+        }
         case 'H': {
             ret = lookup_value <unsigned short> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }            
+        }
         case 'i': {
             ret = lookup_value <int> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }            
+        }
         case 'I': {
             ret = lookup_value <unsigned int> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }            
+        }
         case 'l': {
             ret = lookup_value <long> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }                        
+        }
         case 'k': {
             ret = lookup_value <unsigned long> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }                        
+        }
         case 'L': {
             ret = lookup_value <long long> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }                        
+        }
         case 'K': {
             ret = lookup_value <unsigned long long> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }                        
+        }
         case 'd': {
             ret = lookup_value <double> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }                        
+        }
         case 'f': {
             ret = lookup_value <float> (target, string(fieldName), value_type_code, key_type_code, key);
             break;
@@ -1147,7 +1164,7 @@ PyObject * getLookupField(ObjId target, char * fieldName, PyObject * key)
         case 'D': {
             ret = lookup_value < vector <double> >(target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }                
+        }
         case 'S': {
             ret = lookup_value < vector <string> >(target, string(fieldName), value_type_code, key_type_code, key);
             break;
@@ -1175,11 +1192,11 @@ PyObject * getLookupField(ObjId target, char * fieldName, PyObject * key)
         case 'F': {
             ret = lookup_value < vector <float> >(target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }                
+        }
         case 'w': {
             ret = lookup_value < vector <short> >(target, string(fieldName), value_type_code, key_type_code, key);
             break;
-        }   
+        }
         case 'C': {
             ret = lookup_value < vector <char> >(target, string(fieldName), value_type_code, key_type_code, key);
             break;
@@ -1242,11 +1259,11 @@ int setLookupField(ObjId target, char * fieldName, PyObject * key, PyObject * va
         case 'I': {
             ret = set_lookup_value <unsigned int> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }            
+        }
         case 'k': {
             ret = set_lookup_value <unsigned long> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }                        
+        }
         case 's': {
             ret = set_lookup_value <string> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
@@ -1254,19 +1271,19 @@ int setLookupField(ObjId target, char * fieldName, PyObject * key, PyObject * va
         case 'i': {
             ret = set_lookup_value <int> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }            
+        }
         case 'l': {
             ret = set_lookup_value <long> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }                        
+        }
         case 'L': {
             ret = set_lookup_value <long long> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }                        
+        }
         case 'K': {
             ret = set_lookup_value <unsigned long long> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }                        
+        }
         case 'b': {
             ret = set_lookup_value <bool> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
@@ -1278,15 +1295,15 @@ int setLookupField(ObjId target, char * fieldName, PyObject * key, PyObject * va
         case 'h': {
             ret = set_lookup_value <short> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }            
+        }
         case 'H': {
             ret = set_lookup_value <unsigned short> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }            
+        }
         case 'd': {
             ret = set_lookup_value <double> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
-        }                        
+        }
         case 'f': {
             ret = set_lookup_value <float> (target, string(fieldName), value_type_code, key_type_code, key, value);
             break;
@@ -1304,7 +1321,7 @@ int setLookupField(ObjId target, char * fieldName, PyObject * key, PyObject * va
             error << "setLookupField: invalid key type " << type_vec[0];
             PyErr_SetString(PyExc_TypeError, error.str().c_str());
     }
-    return ret;        
+    return ret;
 }// setLookupField
 
 PyDoc_STRVAR(moose_ObjId_setLookupField_documentation,
@@ -1373,7 +1390,7 @@ PyObject * moose_ObjId_setDestField(_ObjId * self, PyObject * args)
         PyErr_SetString(PyExc_ValueError, error.str().c_str());
         return NULL;
     }
-    
+
     // Get the destFinfo name
     char * fieldName = PyString_AsString(arglist[0]);
     if (!fieldName){ // not a string, raises TypeError
@@ -1381,7 +1398,7 @@ PyObject * moose_ObjId_setDestField(_ObjId * self, PyObject * args)
         PyErr_SetString(PyExc_TypeError, error.str().c_str());
         return NULL;
     }
-    
+
     // Try to parse the arguments.
     vector< string > argType;
     if (parseFinfoType(Field<string>::get(oid, "className"),
@@ -1419,7 +1436,7 @@ PyObject * setDestFinfo(ObjId obj, string fieldName, PyObject *arg, string argTy
     ostringstream error;
     error << "moose.setDestFinfo: ";
 
-switch (typecode){                    
+switch (typecode){
     case 'f': case 'd': {
         double param = PyFloat_AsDouble(arg);
         if (typecode == 'f'){
@@ -1464,7 +1481,7 @@ switch (typecode){
         if (id == NULL){
             error << "argument should be an vec or an melement";
             PyErr_SetString(PyExc_TypeError, error.str().c_str());
-            return NULL;                                
+            return NULL;
         }
         param = id->id_;
         ret = SetGet1<Id>::set(obj, fieldName, param);
@@ -1476,7 +1493,7 @@ switch (typecode){
         if (oid == NULL){
             error << "argument should be vec or an melement";
             PyErr_SetString(PyExc_TypeError, error.str().c_str());
-            return NULL;                                
+            return NULL;
         }
         param = oid->oid_;
         ret = SetGet1<ObjId>::set(obj, fieldName, param);
@@ -1508,7 +1525,7 @@ switch (typecode){
     }
     case 'L': {//SET_VECFIELD(long, l) {
         return _set_vector_destFinfo<long>(obj, string(fieldName), arg, typecode);
-    }            
+    }
     case 'N': { //SET_VECFIELD(unsigned int, I)
         return _set_vector_destFinfo<unsigned int>(obj, string(fieldName), arg, typecode);
     }
@@ -1520,7 +1537,7 @@ switch (typecode){
     }
     case 'D': {//SET_VECFIELD(double, d)
         return _set_vector_destFinfo<double>(obj, string(fieldName), arg, typecode);
-    }                
+    }
     case 'S': {
         return _set_vector_destFinfo<string>(obj, string(fieldName), arg, typecode);
     }
@@ -1594,7 +1611,7 @@ switch (type2){
             if (id == NULL){
                 error << "argument should be an vec or an melement";
                 PyErr_SetString(PyExc_TypeError, error.str().c_str());
-                return NULL;                                
+                return NULL;
             }
             param = id->id_;
         // } else if (ObjId_SubtypeCheck(arg)){
@@ -1602,7 +1619,7 @@ switch (type2){
         //     if (oid == NULL){
         //         error << "argument should be an vec or an melement";
         //         PyErr_SetString(PyExc_TypeError, error.str().c_str());
-        //         return NULL;                                
+        //         return NULL;
         //     }
         //     param = oid->oid_.id;
         // }
@@ -1615,7 +1632,7 @@ switch (type2){
         //     if (id == NULL){
         //         error << "argument should be an vec or an melement";
         //         PyErr_SetString(PyExc_TypeError, error.str().c_str());
-        //         return NULL;                                
+        //         return NULL;
         //     }
         //     param = ObjId(id->id_);
         // } else if (ObjId_SubtypeCheck(arg)){
@@ -1623,7 +1640,7 @@ switch (type2){
             if (oid == NULL){
                 error << "argument should be an vec or an melement";
                 PyErr_SetString(PyExc_TypeError, error.str().c_str());
-                return NULL;                                
+                return NULL;
             }
             param = oid->oid_;
         // }
@@ -1654,26 +1671,31 @@ switch (type2){
 PyDoc_STRVAR(moose_ObjId_getFieldNames_documenation,
              "getFieldNames(fieldType='') -> tuple of str\n"
              "\n"
-             "Get the names of fields on this element.\n"
+             "Returns the names of fields of this element of fieldType kind.\n"
              "\n"
              "Parameters\n"
              "----------\n"
              "fieldType : str\n"
-             "    Field type to retrieve. Can be `valueFinfo`, `srcFinfo`,\n"
-             "   `destFinfo`, `lookupFinfo`, etc. If an empty string is specified,\n"
-             "    names of all avaialable fields are returned.\n"
+             "    Type of the fields you wish to retrieve. Can be\n"
+             "     - `valueFinfo` - attributes of the object\n"
+             "     - `srcFinfo`   - fields of the object which can be used as source of information for connect\n"
+             "     - `destFinfo`  - fields of the object which can be used as destination of information for connect\n"
+             "     - `lookupFinfo`- fields which can be looked at through this object"
+             ", etc. If an empty string is specified, names of all avaialable fields are returned.\n"
              "\n"
              "Returns\n"
              "-------\n"
              "names : tuple of strings.\n"
-             "    names of the fields of the specified type.\n"   
+             "    names of the fields of the specified type.\n"
              "\n"
              "Examples\n"
              "--------\n"
              "List names of all the source fields in PulseGen class:\n"
              "\n"
-             "    >>> moose.getFieldNames('PulseGen', 'srcFinfo')\n"
-             "    ('childMsg', 'output')\n"
+             "      >>> comp.getFieldNames('lookupFinfo') \n"
+             "          ('neighbors', 'msgDests', 'msgDestFunctions', 'isA')\n"
+             "      >>> moose.getFieldNames('PulseGen', 'srcFinfo')\n"
+             "          ('childMsg', 'output')\n"
              "\n");
 // 2011-03-23 15:28:26 (+0530)
 PyObject * moose_ObjId_getFieldNames(_ObjId * self, PyObject *args)
@@ -1692,13 +1714,13 @@ PyObject * moose_ObjId_getFieldNames(_ObjId * self, PyObject *args)
         for (const char **a = getFinfoTypes(); *a; ++a){
             vector<string> fields = getFieldNames(className, string(*a));
             ret.insert(ret.end(), fields.begin(), fields.end());
-        }            
+        }
     } else {
         ret = getFieldNames(className, ftype_str);
     }
-    
+
     PyObject * pyret = PyTuple_New((Py_ssize_t)ret.size());
-            
+
     for (unsigned int ii = 0; ii < ret.size(); ++ ii ){
         PyObject * fname = Py_BuildValue("s", ret[ii].c_str());
         if (!fname){
@@ -1713,7 +1735,7 @@ PyObject * moose_ObjId_getFieldNames(_ObjId * self, PyObject *args)
             break;
         }
     }
-    return pyret;             
+    return pyret;
 }
 
 PyDoc_STRVAR(moose_ObjId_getNeighbors_documentation,
@@ -1731,7 +1753,7 @@ PyDoc_STRVAR(moose_ObjId_getNeighbors_documentation,
              "neighbors: tuple of vecs.\n"
              "    tuple containing the ids of the neighbour vecs.\n"
              "\n");
-             
+
 PyObject * moose_ObjId_getNeighbors(_ObjId * self, PyObject * args)
 {
     if (!Id::isValid(self->oid_.id)){
@@ -1744,14 +1766,14 @@ PyObject * moose_ObjId_getNeighbors(_ObjId * self, PyObject * args)
     vector< Id > val = LookupField< string, vector< Id > >::get(self->oid_, "neighbors", string(field));
 
     PyObject * ret = PyTuple_New((Py_ssize_t)val.size());
-            
-    for (unsigned int ii = 0; ii < val.size(); ++ ii ){            
+
+    for (unsigned int ii = 0; ii < val.size(); ++ ii ){
         _Id * entry = PyObject_New(_Id, &IdType);
         if (!entry || PyTuple_SetItem(ret, (Py_ssize_t)ii, (PyObject*)entry)){
             Py_DECREF(ret);
             // Py_DECREF((PyObject*)entry);
-            ret = NULL;                                 
-            break;                                      
+            ret = NULL;
+            break;
         }
         entry->id_ = val[ii];
     }
@@ -1764,21 +1786,33 @@ PyObject * moose_ObjId_getNeighbors(_ObjId * self, PyObject * args)
 
 // 2011-03-28 10:51:52 (+0530)
 PyDoc_STRVAR(moose_ObjId_connect_documentation,
-             "connect(srcfield, destobj, destfield, msgtype) -> bool\n"
+             "connect(src, srcfield, destobj, destfield[,msgtype]) -> bool\n"
              "\n"
-             "Connect another object via a message.\n"
+             "Create a message between `src_field` on `src` object to `dest_field` on `dest` object.\n"
+             "This function is used mainly, to say, connect two entities, and to denote what kind of give-and-take relationship they share."
+             "It enables the 'destfield' (of the 'destobj') to acquire the data, from 'srcfield'(of the 'src')."
              "\n"
              "Parameters\n"
              "----------\n"
+             "src : element/vec/string\n"
+             "    the source object (or its path) \n"
+             "    (the one that provides information)\n"
              "srcfield : str\n"
-             "    source field on self.\n"
+             "    source field on self.(type of the information)\n"
              "destobj : element\n"
              "    Destination object to connect to.\n"
+             "    (The one that need to get information)\n"
              "destfield : str\n"
              "    field to connect to on `destobj`.\n"
              "msgtype : str\n"
-             "    type of the message. Can be `Single`, `OneToAll`, `AllToOne`,\n"
-             "   `OneToOne`, `Reduce`, `Sparse`. Default: `Single`.\n"
+             "    type of the message. Can be \n"
+             "    `Single` - \n"
+             "    `OneToAll` - \n"
+             "    `AllToOne` - \n"
+             "    `OneToOne` - \n"
+             "    `Reduce` - \n"
+             "    `Sparse` - \n"
+             "    Default: `Single`.\n"
              "\n"
              "Returns\n"
              "-------\n"
@@ -1804,7 +1838,7 @@ PyObject * moose_ObjId_connect(_ObjId * self, PyObject * args)
     if (!Id::isValid(self->oid_.id)){
         RAISE_INVALID_ID(NULL, "moose_ObjId_connect");
     }
-    extern PyTypeObject ObjIdType;        
+    extern PyTypeObject ObjIdType;
     PyObject * destPtr = NULL;
     char * srcField = NULL, * destField = NULL, * msgType = NULL;
     static char default_msg_type[] = "Single";
@@ -1830,7 +1864,7 @@ PyObject * moose_ObjId_connect(_ObjId * self, PyObject * args)
                         "connect failed: check field names and type compatibility.");
         return NULL;
     }
-    _ObjId* msgMgrId = (_ObjId*)PyObject_New(_ObjId, &ObjIdType);        
+    _ObjId* msgMgrId = (_ObjId*)PyObject_New(_ObjId, &ObjIdType);
     msgMgrId->oid_ = mid;
     return (PyObject*)msgMgrId;
 }
@@ -1840,7 +1874,7 @@ PyDoc_STRVAR(moose_ObjId_richcompare_documentation,
              "the paths of the element instances. This function exists only to\n"
              "facilitate certain operations requiring sorting/comparison, like\n"
              "using elements for dict keys. Conceptually only equality comparison is\n"
-             "meaningful for elements.\n"); 
+             "meaningful for elements.\n");
 PyObject* moose_ObjId_richcompare(_ObjId * self, PyObject * other, int op)
 {
     if (!Id::isValid(self->oid_.id)){
@@ -1892,13 +1926,19 @@ PyObject* moose_ObjId_richcompare(_ObjId * self, PyObject * other, int op)
 PyDoc_STRVAR(moose_ObjId_getDataIndex_documentation,
              "getDataIndex() -> int\n"
              "\n"
-             "Get the dataIndex of this object.\n"
+             "Returns the dataIndex (position of the object in vector) "
+             "of this object, if it belongs to a vector, otherwise returns 0.\n"
+             "\n"
+             "        >>> comp = moose.Compartment('/comp')\n"
+             "        >>> comp.getDataIndex()\n"
+             "        >>> 0\n"
+             ""
              );
 PyObject * moose_ObjId_getDataIndex(_ObjId * self)
 {
     if (!Id::isValid(self->oid_.id)){
         RAISE_INVALID_ID(NULL, "moose_ObjId_getDataIndex");
-    }        
+    }
     PyObject * ret = Py_BuildValue("I", self->oid_.dataIndex);
     return ret;
 }
@@ -1921,7 +1961,7 @@ PyObject * moose_ObjId_getFieldIndex(_ObjId * self)
 
 static PyMethodDef ObjIdMethods[] = {
     {"getFieldType", (PyCFunction)moose_ObjId_getFieldType, METH_VARARGS,
-     moose_ObjId_getFieldType_documentation},        
+     moose_ObjId_getFieldType_documentation},
     {"getField", (PyCFunction)moose_ObjId_getField, METH_VARARGS,
      moose_ObjId_getField_documentation},
     {"setField", (PyCFunction)moose_ObjId_setField, METH_VARARGS,
@@ -1947,7 +1987,7 @@ static PyMethodDef ObjIdMethods[] = {
      "Get the index of this object as a field."},
     {"setDestField", (PyCFunction)moose_ObjId_setDestField, METH_VARARGS,
      moose_ObjId_setDestField_documentation},
-    {NULL, NULL, 0, NULL},        /* Sentinel */        
+    {NULL, NULL, 0, NULL},        /* Sentinel */
 };
 
 
@@ -2011,7 +2051,7 @@ PyDoc_STRVAR(moose_ObjId_documentation,
              ">>> c = moose.melement(b)"
              );
 
-PyTypeObject ObjIdType = { 
+PyTypeObject ObjIdType = {
     PyVarObject_HEAD_INIT(NULL, 0)            /* tp_head */
     "moose.melement",                      /* tp_name */
     sizeof(_ObjId),                     /* tp_basicsize */
@@ -2055,5 +2095,5 @@ PyTypeObject ObjIdType = {
 
 
 
-// 
+//
 // melement.cpp ends here
diff --git a/moose-core/pymoose/mfield.cpp b/moose-core/pymoose/mfield.cpp
index dd452890f2114c2bac81721c1b357952320b9c03..7e73f2650e979d17ef72952699f4274121f3358c 100644
--- a/moose-core/pymoose/mfield.cpp
+++ b/moose-core/pymoose/mfield.cpp
@@ -163,7 +163,6 @@ PyObject * moose_Field_repr(_Field * self)
     return PyString_FromString(fieldPath.str().c_str());
 }
 
-
 PyDoc_STRVAR(moose_Field_documentation,
              "Base class for MOOSE fields.\n"
              "\n"
@@ -175,8 +174,6 @@ PyDoc_STRVAR(moose_Field_documentation,
              "are putting fields as dictionary keys, you should do that after names\n"
              "of all elements have been finalized.\n"
              "\n");
-
-
 static PyTypeObject moose_Field =
 {
     PyVarObject_HEAD_INIT(NULL, 0)
diff --git a/moose-core/pymoose/moosemodule.cpp b/moose-core/pymoose/moosemodule.cpp
index 1ac1d91f6c8737b1bca5fc6b3d99b5332a4b0668..70295a156cc325bf1a3c2d7dd3e1ff900b98b9eb 100644
--- a/moose-core/pymoose/moosemodule.cpp
+++ b/moose-core/pymoose/moosemodule.cpp
@@ -75,10 +75,10 @@ using namespace std;
 extern void testSync();
 extern void testAsync();
 
-extern void testSyncArray( 
+extern void testSyncArray(
         unsigned int size,
         unsigned int numThreads,
-        unsigned int method 
+        unsigned int method
         );
 
 extern void testShell();
@@ -104,14 +104,14 @@ extern void test_moosemodule();
 
 extern Id init(
         int argc, char ** argv, bool& doUnitTests
-        , bool& doRegressionTests, unsigned int& benchmark 
+        , bool& doRegressionTests, unsigned int& benchmark
         );
 
 extern void initMsgManagers();
 extern void destroyMsgManagers();
 
 extern void speedTestMultiNodeIntFireNetwork(
-        unsigned int size, unsigned int runsteps 
+        unsigned int size, unsigned int runsteps
         );
 
 extern void mooseBenchmarks( unsigned int option );
@@ -1350,8 +1350,12 @@ PyDoc_STRVAR(moose_getFieldNames_documentation,
              "className : string\n"
              "    Name of the class to look up.\n"
              "finfoType : string\n"
-             "    The kind of field (`valueFinfo`, `srcFinfo`, `destFinfo`,\n"
-             "    `lookupFinfo`, `fieldElementFinfo`.).\n"
+             "    The kind of field "
+             "        `valueFinfo` - "
+             "        `srcFinfo`   -  "
+             "        `destFinfo`  - "
+             "        `lookupFinfo`- "
+             "        `fieldElementFinfo` - \n"
              "\n"
              "Returns\n"
              "-------\n"
@@ -1383,31 +1387,32 @@ PyObject * moose_getFieldNames(PyObject * dummy, PyObject * args)
 }
 
 PyDoc_STRVAR(moose_copy_documentation,
-             "copy(src, dest, name, n, toGlobal, copyExtMsg) -> bool\n"
-             "\n"
-             "Make copies of a moose object.\n"
-             "\n"
-             "Parameters\n"
-             "----------\n"
-             "src : vec, element or str\n"
-             "    source object.\n"
-             "dest : vec, element or str\n"
-             "    Destination object to copy into.\n"
-             "name : str\n"
-             "    Name of the new object. If omitted, name of the original will be used.\n"
-             "n : int\n"
-             "    Number of copies to make.\n"
-             "toGlobal : int\n"
-             "    Relevant for parallel environments only. If false, the copies will\n"
-             "    reside on local node, otherwise all nodes get the copies.\n"
-             "copyExtMsg : int\n"
-             "    If true, messages to/from external objects are also copied.\n"
-             "\n"
-             "Returns\n"
-             "-------\n"
-             "vec\n"
-             "    newly copied vec\n"
+        "copy(src, dest, name, n, toGlobal, copyExtMsg) -> bool\n"
+        "\n"
+        "Make copies of a moose object.\n"
+        "\n"
+        "Parameters\n"
+        "----------\n"
+        "src : vec, element or str\n"
+        "    source object.\n"
+        "dest : vec, element or str\n"
+        "    Destination object to copy into.\n"
+        "name : str\n"
+        "    Name of the new object. If omitted, name of the original will be used.\n"
+        "n : int\n"
+        "    Number of copies to make.\n"
+        "toGlobal : int\n"
+        "    Relevant for parallel environments only. If false, the copies will\n"
+        "    reside on local node, otherwise all nodes get the copies.\n"
+        "copyExtMsg : int\n"
+        "    If true, messages to/from external objects are also copied.\n"
+        "\n"
+        "Returns\n"
+        "-------\n"
+        "vec\n"
+        "    newly copied vec\n"
             );
+
 PyObject * moose_copy(PyObject * dummy, PyObject * args, PyObject * kwargs)
 {
     PyObject * src = NULL, * dest = NULL;
@@ -1643,8 +1648,8 @@ PyDoc_STRVAR(moose_useClock_documentation,
              "Examples\n"
              "--------\n"
              "In multi-compartmental neuron model a compartment's membrane potential (Vm) is dependent on its neighbours' membrane potential. Thus it must get the neighbour's present Vm before computing its own Vm in next time step. This ordering is achieved by scheduling the `init` function, which communicates membrane potential, on tick 0 and `process` function on tick 1.\n\n"
-             "    >>> moose.useClock(0, '/model/compartment_1', 'init')\n"
-             "    >>> moose.useClock(1, '/model/compartment_1', 'process')\n");
+             "        >>> moose.useClock(0, '/model/compartment_1', 'init')\n"
+             "        >>> moose.useClock(1, '/model/compartment_1', 'process')\n");
 
 PyObject * moose_useClock(PyObject * dummy, PyObject * args)
 {
@@ -1952,42 +1957,52 @@ PyObject * moose_getCwe(PyObject * dummy, PyObject * args)
 }
 
 PyDoc_STRVAR(moose_connect_documentation,
-             "connect(src, src_field, dest, dest_field, message_type) -> bool\n"
-             "\n"
-             "Create a message between `src_field` on `src` object to `dest_field`\n"
-             "on `dest` object.\n"
-             "\n"
-             "Parameters\n"
-             "----------\n"
-             "src : element/vec/string\n"
-             "    the source object (or its path)\n"
-             "src_field : str\n"
-             "    the source field name. Fields listed under `srcFinfo` and\n"
-             "    `sharedFinfo` qualify for this.\n"
-             "dest : element/vec/string\n"
-             "    the destination object.\n"
-             "dest_field : str\n"
-             "    the destination field name. Fields listed under `destFinfo`\n"
-             "    and `sharedFinfo` qualify for this.\n"
-             "message_type : str (optional)\n"
-             "    Type of the message. Can be `Single`, `OneToOne`, `OneToAll`.\n"
-             "    If not specified, it defaults to `Single`.\n"
-             "\n"
-             "Returns\n"
-             "-------\n"
-             "msgmanager: melement\n"
-             "    message-manager for the newly created message.\n"
-             "\n"
-             "Examples\n"
-             "--------\n"
-             "Connect the output of a pulse generator to the input of a spike\n"
-             "generator::\n"
-             "\n"
-             ">>> pulsegen = moose.PulseGen('pulsegen')\n"
-             ">>> spikegen = moose.SpikeGen('spikegen')\n"
-             ">>> moose.connect(pulsegen, 'output', spikegen, 'Vm')\n"
-             "\n"
-            );
+          "connect(src, srcfield, destobj, destfield[,msgtype]) -> bool\n"
+          "\n"
+          "Create a message between `src_field` on `src` object to `dest_field` on `dest` object.\n"
+          "This function is used mainly, to say, connect two entities, and to denote what kind of give-and-take relationship they share."
+          "It enables the 'destfield' (of the 'destobj') to acquire the data, from 'srcfield'(of the 'src')."
+          "\n"
+          "Parameters\n"
+          "----------\n"
+          "src : element/vec/string\n"
+          "    the source object (or its path) \n"
+          "    (the one that provides information)\n"
+          "srcfield : str\n"
+          "    source field on self.(type of the information)\n"
+          "destobj : element\n"
+          "    Destination object to connect to.\n"
+          "    (The one that need to get information)\n"
+          "destfield : str\n"
+          "    field to connect to on `destobj`.\n"
+          "msgtype : str\n"
+          "    type of the message. Can be \n"
+          "    `Single` - \n"
+          "    `OneToAll` - \n"
+          "    `AllToOne` - \n"
+          "    `OneToOne` - \n"
+          "    `Reduce` - \n"
+          "    `Sparse` - \n"
+          "    Default: `Single`.\n"
+          "\n"
+          "Returns\n"
+          "-------\n"
+          "msgmanager: melement\n"
+          "    message-manager for the newly created message.\n"
+          "\n"
+          "Examples\n"
+          "--------\n"
+          "Connect the output of a pulse generator to the input of a spike\n"
+          "generator::\n"
+          "\n"
+          "    >>> pulsegen = moose.PulseGen('pulsegen')\n"
+          "    >>> spikegen = moose.SpikeGen('spikegen')\n"
+          "    >>> pulsegen.connect('output', spikegen, 'Vm')\n"
+          "\n"
+          "See also\n"
+          "--------\n"
+          "moose.connect\n"
+          );
 
 PyObject * moose_connect(PyObject * dummy, PyObject * args)
 {
@@ -2085,7 +2100,7 @@ PyDoc_STRVAR(moose_getFieldDict_documentation,
              "List all the source fields on class Neutral::\n"
              "\n"
              ">>> moose.getFieldDict('Neutral', 'srcFinfo')\n"
-             "{'childMsg': 'int'}\n"
+             "    {'childMsg': 'int'}\n"
              "\n"
              "\n");
 PyObject * moose_getFieldDict(PyObject * dummy, PyObject * args)
@@ -2499,16 +2514,114 @@ int defineAllClasses(PyObject * module_dict)
   have to recursively call this function using the base class
   string.
 */
+
 PyDoc_STRVAR(moose_Class_documentation,
              "*-----------------------------------------------------------------*\n"
              "* This is Python generated documentation.                         *\n"
              "* Use moose.doc('classname') to display builtin documentation for *\n"
              "* class `classname`.                                              *\n"
              "* Use moose.doc('classname.fieldname') to display builtin         *\n"
-             "* documentationfor `field` in class `classname`.                  *\n"
+             "* documentation for `field` in class `classname`.                 *\n"
              "*-----------------------------------------------------------------*\n"
             );
 
+int defineLookupFinfos(const Cinfo * cinfo)
+{
+    const string & className = cinfo->name();
+#ifndef NDEBUG
+    if (verbosity > 1)
+    {
+        cout << "\tDefining lookupFields for " << className << endl;
+    }
+#endif
+    unsigned int num = cinfo->getNumLookupFinfo();
+    unsigned int currIndex = get_getsetdefs()[className].size();
+    for (unsigned int ii = 0; ii < num; ++ii)
+    {
+        const string& name = const_cast<Cinfo*>(cinfo)->getLookupFinfo(ii)->name();
+        PyGetSetDef getset;
+        get_getsetdefs()[className].push_back(getset);
+        get_getsetdefs()[className][currIndex].name = (char*)calloc(name.size() + 1, sizeof(char));
+        strncpy(const_cast<char*>(get_getsetdefs()[className][currIndex].name)
+                , const_cast<char*>(name.c_str()), name.size());
+        get_getsetdefs()[className][currIndex].doc = (char*) "Lookup field";
+        get_getsetdefs()[className][currIndex].get = (getter)moose_ObjId_get_lookupField_attr;
+        PyObject * args = PyTuple_New(1);
+        PyTuple_SetItem(args, 0, PyString_FromString(name.c_str()));
+        get_getsetdefs()[className][currIndex].closure = (void*)args;
+#ifndef NDEBUG
+        if (verbosity > 1)
+        {
+            cout << "\tDefined lookupField " << get_getsetdefs()[className][currIndex].name << endl;
+        }
+#endif
+
+        ++currIndex;
+    }
+    return 1;
+}
+
+int defineDestFinfos(const Cinfo * cinfo)
+{
+    const string& className = cinfo->name();
+#ifndef NDEBUG
+    if (verbosity > 1)
+    {
+        cout << "\tCreating destField attributes for " << className << endl;
+    }
+#endif
+    vector <PyGetSetDef>& vec = get_getsetdefs()[className];
+    /*
+      We do not know the final number of user-accessible
+      destFinfos as we have to ignore the destFinfos starting
+      with get/set. So use a vector instead of C array.
+    */
+    size_t currIndex = vec.size();
+    for (unsigned int ii = 0; ii < cinfo->getNumDestFinfo(); ++ii)
+    {
+        Finfo * destFinfo = const_cast<Cinfo*>(cinfo)->getDestFinfo(ii);
+        const string& name = destFinfo->name();
+        /*
+          get_{xyz} and set_{xyz} are internal destFinfos for
+          accessing valueFinfos. Ignore them.
+
+          With the '_' removed from internal get/set for value
+          fields, we cannot separate them out. - Subha Fri Jan 31
+          16:43:51 IST 2014
+
+          The policy changed in the past and hence the following were commented out.
+          - Subha Tue May 26 00:25:28 EDT 2015
+         */
+        // if (name.find("get") == 0 || name.find("set") == 0){
+        //     continue;
+        // }
+        PyGetSetDef destFieldGetSet;
+        vec.push_back(destFieldGetSet);
+
+        vec[currIndex].name = (char*)calloc(name.size() + 1, sizeof(char));
+        strncpy(vec[currIndex].name,
+                const_cast<char*>(name.c_str()),
+                name.size());
+
+        vec[currIndex].doc = (char*) "D_field";
+        vec[currIndex].get = (getter)moose_ObjId_get_destField_attr;
+        PyObject * args = PyTuple_New(1);
+        if (args == NULL)
+        {
+            cerr << "moosemodule.cpp: defineDestFinfos: Failed to allocate tuple" << endl;
+            return 0;
+        }
+        PyTuple_SetItem(args, 0, PyString_FromString(name.c_str()));
+        vec[currIndex].closure = (void*)args;
+
+        //LOG( debug, "\tCreated destField " << vec[currIndex].name );
+
+        ++currIndex;
+    } // ! for
+
+    return 1;
+}
+
 int defineClass(PyObject * module_dict, const Cinfo * cinfo)
 {
     const string& className = cinfo->name();
@@ -2577,7 +2690,7 @@ int defineClass(PyObject * module_dict, const Cinfo * cinfo)
     new_class->tp_name = strdup(str.c_str());
     new_class->tp_doc = moose_Class_documentation;
 
-    // strncpy(new_class->tp_doc, moose_Class_documentation, strlen(moose_Class_documentation));
+    //strncpy(new_class->tp_doc, moose_Class_documentation, strlen(moose_Class_documentation));
     map<string, PyTypeObject *>::iterator base_iter =
         get_moose_classes().find(cinfo->getBaseClass());
     if (base_iter == get_moose_classes().end())
@@ -2682,68 +2795,6 @@ PyObject * moose_ObjId_get_destField_attr(PyObject * self, void * closure)
     return (PyObject*)ret;
 }
 
-
-int defineDestFinfos(const Cinfo * cinfo)
-{
-    const string& className = cinfo->name();
-#ifndef NDEBUG
-    if (verbosity > 1)
-    {
-        cout << "\tCreating destField attributes for " << className << endl;
-    }
-#endif
-    vector <PyGetSetDef>& vec = get_getsetdefs()[className];
-    /*
-      We do not know the final number of user-accessible
-      destFinfos as we have to ignore the destFinfos starting
-      with get/set. So use a vector instead of C array.
-    */
-    size_t currIndex = vec.size();
-    for (unsigned int ii = 0; ii < cinfo->getNumDestFinfo(); ++ii)
-    {
-        Finfo * destFinfo = const_cast<Cinfo*>(cinfo)->getDestFinfo(ii);
-        const string& name = destFinfo->name();
-        /*
-          get_{xyz} and set_{xyz} are internal destFinfos for
-          accessing valueFinfos. Ignore them.
-
-          With the '_' removed from internal get/set for value
-          fields, we cannot separate them out. - Subha Fri Jan 31
-          16:43:51 IST 2014
-
-          The policy changed in the past and hence the following were commented out.
-          - Subha Tue May 26 00:25:28 EDT 2015
-         */
-        // if (name.find("get") == 0 || name.find("set") == 0){
-        //     continue;
-        // }
-        PyGetSetDef destFieldGetSet;
-        vec.push_back(destFieldGetSet);
-
-        vec[currIndex].name = (char*)calloc(name.size() + 1, sizeof(char));
-        strncpy(vec[currIndex].name,
-                const_cast<char*>(name.c_str()),
-                name.size());
-
-        vec[currIndex].doc = (char*) "Destination field";
-        vec[currIndex].get = (getter)moose_ObjId_get_destField_attr;
-        PyObject * args = PyTuple_New(1);
-        if (args == NULL)
-        {
-            cerr << "moosemodule.cpp: defineDestFinfos: Failed to allocate tuple" << endl;
-            return 0;
-        }
-        PyTuple_SetItem(args, 0, PyString_FromString(name.c_str()));
-        vec[currIndex].closure = (void*)args;
-
-        //LOG( debug, "\tCreated destField " << vec[currIndex].name );
-
-        ++currIndex;
-    } // ! for
-
-    return 1;
-}
-
 /**
    Try to obtain a LookupField object for a specified
    lookupFinfo. The first item in `closure` must be the name of
@@ -2796,42 +2847,6 @@ PyObject * moose_ObjId_get_lookupField_attr(PyObject * self,
     return (PyObject*)ret;
 }
 
-int defineLookupFinfos(const Cinfo * cinfo)
-{
-    const string & className = cinfo->name();
-#ifndef NDEBUG
-    if (verbosity > 1)
-    {
-        cout << "\tDefining lookupFields for " << className << endl;
-    }
-#endif
-    unsigned int num = cinfo->getNumLookupFinfo();
-    unsigned int currIndex = get_getsetdefs()[className].size();
-    for (unsigned int ii = 0; ii < num; ++ii)
-    {
-        const string& name = const_cast<Cinfo*>(cinfo)->getLookupFinfo(ii)->name();
-        PyGetSetDef getset;
-        get_getsetdefs()[className].push_back(getset);
-        get_getsetdefs()[className][currIndex].name = (char*)calloc(name.size() + 1, sizeof(char));
-        strncpy(const_cast<char*>(get_getsetdefs()[className][currIndex].name)
-                , const_cast<char*>(name.c_str()), name.size());
-        get_getsetdefs()[className][currIndex].doc = (char*) "Lookup field";
-        get_getsetdefs()[className][currIndex].get = (getter)moose_ObjId_get_lookupField_attr;
-        PyObject * args = PyTuple_New(1);
-        PyTuple_SetItem(args, 0, PyString_FromString(name.c_str()));
-        get_getsetdefs()[className][currIndex].closure = (void*)args;
-#ifndef NDEBUG
-        if (verbosity > 1)
-        {
-            cout << "\tDefined lookupField " << get_getsetdefs()[className][currIndex].name << endl;
-        }
-#endif
-
-        ++currIndex;
-    }
-    return 1;
-}
-
 PyObject * moose_ObjId_get_elementField_attr(PyObject * self,
         void * closure)
 {
@@ -3230,15 +3245,15 @@ PyMODINIT_FUNC MODINIT(_moose)
 
     clock_t defclasses_end = clock();
 
-    LOG( moose::info, "`Time to define moose classes:" 
+    LOG( moose::info, "`Time to define moose classes:"
             << (defclasses_end - defclasses_start) * 1.0 /CLOCKS_PER_SEC
        );
 
     PyGILState_Release(gstate);
     clock_t modinit_end = clock();
 
-    LOG( moose::info, "`Time to initialize module:" 
-            << (modinit_end - modinit_start) * 1.0 /CLOCKS_PER_SEC 
+    LOG( moose::info, "`Time to initialize module:"
+            << (modinit_end - modinit_start) * 1.0 /CLOCKS_PER_SEC
        );
 
     if (doUnitTests)
diff --git a/moose-core/pymoose/pymooseinit.cpp b/moose-core/pymoose/pymooseinit.cpp
index d089447cb62bcfbde7db0a85794a226309f89e56..e5719af645d9544a99985a6478bf8374e0a077a0 100644
--- a/moose-core/pymoose/pymooseinit.cpp
+++ b/moose-core/pymoose/pymooseinit.cpp
@@ -65,7 +65,7 @@ extern unsigned int initMsgManagers();
 extern void destroyMsgManagers();
 // void regressionTests();
 #endif
-extern void speedTestMultiNodeIntFireNetwork( 
+extern void speedTestMultiNodeIntFireNetwork(
 	unsigned int size, unsigned int runsteps );
 
 #ifdef USE_SMOLDYN
@@ -95,7 +95,7 @@ unsigned int getNumCores()
 
 #ifdef MACOSX
 	int mib[4];
-	size_t len = sizeof(numCPU); 
+	size_t len = sizeof(numCPU);
 
 	/* set the mib for hw.ncpu */
 	mib[0] = CTL_HW;
@@ -104,7 +104,7 @@ unsigned int getNumCores()
 	/* get the number of CPUs from the system */
 	sysctl(mib, 2, &numCPU, &len, NULL, 0);
 
-	if( numCPU < 1 ) 
+	if( numCPU < 1 )
 	{
 		mib[1] = HW_NCPU;
 		sysctl( mib, 2, &numCPU, &len, NULL, 0 );
@@ -112,7 +112,7 @@ unsigned int getNumCores()
 #endif
 	if ( numCPU < 1 )
 	{
-#ifndef QUIET_MODE 
+#ifndef QUIET_MODE
 		cout << "No CPU information available. Assuming single core." << endl;
 #else
 #endif
@@ -129,7 +129,7 @@ void checkChildren( Id parent, const string& info )
 {
 	vector< Id > ret;
 	Neutral::children( parent.eref(), ret );
-	cout << info << " checkChildren of " << 
+	cout << info << " checkChildren of " <<
 			parent.element()->getName() << ": " <<
 		ret.size() << " children\n";
 	for ( vector< Id >::iterator i = ret.begin(); i != ret.end(); ++i )
@@ -199,16 +199,16 @@ Id init( int argc, char** argv, bool& doUnitTests, bool& doRegressionTests,
 				exit( 1 );
 		}
 	}
-	if ( myNode == 0 ) 
+	if ( myNode == 0 )
         {
 #ifndef QUIET_MODE
-		cout << "on node " << myNode << ", numNodes = " 
+		cout << "on node " << myNode << ", numNodes = "
                     << numNodes << ", numCores = " << numCores << endl;
 #endif
         }
 
 	Id shellId;
-	Element* shelle = 
+	Element* shelle =
 		new GlobalDataElement( shellId, Shell::initCinfo(), "root", 1 );
 
 	Id clockId = Id::nextId();
@@ -254,7 +254,7 @@ Id init( int argc, char** argv, bool& doUnitTests, bool& doRegressionTests,
 	// SetGet::setShell();
 	// Msg* m = new OneToOneMsg( shelle, shelle );
 	// assert ( m != 0 );
-	
+
 	while ( isInfinite ) // busy loop for debugging under gdb and MPI.
 		;
 
diff --git a/moose-core/pymoose/test_moosemodule.cpp b/moose-core/pymoose/test_moosemodule.cpp
index 922ca59dbc59136c6f2cd185bf94a7731c1ecdd4..5eedaec268b3b4893acc559a491ecd69e5606be0 100644
--- a/moose-core/pymoose/test_moosemodule.cpp
+++ b/moose-core/pymoose/test_moosemodule.cpp
@@ -1,47 +1,47 @@
 // test_moosemodule.cpp --- 
-// 
+//
 // Filename: test_moosemodule.cpp
-// Description: 
-// Author: 
-// Maintainer: 
+// Description:
+// Author:
+// Maintainer:
 // Created: Tue Jul 23 11:37:57 2013 (+0530)
-// Version: 
+// Version:
 // Last-Updated: Thu Jul 25 21:54:10 2013 (+0530)
 //           By: subha
 //     Update #: 85
-// URL: 
-// Keywords: 
-// Compatibility: 
-// 
-// 
-
-// Commentary: 
-// 
-// 
-// 
-// 
+// URL:
+// Keywords:
+// Compatibility:
+//
+//
+
+// Commentary:
+//
+//
+//
+//
 
 // Change log:
-// 
-// 
-// 
-// 
+//
+//
+//
+//
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
 // published by the Free Software Foundation; either version 3, or
 // (at your option) any later version.
-// 
+//
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU General Public License
 // along with this program; see the file COPYING.  If not, write to
 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth
 // Floor, Boston, MA 02110-1301, USA.
-// 
-// 
+//
+//
 
 // Code:
 
@@ -62,7 +62,7 @@ extern "C" {
     void test_to_py()
     {
 #ifdef DO_UNIT_TESTS
-        // conversion of double 
+        // conversion of double
         PyObject * pv;
         double dv = 10.0;
         pv = to_py((void*)&dv, 'd');
@@ -70,7 +70,7 @@ extern "C" {
         assert(PyFloat_AsDouble(pv) == dv);
         Py_XDECREF(pv);
         cout << "." << flush;
-        
+
         // conversion of long
         long lv = 1000000000;
         pv = to_py((void*)&lv, 'l');
@@ -78,7 +78,7 @@ extern "C" {
         assert(PyLong_AsLong(pv) == lv);
         Py_XDECREF(pv);
         cout << "." << flush;
-        
+
         // conversion of int
         int iv = 10;
         pv = to_py((void*)&iv, 'i');
@@ -86,7 +86,7 @@ extern "C" {
         assert(PyInt_AsLong(pv) == iv);
         Py_XDECREF(pv);
         cout << "." << flush;
-        
+
         // conversion of float
         float fv = 7e-3;
         pv = to_py((void*)&fv, 'f');
@@ -94,7 +94,7 @@ extern "C" {
         assert(PyFloat_AsDouble(pv) == fv);
         Py_XDECREF(pv);
         cout << "." << flush;
-        
+
         // string char-array
         string sv = "hello world";
         // C++ string
@@ -103,7 +103,7 @@ extern "C" {
         assert(strcmp(PyString_AsString(pv), sv.c_str()) == 0);
         Py_XDECREF(pv);
         cout << "." << flush;
-        
+
         // Id
         Shell * shell = reinterpret_cast< Shell * >(ObjId( Id(), 0).data());
         Id id = shell->doCreate("Neutral", Id(), "n", 1);
@@ -112,7 +112,7 @@ extern "C" {
         assert(((_Id*)pv)->id_ == id);
         Py_XDECREF(pv);
         cout << "." << flush;
-        
+
         // ObjId
         ObjId oid(id, 0);
         pv = to_py((void*)&oid, 'y');
@@ -132,7 +132,7 @@ extern "C" {
 
 #endif
     }
-    
+
 } // extern "C"
 
 void test_moosemodule()
@@ -140,5 +140,5 @@ void test_moosemodule()
     test_to_py();
 }
 
-// 
+//
 // test_moosemodule.cpp ends here
diff --git a/moose-core/pymoose/vec.cpp b/moose-core/pymoose/vec.cpp
index c178b4bf86086c8dec1635a823b7ea97d250851a..733d28965e96d042c5936c7ef6b6b3f8ef6a4103 100644
--- a/moose-core/pymoose/vec.cpp
+++ b/moose-core/pymoose/vec.cpp
@@ -26,7 +26,7 @@
 // Mon Jul 22 16:47:10 IST 2013 - Splitting contents of
 // moosemodule.cpp into speparate files.
 //
-//
+//c
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
 // published by the Free Software Foundation; either version 3, or
@@ -85,6 +85,11 @@ PyDoc_STRVAR(moose_Id_delete_doc,
              "\nDelete the underlying moose object. This will invalidate all"
              "\nreferences to this object and any attempt to access it will raise a"
              "\nValueError."
+             "\n Example"
+             "\n--------"
+             "\n        >>>iaf.delete()"
+             "\n        >>>print iaf.path"
+             "\n          \\            "
              "\n");
 
 PyDoc_STRVAR(moose_Id_setField_doc,
@@ -97,13 +102,20 @@ PyDoc_STRVAR(moose_Id_setField_doc,
              "fieldname: str\n"
              "    field to be set.\n"
              "value: sequence of values\n"
-             "    sequence of values corresponding to individual elements under this\n"
-             "    vec.\n"
-             "\n"
+             "    sequence of values corresponding to individual elements"
+			    	 "    under this vec.\n"
+             "\n Example"
+             "\n--------"
+             "\n        >>> iaf.setField('Vm', 20)"
+             "\n        >>> print iaf.Vm"
+             "\n            [ 20.  20.  20.  20.  20.  20.  20.  20.  20.  20.]"
+             "\n        >>> iaf.setField('Vm', (1, 2, 3, 4, 5, 6, 7, 8, 9, 10))"
+             "\n        >>> print iaf.Vm"
+             "\n            [  1.   2.   3.   4.   5.   6.   7.   8.   9.  10.]"
              "Notes\n"
              "-----\n"
-             "    This is an interface to SetGet::setVec\n"
-            );
+             "    This is an interface to SetGet::setVec"
+             "\n");
 
 static PyMethodDef IdMethods[] =
 {
@@ -115,15 +127,15 @@ static PyMethodDef IdMethods[] =
     },
     {
         "getValue", (PyCFunction)moose_Id_getValue, METH_NOARGS,
-        "Return integer representation of the id of the element."
+        "Returns integer representation of the id of the element."
     },
     {
         "getPath", (PyCFunction)moose_Id_getPath, METH_NOARGS,
-        "Return the path of this vec object."
+        "Returns the path of this vec object."
     },
     {
         "getShape", (PyCFunction)moose_Id_getShape, METH_NOARGS,
-        "Get the shape of the vec object as a tuple."
+        "Returns the shape of the vec object as a tuple."
     },
     {
         "setField", (PyCFunction)moose_Id_setField, METH_VARARGS,
@@ -166,46 +178,24 @@ PyDoc_STRVAR(moose_Id_doc,
              "\n"
              "array-elements are array-like objects which can have one or more"
              " single-elements within them."
-             " vec can be traversed like a Python sequence and is item is an"
+             " vec can be traversed like a Python sequence and its each item is an"
              " element identifying single-objects contained in the array element.\n"
              "\n"
-             "you can create multiple references to the same MOOSE object in Python,"
-             " but as long as they have the same path/id value, they all point to"
+             "you can create multiple references to the same MOOSE object in Python."
+             " As long as they have the same path/id value, they all point to"
              " the same entity in MOOSE.\n"
              "\n"
              "Field access are vectorized. For example, if `comp` is a vec of"
-             " Compartments, which has a field called `Vm` for membrane voltage, then"
+             " Compartments (of size 10), which has a field called `Vm` as membrane voltage, then"
              " `comp.Vm` returns a"
-             " tuple containing the `Vm` value of all the single-elements in this"
+             " tuple containing the `Vm` value of all 10 single-elements in this"
              " vec. There are a few special fields that are unique for vec and are not"
              " vectorized. These are `path`, `name`, `value`, `shape` and `className`."
-             " There are two ways an vec can be initialized, (1) create a new array"
-             " element or (2) create a reference to an existing object.\n"
-             "\n    Fields:"
-             "\n    -------"
-             "\n    path : str"
-             "\n       Path of the vec. In moose vecs are organized in a tree structure"
-             " like unix file system and the paths follow the same convention."
-             "\n"
-             "\n    name : str"
-             "\n        Name of the vec."
-             "\n"
-             "\n    value : int/long"
-             "\n        Numeric identifier of the vec. This is unique within a single"
-             " execution. vec comparison is based on this value and its hash is also"
-             " this. So you can compare and sort vecs and use them as dict keys."
-             "\n"
-             "\n    shape : tuple of ints"
-             "\n        Dimensions of the vec (as shape in numpy.ndarray). Currently only"
-             " one-dimensional vecs are implemented."
-             "\n"
-             "\n    className: str"
-             "\n         The class of the moose object this vec contains. MOOSE core"
-             " implements its own class system independent of Python. pymoose creates"
-             " thin wrappers around them. This field provides you the moose class"
-             " name as defined in C++"
+             " There are two ways an vec can be initialized, \n"
+             "(1) create a new array element or \n"
+             "(2) create a reference to an existing object.\n"
              "\n"
-             "\n Constructor:"
+             "\n      Constructor:"
              "\n"
              "\n    vec(self, path=path, n=size, g=isGlobal, dtype=className)"
              "\n    "
@@ -214,20 +204,18 @@ PyDoc_STRVAR(moose_Id_doc,
              "\n    ----------"
              "\n    path : str/vec/int "
              "\n        Path of an existing array element or for creating a new one. This has"
-             "\n        the same format as unix file path: /{element1}/{element2} ... If there"
-             "\n        is no object with the specified path, moose attempts to create a new"
-             "\n        array element. For that to succeed everything until the last `/`"
+             "\n        the same format as unix file path: /{element1}/{element2} ... "
+             "\n        If there is no object with the specified path, moose attempts to create "
+             "\n        a new array element. For that to succeed everything until the last `/`"
              "\n        character must exist or an error is raised"
              "\n"
-             "\n        Alternatively, path can be vec or integer value of the id of an"
+             "\n        Alternatively, path can be vec or integer value of the Id of an"
              "\n        existing vec object. The new object will be another reference to"
              "\n        the existing object."
              "\n    "
              "\n    n : positive int"
              "\n        This is a positive integers specifying the size of the array element"
-             "\n        to be created. Thus n=2 will create an"
-             "\n        vec with 2 elements."
-             "\n    "
+             "\n        to be created. Thus n=2 will create an vec with 2 elements."
              "\n    "
              "\n    g : int"
              "\n        Specify if this is a global or local element. Global elements are"
@@ -236,15 +224,39 @@ PyDoc_STRVAR(moose_Id_doc,
              "\n    dtype: string"
              "\n        The vector will be of this moose-class."
              "\n    "
+             "\n    Attributes:"
+             "\n    -----------"
+             "\n    path : str"
+             "\n       Path of the vec. In moose vecs are organized in a tree structure"
+             " like unix file system and the paths follow the same convention."
+             "\n"
+             "\n    name : str"
+             "\n        Name of the vec."
+             "\n"
+             "\n    value : int/long"
+             "\n        Numeric identifier of the vec. This is unique within a single"
+             " execution. vec comparison is based on this value and its hash is also"
+             " this. So you can compare and sort vecs and use them as dict keys."
+             "\n"
+             "\n    shape : tuple of ints"
+             "\n        Dimensions of the vec (as shape in numpy.ndarray). Currently only"
+             " one-dimensional vecs are implemented."
+             "\n"
+             "\n    className: str"
+             "\n         The class of the moose object this vec contains. MOOSE core"
+             " implements its own class system independent of Python. pymoose creates"
+             " thin wrappers around them. This field provides you the moose class"
+             " name as defined in C++"
+             "\n"
              "\n    "
              "\n    Examples"
              "\n    ---------"
              "\n        >>> iaf = moose.vec('/iaf', n=10, dtype='IntFire')"
              "\n        >>> iaf.Vm = range(10)"
              "\n        >>> print iaf[5].Vm"
-             "\n        5.0"
+             "\n            5.0"
              "\n        >>> print iaf.Vm"
-             "\n        array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9.])"
+             "\n            array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9.])"
             );
 
 PyTypeObject IdType =
diff --git a/moose-core/python/moose/SBML/readSBML.py b/moose-core/python/moose/SBML/readSBML.py
index 255d96783e4d576b8cbc1430b1d2ba10898b08f3..801d3681ec23536b60dce134f2faa67480c70571 100644
--- a/moose-core/python/moose/SBML/readSBML.py
+++ b/moose-core/python/moose/SBML/readSBML.py
@@ -13,8 +13,7 @@
 **           copyright (C) 2003-2017 Upinder S. Bhalla. and NCBS
 Created : Thu May 12 10:19:00 2016(+0530)
 Version
-Last-Updated: Mon Apr 3 15:50:00 2017(+0530)
-
+Last-Updated: Wed Jan 11 2017
           By:
 **********************************************************************/
 
@@ -24,15 +23,15 @@ import sys
 import os.path
 import collections
 import moose
+from validation import validateModel
 
-from moose.SBML.validation import validateModel
-
-import re
 '''
    TODO in
     -Compartment
+      --Need to add group
       --Need to deal with compartment outside
     -Molecule
+      -- Need to add group
       -- mathML only AssisgmentRule is taken partly I have checked addition and multiplication,
        --, need to do for other calculation.
        -- In Assisgment rule one of the variable is a function, in moose since assignment is done using function,
@@ -63,15 +62,13 @@ def mooseReadSBML(filepath, loadpath, solver="ee"):
     if not foundLibSBML_:
         print('No python-libsbml found.' 
             '\nThis module can be installed by following command in terminal:'
-            '\n\t easy_install python-libsbml'
-            '\n\t apt-get install python-libsbml'
+            '\n\t easy_install python-libsbl'
             )
-        return moose.element('/')
+        return None
 
     if not os.path.isfile(filepath):
         print('%s is not found ' % filepath)
-        return moose.element('/')
-
+        return None
 
     with open(filepath, "r") as filep:
         filep = open(filepath, "r")
@@ -119,10 +116,10 @@ def mooseReadSBML(filepath, loadpath, solver="ee"):
                     return moose.element('/')
                 else:
                     baseId = moose.Neutral(loadpath)
-                    basePath = baseId
                     # All the model will be created under model as
                     # a thumbrule
-                    basePath = moose.Neutral(baseId.path + '/model')
+                    basePath = moose.Neutral(
+                        baseId.path + '/model')
                     # Map Compartment's SBML id as key and value is
                     # list of[ Moose ID and SpatialDimensions ]
                     global comptSbmlidMooseIdMap
@@ -130,31 +127,26 @@ def mooseReadSBML(filepath, loadpath, solver="ee"):
                     warning = " "
                     global msg
                     msg = " "
-                    groupInfo  = {}
-                    modelAnnotaInfo = {}
                     comptSbmlidMooseIdMap = {}
+                    #print(("modelPath:" + basePath.path))
                     globparameterIdValue = {}
-
+                    modelAnnotaInfo = {}
                     mapParameter(model, globparameterIdValue)
                     errorFlag = createCompartment(
                         basePath, model, comptSbmlidMooseIdMap)
-
-                    groupInfo = checkGroup(basePath,model)                        
                     if errorFlag:
                         specInfoMap = {}
                         errorFlag,warning = createSpecies(
-                            basePath, model, comptSbmlidMooseIdMap, specInfoMap, modelAnnotaInfo,groupInfo)
+                            basePath, model, comptSbmlidMooseIdMap, specInfoMap, modelAnnotaInfo)
                         #print(errorFlag,warning)
-                        
                         if errorFlag:
                             errorFlag = createRules(
                                 model, specInfoMap, globparameterIdValue)
                             if errorFlag:
                                 errorFlag, msg = createReaction(
-                                    model, specInfoMap, modelAnnotaInfo, globparameterIdValue,groupInfo)
+                                    model, specInfoMap, modelAnnotaInfo, globparameterIdValue)
                         getModelAnnotation(
                             model, baseId, basePath)
-                        
                     if not errorFlag:
                         print(msg)
                         # Any time in the middle if SBML does not read then I
@@ -169,37 +161,7 @@ def mooseReadSBML(filepath, loadpath, solver="ee"):
             print("Validation failed while reading the model.")
             return moose.element('/')
 
-def checkGroup(basePath,model):
-    groupInfo = {}
-    modelAnnotaInfo = {}
-    if model.getPlugin("groups") != None:
-        mplugin = model.getPlugin("groups")
-        modelgn = mplugin.getNumGroups()
-        for gindex in range(0, mplugin.getNumGroups()):
-            p = mplugin.getGroup(gindex)
-            groupAnnoInfo = {}
-            groupAnnoInfo = getObjAnnotation(p, modelAnnotaInfo)
-            if moose.exists(basePath.path+'/'+groupAnnoInfo["Compartment"]):
-                if not moose.exists(basePath.path+'/'+groupAnnoInfo["Compartment"]+'/'+p.getId()):
-                    moosegrp = moose.Neutral(basePath.path+'/'+groupAnnoInfo["Compartment"]+'/'+p.getId())
-                else:
-                    moosegrp = moose.element(basePath.path+'/'+groupAnnoInfo["Compartment"]+'/'+p.getId())
-                moosegrpinfo = moose.Annotator(moosegrp.path+'/info')
-                moosegrpinfo.color = groupAnnoInfo["bgColor"]
-            else:
-                print ("Compartment not found")
 
-            if p.getKind() == 2:
-                if p.getId() not in groupInfo:
-                    #groupInfo[p.getId()]
-                    for gmemIndex in range(0,p.getNumMembers()):
-                        mem = p.getMember(gmemIndex)
-
-                        if p.getId() in groupInfo:
-                            groupInfo[p.getId()].append(mem.getIdRef())
-                        else:
-                            groupInfo[p.getId()] =[mem.getIdRef()]
-    return groupInfo
 def setupEnzymaticReaction(enz, groupName, enzName,
                            specInfoMap, modelAnnotaInfo):
     enzPool = (modelAnnotaInfo[groupName]["enzyme"])
@@ -208,6 +170,7 @@ def setupEnzymaticReaction(enz, groupName, enzName,
     cplx = (modelAnnotaInfo[groupName]["complex"])
     cplx = str(idBeginWith(cplx))
     complx = moose.element(specInfoMap[cplx]["Mpath"].path)
+
     enzyme_ = moose.Enz(enzParent.path + '/' + enzName)
     moose.move(complx, enzyme_)
     moose.connect(enzyme_, "cplx", complx, "reac")
@@ -323,7 +286,7 @@ def getModelAnnotation(obj, baseId, basepath):
                                 for plots in plotlist:
                                     plots = plots.replace(" ", "")
                                     plotorg = plots
-                                    if( moose.exists(basepath.path + plotorg) and isinstance(moose.element(basepath.path+plotorg),moose.PoolBase)) :
+                                    if moose.exists(basepath.path + plotorg):
                                         plotSId = moose.element(
                                             basepath.path + plotorg)
                                         # plotorg = convertSpecialChar(plotorg)
@@ -338,7 +301,8 @@ def getModelAnnotation(obj, baseId, basepath):
                                         if not fullPath in tablelistname:
                                             tab = moose.Table2(fullPath)
                                             tablelistname.append(fullPath)
-                                            moose.connect(tab, "requestOut", plotSId, "getConc")
+                                            moose.connect(
+                                                tab, "requestOut", plotSId, "getConc")
 
 
 def getObjAnnotation(obj, modelAnnotationInfo):
@@ -347,11 +311,11 @@ def getObjAnnotation(obj, modelAnnotationInfo):
     # modelAnnotaInfo= {}
     annotateMap = {}
     if (obj.getAnnotation() is not None):
-
         annoNode = obj.getAnnotation()
         for ch in range(0, annoNode.getNumChildren()):
             childNode = annoNode.getChild(ch)
-            if (childNode.getPrefix() == "moose" and (childNode.getName() in["ModelAnnotation","EnzymaticReaction","GroupAnnotation"])):
+            if (childNode.getPrefix() == "moose" and (childNode.getName() ==
+                                                      "ModelAnnotation" or childNode.getName() == "EnzymaticReaction")):
                 sublist = []
                 for gch in range(0, childNode.getNumChildren()):
                     grandChildNode = childNode.getChild(gch)
@@ -371,10 +335,6 @@ def getObjAnnotation(obj, modelAnnotationInfo):
                         annotateMap[nodeName] = nodeValue
                     if nodeName == "textColor":
                         annotateMap[nodeName] = nodeValue
-                    if nodeName == "Group":
-                        annotateMap[nodeName] = nodeValue
-                    if nodeName == "Compartment":
-                        annotateMap[nodeName] = nodeValue
     return annotateMap
 
 
@@ -480,7 +440,7 @@ def getEnzAnnotation(obj, modelAnnotaInfo, rev,
     return(groupName)
 
 
-def createReaction(model, specInfoMap, modelAnnotaInfo, globparameterIdValue,groupInfo):
+def createReaction(model, specInfoMap, modelAnnotaInfo, globparameterIdValue):
     # print " reaction "
     # Things done for reaction
     # --Reaction is not created, if substrate and product is missing
@@ -499,19 +459,9 @@ def createReaction(model, specInfoMap, modelAnnotaInfo, globparameterIdValue,gro
     for ritem in range(0, model.getNumReactions()):
         reactionCreated = False
         groupName = ""
-
         reac = model.getReaction(ritem)
-        group = ""
-        reacAnnoInfo = {}
-        reacAnnoInfo = getObjAnnotation(reac, modelAnnotaInfo)
-        # if "Group" in reacAnnoInfo:
-        #     group = reacAnnoInfo["Group"]
-        
         if (reac.isSetId()):
             rId = reac.getId()
-            groups = [k for k, v in groupInfo.iteritems() if rId in v]
-            if groups:
-                group = groups[0] 
         if (reac.isSetName()):
             rName = reac.getName()
             rName = rName.replace(" ", "_space_")
@@ -579,11 +529,6 @@ def createReaction(model, specInfoMap, modelAnnotaInfo, globparameterIdValue,gro
                     sp = react.getSpecies()
                     sp = str(idBeginWith(sp))
                     speCompt = specInfoMap[sp]["comptId"].path
-                    if group:
-                        if moose.exists(speCompt+'/'+group):
-                            speCompt = speCompt+'/'+group
-                        else:
-                            speCompt = (moose.Neutral(speCompt+'/'+group)).path
                     reaction_ = moose.Reac(speCompt + '/' + rName)
                     reactionCreated = True
                     reactSBMLIdMooseId[rName] = {
@@ -813,12 +758,10 @@ def createRules(model, specInfoMap, globparameterIdValue):
             exp = rule.getFormula()
             for mem in ruleMemlist:
                 if (mem in specInfoMap):
-                    #exp1 = exp.replace(mem, str(speFunXterm[mem]))
-                    exp1 = re.sub(r'\b%s\b'% (mem), speFunXterm[mem], exp)
+                    exp1 = exp.replace(mem, str(speFunXterm[mem]))
                     exp = exp1
                 elif(mem in globparameterIdValue):
-                    #exp1 = exp.replace(mem, str(globparameterIdValue[mem]))
-                    exp1 = re.sub(r'\b%s\b'% (mem), globparameterIdValue[mem], exp)
+                    exp1 = exp.replace(mem, str(globparameterIdValue[mem]))
                     exp = exp1
                 else:
                     print("Math expression need to be checked")
@@ -857,7 +800,7 @@ def pullnotes(sbmlId, mooseId):
 
 
 def createSpecies(basePath, model, comptSbmlidMooseIdMap,
-                  specInfoMap, modelAnnotaInfo,groupInfo):
+                  specInfoMap, modelAnnotaInfo):
     # ToDo:
     # - Need to add group name if exist in pool
     # - Notes
@@ -867,19 +810,8 @@ def createSpecies(basePath, model, comptSbmlidMooseIdMap,
     else:
         for sindex in range(0, model.getNumSpecies()):
             spe = model.getSpecies(sindex)
-            group = ""
-            specAnnoInfo = {}
-            specAnnoInfo = getObjAnnotation(spe, modelAnnotaInfo)
-
-            # if "Group" in specAnnoInfo:
-            #     group = specAnnoInfo["Group"]
-            
             sName = None
             sId = spe.getId()
-
-            groups = [k for k, v in groupInfo.iteritems() if sId in v]
-            if groups:
-                group = groups[0] 
             if spe.isSetName():
                 sName = spe.getName()
                 sName = sName.replace(" ", "_space_")
@@ -896,11 +828,7 @@ def createSpecies(basePath, model, comptSbmlidMooseIdMap,
             hasonlySubUnit = spe.getHasOnlySubstanceUnits()
             # "false": is {unit of amount}/{unit of size} (i.e., concentration or density).
             # "true": then the value is interpreted as having a unit of amount only.
-            if group:
-                if moose.exists(comptEl+'/'+group):
-                    comptEl = comptEl+'/'+group
-                else:
-                    comptEl = (moose.Neutral(comptEl+'/'+group)).path
+
             if (boundaryCondition):
                 poolId = moose.BufPool(comptEl + '/' + sName)
             else:
@@ -908,13 +836,13 @@ def createSpecies(basePath, model, comptSbmlidMooseIdMap,
 
             if (spe.isSetNotes):
                 pullnotes(spe, poolId)
-            
+            specAnnoInfo = {}
+            specAnnoInfo = getObjAnnotation(spe, modelAnnotaInfo)
             if specAnnoInfo:
                 if not moose.exists(poolId.path + '/info'):
                     poolInfo = moose.Annotator(poolId.path + '/info')
                 else:
                     poolInfo = moose.element(poolId.path + '/info')
-
                 for k, v in list(specAnnoInfo.items()):
                     if k == 'xCord':
                         poolInfo.x = float(v)
@@ -976,7 +904,6 @@ def createSpecies(basePath, model, comptSbmlidMooseIdMap,
                         if (rule_variable == sId):
                             found = True
                             break
-                
                 if not (found):
                     print(
                         "Invalid SBML: Either initialConcentration or initialAmount must be set or it should be found in assignmentRule but non happening for ",
@@ -1206,4 +1133,4 @@ if __name__ == "__main__":
             if read:
                 print(" Model read to moose path "+ modelpath)
             else:
-                print(" could not read  SBML to MOOSE")
+                print(" could not read  SBML to MOOSE")
\ No newline at end of file
diff --git a/moose-core/python/moose/SBML/writeSBML.py b/moose-core/python/moose/SBML/writeSBML.py
index 1727d6e6aa969ed570e8fbccaba339cd0187f071..bcfaf2eb2824b52337fd8b058f7b2dd5ba4d5fc8 100644
--- a/moose-core/python/moose/SBML/writeSBML.py
+++ b/moose-core/python/moose/SBML/writeSBML.py
@@ -12,7 +12,7 @@
 **           copyright (C) 2003-2017 Upinder S. Bhalla. and NCBS
 Created : Friday May 27 12:19:00 2016(+0530)
 Version
-Last-Updated: Tue Apr 4 14:20:00 2017(+0530)
+Last-Updated: Wed Jan 11 15:20:00 2017(+0530)
           By:
 **********************************************************************/
 /****************************
@@ -21,14 +21,16 @@ Last-Updated: Tue Apr 4 14:20:00 2017(+0530)
 import sys
 import re
 from collections import Counter
+
 import moose
-from moose.SBML.validation import validateModel
+from validation import validateModel
 from moose.chemUtil.chemConnectUtil import *
 from moose.chemUtil.graphUtils import *
 
 
 # ToDo:
 #   Table should be written
+#   Group's should be added
 # boundary condition for buffer pool having assignment statment constant
 # shd be false
 
@@ -45,12 +47,11 @@ def mooseWriteSBML(modelpath, filename, sceneitems={}):
     if not foundLibSBML_:
         print('No python-libsbml found.' 
             '\nThis module can be installed by following command in terminal:'
-            '\n\t easy_install python-libsbml or'
-            '\n\t apt-get install python-libsbml'
+            '\n\t easy_install python-libsbml'
             )
-        return -2, "Could not save the model in to SBML file. \nThis module can be installed by following command in terminal: \n\t easy_install python-libsbml or \n\t apt-get install python-libsbml",''
+        return -1, msg
 
-    #sbmlDoc = SBMLDocument(3, 1)
+    sbmlDoc = SBMLDocument(3, 1)
     filepath, filenameExt = os.path.split(filename)
     if filenameExt.find('.') != -1:
         filename = filenameExt[:filenameExt.find('.')]
@@ -64,22 +65,16 @@ def mooseWriteSBML(modelpath, filename, sceneitems={}):
     global nameList_
     nameList_ = []
     positionInfoexist = False
-    
-    xmlns = SBMLNamespaces(3, 1)
-    xmlns.addNamespace("http://www.w3.org/1999/xhtml", "xhtml")
-    xmlns.addNamespace("http://www.moose.ncbs.res.in", "moose")
-    xmlns.addNamespace("http://www.sbml.org/sbml/level3/version1/groups/version1", "groups")
-    sbmlDoc = SBMLDocument(xmlns)
-    sbmlDoc.setPackageRequired("groups",bool(0))
-    
+    xmlns = XMLNamespaces()
+    xmlns.add("http://www.sbml.org/sbml/level3/version1")
+    xmlns.add("http://www.moose.ncbs.res.in", "moose")
+    xmlns.add("http://www.w3.org/1999/xhtml", "xhtml")
+    sbmlDoc.setNamespaces(xmlns)
     cremodel_ = sbmlDoc.createModel()
     cremodel_.setId(filename)
-    cremodel_.setTimeUnits("time")
+    cremodel_.setTimeUnits("second")
     cremodel_.setExtentUnits("substance")
     cremodel_.setSubstanceUnits("substance")
-    cremodel_.setVolumeUnits("volume")
-    cremodel_.setAreaUnits("area")
-    cremodel_.setLengthUnits("length")
     neutralNotes = ""
 
     specieslist = moose.wildcardFind(modelpath + '/##[ISA=PoolBase]')
@@ -106,36 +101,14 @@ def mooseWriteSBML(modelpath, filename, sceneitems={}):
     modelAnno = writeSimulationAnnotation(modelpath)
     if modelAnno:
         cremodel_.setAnnotation(modelAnno)
-    groupInfo = {}
-    compartexist, groupInfo = writeCompt(modelpath, cremodel_)
-    
+
+    compartexist = writeCompt(modelpath, cremodel_)
     if compartexist == True:
-        species = writeSpecies( modelpath,cremodel_,sbmlDoc,sceneitems,groupInfo)
+        species = writeSpecies( modelpath,cremodel_,sbmlDoc,sceneitems)
         if species:
             writeFunc(modelpath, cremodel_)
-        reacGroup = {}
-        writeReac(modelpath, cremodel_, sceneitems,groupInfo)
-        writeEnz(modelpath, cremodel_, sceneitems,groupInfo)
-        if groupInfo:
-            for key,value in groupInfo.items():
-                mplugin = cremodel_.getPlugin("groups")
-                group = mplugin.createGroup()
-                name = moose.element(key).name
-                group.setId(name)
-                group.setKind("collection")
-                ginfo = moose.element(key.path+'/info')
-                groupCompartment = findCompartment(key)
-                if ginfo.color != '':
-                    grpAnno = "<moose:GroupAnnotation>"
-                    grpAnno = grpAnno + "<moose:Compartment>" + groupCompartment.name + "</moose:Compartment>\n"
-                    if ginfo.color:
-                        grpAnno = grpAnno + "<moose:bgColor>" + ginfo.color + "</moose:bgColor>\n"
-                    grpAnno = grpAnno + "</moose:GroupAnnotation>"
-                    group.setAnnotation(grpAnno)
-
-                for values in value:
-                    member = group.createMember()
-                    member.setIdRef(values)
+        writeReac(modelpath, cremodel_, sceneitems)
+        writeEnz(modelpath, cremodel_, sceneitems)
         consistencyMessages = ""
         SBMLok = validateModel(sbmlDoc)
         if (SBMLok):
@@ -153,7 +126,7 @@ def calPrime(x):
     prime = int((20 * (float(x - cmin) / float(cmax - cmin))) - 10)
     return prime
 
-def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
+def writeEnz(modelpath, cremodel_, sceneitems):
     for enz in moose.wildcardFind(modelpath + '/##[ISA=EnzBase]'):
         enzannoexist = False
         enzGpnCorCol = " "
@@ -161,25 +134,17 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
         enzSubt = ()
         compt = ""
         notesE = ""
-        
         if moose.exists(enz.path + '/info'):
-            groupName = moose.element("/")
             Anno = moose.Annotator(enz.path + '/info')
             notesE = Anno.notes
             element = moose.element(enz)
             ele = getGroupinfo(element)
-            ele = findGroup_compt(element)
-            if ele.className == "Neutral" or sceneitems or Anno.x or Anno.y:
+            if element.className == "Neutral" or sceneitems or Anno.x or Anno.y:
                     enzannoexist = True
             if enzannoexist:
                 enzAnno = "<moose:ModelAnnotation>\n"
                 if ele.className == "Neutral":
-                    groupName = ele
-                    #enzGpnCorCol =  "<moose:Group>" + ele.name + "</moose:Group>\n"
-                    # if ele.name not in groupInfo:
-                    #         groupInfo[ele.name]=[setId]
-                    #     else:
-                    #         groupInfo[ele.name].append(setId)
+                    enzGpnCorCol =  "<moose:Group>" + ele.name + "</moose:Group>\n"
                 if sceneitems:
                     #Saved from GUI, then scene co-ordinates are passed
                     enzGpnCorCol = enzGpnCorCol + "<moose:xCord>" + \
@@ -199,6 +164,7 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
                 if Anno.textColor:
                     enzGpnCorCol = enzGpnCorCol + "<moose:textColor>" + \
                         Anno.textColor + "</moose:textColor>\n"
+
         if (enz.className == "Enz" or enz.className == "ZombieEnz"):
             enzyme = cremodel_.createReaction()
             if notesE != "":
@@ -213,20 +179,14 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
                 compt = comptVec.name + "_" + \
                     str(comptVec.getId().value) + "_" + \
                     str(comptVec.getDataIndex()) + "_"
-            enzsetId = str(idBeginWith(cleanEnzname +
+
+            enzyme.setId(str(idBeginWith(cleanEnzname +
                                          "_" +
                                          str(enz.getId().value) +
                                          "_" +
                                          str(enz.getDataIndex()) +
                                          "_" +
-                                         "Complex_formation_"))
-            enzyme.setId(enzsetId)
-            
-            if groupName != moose.element('/'):
-                if groupName not in groupInfo:
-                    groupInfo[groupName]=[enzsetId]
-                else:
-                    groupInfo[groupName].append(enzsetId)
+                                         "Complex_formation_")))
             enzyme.setName(cleanEnzname)
             enzyme.setFast(False)
             enzyme.setReversible(True)
@@ -267,7 +227,7 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
                 noofSub, sRateLaw = getSubprd(cremodel_, True, "sub", enzSubt)
                 #rec_order = rec_order + noofSub
                 rec_order = noofSub
-                rate_law = compt + " * ( " + rate_law + " * " + sRateLaw
+                rate_law = compt + " * " + rate_law + "*" + sRateLaw
 
             enzPrd = enz.neighbors["cplxDest"]
             if not enzPrd:
@@ -277,7 +237,7 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
                 for i in range(0, len(nameList_)):
                     enzAnno = enzAnno + "<moose:product>" + \
                         nameList_[i] + "</moose:product>\n"
-                rate_law = rate_law + " - " + " k2 " + ' * ' + sRateLaw +" )"
+                rate_law = rate_law + " - " + compt + "* k2" + '*' + sRateLaw
 
             prd_order = noofPrd
             enzAnno = enzAnno + "<moose:groupName>" + cleanEnzname + "_" + \
@@ -300,21 +260,14 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
             unit = parmUnit(rec_order - 1, cremodel_)
             printParameters(kl, "k1", k1, unit)
             enzyme = cremodel_.createReaction()
-            enzsetIdP = str(idBeginWith(cleanEnzname +
+            enzyme.setId(str(idBeginWith(cleanEnzname +
                                          "_" +
                                          str(enz.getId().value) +
                                          "_" +
                                          str(enz.getDataIndex()) +
                                          "_" +
-                                         "Product_formation_"))
-            enzyme.setId(enzsetIdP)
+                                         "Product_formation_")))
             enzyme.setName(cleanEnzname)
-            if groupName != moose.element('/'):
-                if groupName not in groupInfo:
-                    groupInfo[groupName]=[enzsetIdP]
-                else:
-                    groupInfo[groupName].append(enzsetIdP)
-
             enzyme.setFast(False)
             enzyme.setReversible(False)
             enzAnno2 = "<moose:EnzymaticReaction>"
@@ -364,7 +317,6 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
             printParameters(kl, "k3", k3, unit)
 
         elif(enz.className == "MMenz" or enz.className == "ZombieMMenz"):
-
             enzSub = enz.neighbors["sub"]
             enzPrd = enz.neighbors["prd"]
             if (len(enzSub) != 0 and len(enzPrd) != 0):
@@ -382,18 +334,12 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
                     notesStringE = "<body xmlns=\"http://www.w3.org/1999/xhtml\">\n \t \t" + \
                         cleanNotesE + "\n\t </body>"
                     enzyme.setNotes(notesStringE)
-                mmenzsetId = str(idBeginWith(cleanEnzname +
+                enzyme.setId(str(idBeginWith(cleanEnzname +
                                              "_" +
                                              str(enz.getId().value) +
                                              "_" +
                                              str(enz.getDataIndex()) +
-                                             "_"))
-                enzyme.setId(mmenzsetId)
-                if groupName != moose.element('/'):
-                    if groupName not in groupInfo:
-                        groupInfo[groupName]=[mmenzsetId]
-                    else:
-                        groupInfo[groupName].append(mmenzsetId)
+                                             "_")))
                 enzyme.setName(cleanEnzname)
                 enzyme.setFast(False)
                 enzyme.setReversible(True)
@@ -413,15 +359,14 @@ def writeEnz(modelpath, cremodel_, sceneitems,groupInfo):
                 enzPrd = enz.neighbors["prd"]
                 noofPrd, sRateLawP = getSubprd(cremodel_, False, "prd", enzPrd)
                 kl = enzyme.createKineticLaw()
-                fRate_law = compt + " * ( kcat * " + sRateLawS + " * " + sRateLawM + \
-                    " / ( Km" + " + " + sRateLawS + "))"
+                fRate_law = "kcat *" + sRateLawS + "*" + sRateLawM + \
+                    "/(" + compt + " * (" + "Km" + "+" + sRateLawS + "))"
                 kl.setFormula(fRate_law)
                 kl.setNotes(
                     "<body xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t" +
                     fRate_law +
                     "\n \t </body>")
-                KmUnit(cremodel_)
-                printParameters(kl, "Km", Km, "mmole_per_litre")
+                printParameters(kl, "Km", Km, "substance")
                 kcatUnit = parmUnit(0, cremodel_)
                 printParameters(kl, "kcat", kcat, kcatUnit)
 
@@ -432,29 +377,6 @@ def printParameters(kl, k, kvalue, unit):
     para.setValue(kvalue)
     para.setUnits(unit)
 
-def KmUnit(cremodel_):
-    unit_stream = "mmole_per_litre"
-    lud = cremodel_.getListOfUnitDefinitions()
-    flag = False
-    for i in range(0, len(lud)):
-        ud = lud.get(i)
-        if (ud.getId() == unit_stream):
-            flag = True
-            break
-    if (not flag):
-        unitdef = cremodel_.createUnitDefinition()
-        unitdef.setId(unit_stream)
-        unit = unitdef.createUnit()
-        unit.setKind(UNIT_KIND_LITRE)
-        unit.setExponent(-1)
-        unit.setMultiplier(1)
-        unit.setScale(0)
-        unit = unitdef.createUnit()
-        unit.setKind(UNIT_KIND_MOLE)
-        unit.setExponent(1)
-        unit.setMultiplier(1)
-        unit.setScale(-3)
-    return unit_stream
 
 def parmUnit(rct_order, cremodel_):
     order = rct_order
@@ -463,7 +385,7 @@ def parmUnit(rct_order, cremodel_):
     elif order == 1:
         unit_stream = "litre_per_mmole_per_second"
     elif order == 2:
-        unit_stream = "sq_litre_per_mmole_sq_per_second"
+        unit_stream = "litre_per_mmole_sq_per_second"
     else:
         unit_stream = "litre_per_mmole_" + str(rct_order) + "_per_second"
 
@@ -482,7 +404,7 @@ def parmUnit(rct_order, cremodel_):
         if order != 0:
             unit = unitdef.createUnit()
             unit.setKind(UNIT_KIND_LITRE)
-            unit.setExponent(order)
+            unit.setExponent(1)
             unit.setMultiplier(1)
             unit.setScale(0)
             unit = unitdef.createUnit()
@@ -584,7 +506,7 @@ def listofname(reacSub, mobjEnz):
             nameList_.append(clean_name)
 
 
-def writeReac(modelpath, cremodel_, sceneitems,reacGroup):
+def writeReac(modelpath, cremodel_, sceneitems):
     for reac in moose.wildcardFind(modelpath + '/##[ISA=ReacBase]'):
         reacSub = reac.neighbors["sub"]
         reacPrd = reac.neighbors["prd"]
@@ -594,13 +516,12 @@ def writeReac(modelpath, cremodel_, sceneitems,reacGroup):
             reacannoexist = False
             reacGpname = " "
             cleanReacname = convertSpecialChar(reac.name)
-            setId = str(idBeginWith(cleanReacname +
+            reaction.setId(str(idBeginWith(cleanReacname +
                                            "_" +
                                            str(reac.getId().value) +
                                            "_" +
                                            str(reac.getDataIndex()) +
-                                           "_"))
-            reaction.setId(setId)
+                                           "_")))
             reaction.setName(cleanReacname)
             #Kf = reac.numKf
             #Kb = reac.numKb
@@ -626,11 +547,7 @@ def writeReac(modelpath, cremodel_, sceneitems,reacGroup):
                 if reacannoexist:
                     reacAnno = "<moose:ModelAnnotation>\n"
                     if ele.className == "Neutral":
-                        #reacAnno = reacAnno + "<moose:Group>" + ele.name + "</moose:Group>\n"
-                        if ele not in reacGroup:
-                            reacGroup[ele]=[setId]
-                        else:
-                            reacGroup[ele].append(setId)
+                        reacAnno = reacAnno + "<moose:Group>" + ele.name + "</moose:Group>\n"
                     if sceneitems:
                         #Saved from GUI, then scene co-ordinates are passed
                         reacAnno = reacAnno + "<moose:xCord>" + \
@@ -711,7 +628,6 @@ def writeReac(modelpath, cremodel_, sceneitems,reacGroup):
                 kl_s +
                 "\n \t </body>")
             kfl.setFormula(kl_s)
-
         else:
             print(" Reaction ", reac.name, "missing substrate and product")
 
@@ -750,6 +666,7 @@ def writeFunc(modelpath, cremodel_):
             rule.setVariable(fName)
             rule.setFormula(expr)
 
+
 def convertNotesSpecialChar(str1):
     d = {"&": "_and", "<": "_lessthan_", ">": "_greaterthan_", "BEL": "&#176"}
     for i, j in d.items():
@@ -758,6 +675,7 @@ def convertNotesSpecialChar(str1):
     str1 = str1.strip(' \t\n\r')
     return str1
 
+
 def getGroupinfo(element):
     #   Note: At this time I am assuming that if group exist (incase of Genesis)
     #   1. for 'pool' its between compartment and pool, /modelpath/Compartment/Group/pool
@@ -766,7 +684,8 @@ def getGroupinfo(element):
     #   if /modelpath/Compartment/Group/Group1/Pool, then I check and get Group1
     #   And /modelpath is also a NeutralObject,I stop till I find Compartment
 
-    while not mooseIsInstance(element, ["Neutral", "CubeMesh", "CyclMesh"]):
+    while not mooseIsInstance(element, ["Neutral"]) and not mooseIsInstance(
+            element, ["CubeMesh", "CyclMesh"]):
         element = element.parent
     return element
 
@@ -787,10 +706,6 @@ def idBeginWith(name):
         changedName = "_" + name
     return changedName
 
-def findGroup_compt(melement):
-    while not (mooseIsInstance(melement, ["Neutral","CubeMesh", "CyclMesh"])):
-        melement = melement.parent
-    return melement
 
 def convertSpecialChar(str1):
     d = {"&": "_and", "<": "_lessthan_", ">": "_greaterthan_", "BEL": "&#176", "-": "_minus_", "'": "_prime_",
@@ -802,7 +717,7 @@ def convertSpecialChar(str1):
     return str1
 
 
-def writeSpecies(modelpath, cremodel_, sbmlDoc, sceneitems,speGroup):
+def writeSpecies(modelpath, cremodel_, sbmlDoc, sceneitems):
     # getting all the species
     for spe in moose.wildcardFind(modelpath + '/##[ISA=PoolBase]'):
         sName = convertSpecialChar(spe.name)
@@ -882,13 +797,7 @@ def writeSpecies(modelpath, cremodel_, sbmlDoc, sceneitems,speGroup):
                 if speciannoexist:
                     speciAnno = "<moose:ModelAnnotation>\n"
                     if ele.className == "Neutral":
-                        #speciAnno = speciAnno + "<moose:Group>" + ele.name + "</moose:Group>\n"
-                        if ele not in speGroup:
-                            speGroup[ele]=[spename]
-                        else:
-                            speGroup[ele].append(spename)
-                        
-                        
+                        speciAnno = speciAnno + "<moose:Group>" + ele.name + "</moose:Group>\n"
                     if sceneitems:
                         #Saved from GUI, then scene co-ordinates are passed
                         speciAnno = speciAnno + "<moose:xCord>" + \
@@ -916,7 +825,6 @@ def writeSpecies(modelpath, cremodel_, sbmlDoc, sceneitems,speGroup):
 def writeCompt(modelpath, cremodel_):
     # getting all the compartments
     compts = moose.wildcardFind(modelpath + '/##[ISA=ChemCompt]')
-    groupInfo = {}
     for compt in compts:
         comptName = convertSpecialChar(compt.name)
         # converting m3 to litre
@@ -934,20 +842,10 @@ def writeCompt(modelpath, cremodel_):
         c1.setSize(size)
         c1.setSpatialDimensions(ndim)
         c1.setUnits('volume')
-        #For each compartment get groups information along
-        for grp in moose.wildcardFind(compt.path+'/##[TYPE=Neutral]'): 
-            grp_cmpt = findGroup_compt(grp.parent)        
-            try:
-                value = groupInfo[moose.element(grp)]
-            except KeyError:
-                # Grp is not present
-                groupInfo[moose.element(grp)] = []
-            
-
     if compts:
-        return True,groupInfo
+        return True
     else:
-        return False,groupInfo
+        return False
 # write Simulation runtime,simdt,plotdt
 def writeSimulationAnnotation(modelpath):
     modelAnno = ""
@@ -978,12 +876,12 @@ def writeSimulationAnnotation(modelpath):
                     graphSpefound = True
                 if graphSpefound:
                     if not plots:
-                        plots = ori[ori.find(q.name)-1:len(ori)]
-                        #plots = '/' + q.name + '/' + name
+                        #plots = ori[ori.find(q.name)-1:len(ori)]
+                        plots = '/' + q.name + '/' + name
 
                     else:
-                        plots = plots + "; "+ori[ori.find(q.name)-1:len(ori)]
-                        #plots = plots + "; /" + q.name + '/' + name
+                        #plots = plots + "; "+ori[ori.find(q.name)-1:len(ori)]
+                        plots = plots + "; /" + q.name + '/' + name
         if plots != " ":
             modelAnno = modelAnno + "<moose:plots> " + plots + "</moose:plots>\n"
         modelAnno = modelAnno + "</moose:ModelAnnotation>"
@@ -1006,30 +904,6 @@ def writeUnits(cremodel_):
     unit.setExponent(1.0)
     unit.setScale(-3)
 
-    unitLen = cremodel_.createUnitDefinition()
-    unitLen.setId("length")
-    unit = unitLen.createUnit()
-    unit.setKind(UNIT_KIND_METRE)
-    unit.setMultiplier(1.0)
-    unit.setExponent(1.0)
-    unit.setScale(0)
-
-    unitArea = cremodel_.createUnitDefinition()
-    unitArea.setId("area")
-    unit = unitArea.createUnit()
-    unit.setKind(UNIT_KIND_METRE)
-    unit.setMultiplier(1.0)
-    unit.setExponent(2.0)
-    unit.setScale(0)
-    
-    unitTime = cremodel_.createUnitDefinition()
-    unitTime.setId("time")
-    unit = unitTime.createUnit()
-    unit.setKind(UNIT_KIND_SECOND)
-    unit.setExponent(1)
-    unit.setMultiplier(1)
-    unit.setScale(0)
-
 if __name__ == "__main__":
     try:
         sys.argv[1]
diff --git a/moose-core/python/moose/__init__.py b/moose-core/python/moose/__init__.py
index b5447c6cea7f6509c37bcd5a2f80ed0ba1b65ebf..2e2f6772607e82d4ad79b68e78782f4c109e5d30 100644
--- a/moose-core/python/moose/__init__.py
+++ b/moose-core/python/moose/__init__.py
@@ -1,616 +1,32 @@
-"""__init__.py: 
-
 """
+How to use the documentation
+----------------------------
 
-from __future__ import print_function
-from __future__ import absolute_import 
-    
-
-from contextlib import closing
-import warnings
-import platform
-import pydoc
-import os
-from io import StringIO
-from collections import defaultdict
-import textwrap
-
-import moose
-from moose._moose import *
-import moose.SBML
-
-# Wrapper to get moose version information.
-__version__ = moose._moose.__version__
-VERSION = moose._moose.VERSION
-
-sequence_types = ['vector<double>',
-                  'vector<int>',
-                  'vector<long>',
-                  'vector<unsigned int>',
-                  'vector<float>',
-                  'vector<unsigned long>',
-                  'vector<short>',
-                  'vector<Id>',
-                  'vector<ObjId>']
-
-known_types = ['void',
-               'char',
-               'short',
-               'int',
-               'unsigned int',
-               'double',
-               'float',
-               'long',
-               'unsigned long',
-               'string',
-               'vec',
-               'melement'] + sequence_types
-
-# SBML related functions.
-
-def mooseReadSBML(filepath, loadpath, solver='ee'):
-    """Load SBML model.
-
-    keyword arguments: \n
-
-    filepath -- filepath to be loaded \n
-    loadpath -- Root path for this model e.g. /model/mymodel \n
-    solver   -- Solver to use (default 'ee' ) \n
-
-    """
-    return moose.SBML.readSBML.mooseReadSBML( filepath, loadpath, solver )
-
-
-def mooseWriteSBML(modelpath, filepath, sceneitems={}):
-    """Writes loaded model under modelpath to a file in SBML format.
-
-    keyword arguments:\n
-
-    modelpath -- model path in moose e.g /model/mymodel \n
-    filepath -- Path of output file. \n
-    sceneitems -- dictlist (UserWarning: user need not worry about this) \n
-                    layout position is saved in Annotation field of all the moose Object (pool,Reaction,enzyme)\n
-                    If this function is called from \n
-                        -- GUI, the layout position of moose object is passed \n
-                        -- command line, \n
-                            ---if genesis/kkit model is loaded then layout position is taken from the file \n
-                            --- else, auto-coordinates is used for layout position and passed
-
-    """
-    return moose.SBML.writeSBML.mooseWriteSBML(modelpath, filepath, sceneitems)
-
-
-def mooseWriteKkit(modelpath, filepath,sceneitems={}):
-    """Writes  loded model under modelpath to a file in Kkit format.
-
-    keyword arguments:\n
-
-    modelpath -- model path in moose \n
-    filepath -- Path of output file.
-    """
-    return moose.genesis.writeKkit.mooseWriteKkit(modelpath, filepath,sceneitems)
-
-
-def moosedeleteChemSolver(modelpath):
-    """ deletes solver on all the compartment and its children.
-        This is neccesary while created a new moose object on a pre-existing modelpath,\n
-        this should be followed by mooseaddChemSolver for add solvers on to compartment to simulate else
-        default is Exponential Euler (ee)
-    """
-    return chemUtil.add_Delete_ChemicalSolver.moosedeleteChemSolver(modelpath)
-
-
-def mooseaddChemSolver(modelpath, solver):
-    """ Add solver on chemical compartment and its children for calculation
-
-    keyword arguments:\n
-
-    modelpath -- model path that is loaded into moose \n
-    solver -- "Exponential Euler" (ee) (default), \n
-              "Gillespie"         ("gssa"), \n
-              "Runge Kutta"       ("gsl")
-
-    """
-    return chemUtil.add_Delete_ChemicalSolver.mooseaddChemSolver(modelpath, solver)
-
-################################################################
-# Wrappers for global functions
-################################################################
-
-
-def pwe():
-    """Print present working element. Convenience function for GENESIS
-    users. If you want to retrieve the element in stead of printing
-    the path, use moose.getCwe()
-
-    """
-    pwe_ = _moose.getCwe()
-    print(pwe_.getPath())
-    return pwe_
-
-
-def le(el=None):
-    """List elements under `el` or current element if no argument
-    specified.
-
-    Parameters
-    ----------
-    el : str/melement/vec/None
-        The element or the path under which to look. If `None`, children
-         of current working element are displayed.
-
-    Returns
-    -------
-    List of path of child elements
-
-    """
-    if el is None:
-        el = getCwe()
-    elif isinstance(el, str):
-        if not exists(el):
-            raise ValueError('no such element')
-        el = element(el)
-    elif isinstance(el, vec):
-        el = el[0]
-    print('Elements under', el.path)
-    for ch in el.children:
-        print(ch.path)
-    return [child.path for child in el.children]
-
-ce = setCwe  # ce is a GENESIS shorthand for change element.
-
-
-def syncDataHandler(target):
-    """Synchronize data handlers for target.
-
-    Parameters
-    ----------
-    target : melement/vec/str
-        Target element or vec or path string.
-
-    Raises
-    ------
-    NotImplementedError
-        The call to the underlying C++ function does not work.
-
-    Notes
-    -----
-    This function is defined for completeness, but currently it does not work.
-
-    """
-    raise NotImplementedError('The implementation is not working for IntFire - goes to invalid objects. \
-First fix that issue with SynBase or something in that line.')
-    if isinstance(target, str):
-        if not _moose.exists(target):
-            raise ValueError('%s: element does not exist.' % (target))
-        target = vec(target)
-        _moose.syncDataHandler(target)
+MOOSE documentation is split into Python documentation and builtin
+documentation. The functions and classes that are only part of the
+Python interface can be viewed via Python's builtin ``help``
+function::
 
+>>> help(moose.connect)
 
-def showfield(el, field='*', showtype=False):
-    """Show the fields of the element `el`, their data types and
-    values in human readable format. Convenience function for GENESIS
-    users.
+The documentation built into main C++ code of MOOSE can be accessed
+via the module function ``doc``::
 
-    Parameters
-    ----------
-    el : melement/str
-        Element or path of an existing element.
+>>> moose.doc('Neutral')
 
-    field : str
-        Field to be displayed. If '*' (default), all fields are displayed.
+To get documentation about a particular field::
 
-    showtype : bool
-        If True show the data type of each field. False by default.
+>>> moose.doc('Neutral.childMsg')
 
-    Returns
-    -------
-    None
+Builtin functions and classes in moose module (Python only)
+-----------------------------------------------------------
 
-    """
-    if isinstance(el, str):
-        if not exists(el):
-            raise ValueError('no such element')
-        el = element(el)
-    if field == '*':
-        value_field_dict = getFieldDict(el.className, 'valueFinfo')
-        max_type_len = max(len(dtype) for dtype in value_field_dict.values())
-        max_field_len = max(len(dtype) for dtype in value_field_dict.keys())
-        print('\n[', el.path, ']')
-        for key, dtype in sorted(value_field_dict.items()):
-            if dtype == 'bad' or key == 'this' or key == 'dummy' or key == 'me' or dtype.startswith(
-                    'vector') or 'ObjId' in dtype:
-                continue
-            value = el.getField(key)
-            if showtype:
-                typestr = dtype.ljust(max_type_len + 4)
-                # The following hack is for handling both Python 2 and
-                # 3. Directly putting the print command in the if/else
-                # clause causes syntax error in both systems.
-                print(typestr, end=' ')
-            print(key.ljust(max_field_len + 4), '=', value)
-    else:
-        try:
-            print(field, '=', el.getField(field))
-        except AttributeError:
-            pass  # Genesis silently ignores non existent fields
-
-
-def showfields(el, showtype=False):
-    """Convenience function. Should be deprecated if nobody uses it.
-
-    """
-    warnings.warn(
-        'Deprecated. Use showfield(element, field="*", showtype=True) instead.',
-        DeprecationWarning)
-    showfield(el, field='*', showtype=showtype)
-
-# Predefined field types and their human readable names
-finfotypes = [('valueFinfo', 'value field'),
-              ('srcFinfo', 'source message field'),
-              ('destFinfo', 'destination message field'),
-              ('sharedFinfo', 'shared message field'),
-              ('lookupFinfo', 'lookup field')]
-
-
-def listmsg(el):
-    """Return a list containing the incoming and outgoing messages of
-    `el`.
-
-    Parameters
-    ----------
-    el : melement/vec/str
-        MOOSE object or path of the object to look into.
-
-    Returns
-    -------
-    msg : list
-        List of Msg objects corresponding to incoming and outgoing
-        connections of `el`.
-
-    """
-    obj = element(el)
-    ret = []
-    for msg in obj.inMsg:
-        ret.append(msg)
-    for msg in obj.outMsg:
-        ret.append(msg)
-    return ret
-
-
-def showmsg(el):
-    """Print the incoming and outgoing messages of `el`.
-
-    Parameters
-    ----------
-    el : melement/vec/str
-        Object whose messages are to be displayed.
-
-    Returns
-    -------
-    None
-
-    """
-    obj = element(el)
-    print('INCOMING:')
-    for msg in obj.msgIn:
-        print(
-            msg.e2.path,
-            msg.destFieldsOnE2,
-            '<---',
-            msg.e1.path,
-            msg.srcFieldsOnE1)
-    print('OUTGOING:')
-    for msg in obj.msgOut:
-        print(
-            msg.e1.path,
-            msg.srcFieldsOnE1,
-            '--->',
-            msg.e2.path,
-            msg.destFieldsOnE2)
-
-def getfielddoc_(tokens, infoType=''):
-    indent=''
-    classname = tokens[0]
-    # print( classname )
-    while True:
-        try:
-            classelement = _moose.element('/classes/' + classname)
-            # print( classelement )
-            x = ''
-            for finfo in classelement.children:
-                # print (str(finfo)[33:-1])
-                # trial = 'path=/classes[0]/' + classname + '[0]/' + infoType
-                # print (trial)
-                # print (str(finfo)[33:-1] == trial)
-                for fieldelement in finfo:
-                    fieldname = fieldelement.fieldName
-                    if (str(fieldname).startswith('get')) or (str(fieldname).startswith('set')):
-                        continue
-                    baseinfo = ''
-                    finfotype = fieldelement.name
-                    if(infoType == 'destFinfo'):
-                        say = 'Destination Message Field'
-                    elif(infoType == 'valueFinfo'):
-                        say = 'Value Field'
-                    elif(infoType == 'srcFinfo'):
-                        say = 'Source Message Field'
-                    elif(infoType == 'lookupFinfo'):
-                        say = 'Lookup Field'
-                    elif(infoType == 'sharedFinfo'):
-                        say = 'Shared Message Field'
-
-                    # finfotype={finfotype}{baseinfo}
-                    if (str(finfotype) == infoType):
-                        x = x + '{indent}{classname}.{fieldname}:   type= {type}   finfotype= {say}{baseinfo}\n\t{docs}\n\n'.format(indent=indent, classname=tokens[0], fieldname = fieldname, type=fieldelement.type, say=say, baseinfo=baseinfo, docs=fieldelement.docs)
-
-            return x
-            # classname = classelement.baseClass
-        except ValueError:
-            raise NameError('`%s` has no field called `%s`'% (tokens[0], tokens[1]))
-
-def getfielddoc(tokens, indent=''):
-    """Return the documentation for field specified by `tokens`.
-
-    Parameters
-    ----------
-    tokens : (className, fieldName) str
-        A sequence whose first element is a MOOSE class name and second
-        is the field name.
-
-    indent : str
-        indentation (default: empty string) prepended to builtin
-        documentation string.
-
-    Returns
-    -------
-    docstring : str
-        string of the form
-        `{indent}{className}.{fieldName}: {datatype} - {finfoType}\n{Description}\n`
-
-    Raises
-    ------
-    NameError
-        If the specified fieldName is not present in the specified class.
-    """
-    assert(len(tokens) > 1)
-    classname = tokens[0]
-    fieldname = tokens[1]
-    while True:
-        try:
-            classelement = _moose.element('/classes/' + classname)
-            for finfo in classelement.children:
-                x = ''
-                for fieldelement in finfo:
-                    baseinfo = ''
-                    if classname != tokens[0]:
-                        baseinfo = ' (inherited from {})'.format(classname)
-                    if fieldelement.fieldName == fieldname:
-                        # The field elements are
-                        # /classes/{ParentClass}[0]/{fieldElementType}[N].
-                        finfotype = fieldelement.name
-                        x = x + '{indent}{classname}.{fieldname}: type={type}, finfotype={finfotype}{baseinfo}\n\t{docs}\n'.format(indent=indent, classname=tokens[0], fieldname=fieldname, type=fieldelement.type, finfotype=finfotype, baseinfo=baseinfo, docs=fieldelement.docs)
-                        return x
-            classname = classelement.baseClass
-        except ValueError:
-            raise NameError('`%s` has no field called `%s`'% (tokens[0], tokens[1]))
-
-def toUnicode(v, encoding='utf8'):
-    # if isinstance(v, str):
-        # return v
-    try:
-        return v.decode(encoding)
-    except (AttributeError, UnicodeEncodeError):
-        return str(v)
-
-
-def getmoosedoc(tokens, inherited=False):
-    """Return MOOSE builtin documentation.
-
-    Parameters
-    ----------
-    tokens : (className, [fieldName])
-        tuple containing one or two strings specifying class name
-        and field name (optional) to get documentation for.
-
-    inherited: bool (default: False)
-        include inherited fields.
-
-    Returns
-    -------
-    docstring : str
-        Documentation string for class `className`.`fieldName` if both
-        are specified, for the class `className` if fieldName is not
-        specified. In the latter case, the fields and their data types
-        and finfo types are listed.
-
-    Raises
-    ------
-    NameError
-        If class or field does not exist.
-
-    """
-    indent = '    '
-    with closing(StringIO()) as docstring:
-        if not tokens:
-            return ""
-        try:
-            class_element = _moose.element('/classes/%s' % (tokens[0]))
-        except ValueError:
-            raise NameError('name \'%s\' not defined.' % (tokens[0]))
-        if len(tokens) > 1:
-            docstring.write(toUnicode(getfielddoc(tokens)))
-        else:
-            doc_text = class_element.docs
-            textArray = textwrap.wrap(doc_text, width = 70, replace_whitespace = False, drop_whitespace = False)
-            text = "\n".join(textArray)
-            # print(text)
-            docstring.write(toUnicode('%s\n' % (text)))
-
-            info = '\t Functions and message destinations \n\t------------------------------------\n\t All \'destFinfo\' can be used as destination Field for moose.connect function.\n'
-            docstring.write(toUnicode('%s\n') % (info))
-            docstring.write(toUnicode(getfielddoc_(tokens, 'destFinfo')))
-            # append_finfodocs(tokens[0], docstring, indent)
-            if inherited:
-                mro = eval('_moose.%s' % (tokens[0])).mro()
-                for class_ in mro[1:]:
-                    if class_ == _moose.melement:
-                        break
-                    docstring.write(toUnicode('\n#Inherited from %s#\n' % (class_.__name__)))
-                    temp = []
-                    temp.append(str(class_.__name__))
-                    docstring.write(toUnicode(getfielddoc_(temp, 'destFinfo')))
-                    # append_finfodocs(class_.__name__, docstring, indent)
-                    if class_ == _moose.Neutral:    # Neutral is the toplevel moose class
-                        break
-
-            info = '\t Class attributes \n\t -------------------- \n\t All \'valueFinfo\' are attributes of the class, and can be read and written using \n\t standard get and set Functions (unless explicitely mentioned otherwise). \n\t for example, getVm() and setVm() for access to Vm.\n\t All \'sharedFinfo\'...'
-            docstring.write(toUnicode('%s\n') % (info))
-            docstring.write(toUnicode(getfielddoc_(tokens, 'valueFinfo')))
-            # append_finfodocs(tokens[0], docstring, indent)
-            if inherited:
-                mro = eval('_moose.%s' % (tokens[0])).mro()
-                for class_ in mro[1:]:
-                    if class_ == _moose.melement:
-                        break
-                    docstring.write(toUnicode('\n#Inherited from %s#\n' % (class_.__name__)))
-                    temp = []
-                    temp.append(str(class_.__name__))
-                    docstring.write(toUnicode(getfielddoc_(temp, 'valueFinfo')))
-                    # append_finfodocs(class_.__name__, docstring, indent)
-                    if class_ == _moose.Neutral:    # Neutral is the toplevel moose class
-                        break
-
-            info = '\t Source Messages \n\t ----------------------- \n\t All \'srcFinfo\' can be used as sourceField for moose.connect function.'
-            docstring.write(toUnicode('%s\n') % (info))
-            docstring.write(toUnicode(getfielddoc_(tokens, 'srcFinfo')))
-            # append_finfodocs(tokens[0], docstring, indent)
-            if inherited:
-                mro = eval('_moose.%s' % (tokens[0])).mro()
-                for class_ in mro[1:]:
-                    if class_ == _moose.melement:
-                        break
-                    docstring.write(toUnicode('\n#Inherited from %s#\n' % (class_.__name__)))
-                    temp = []
-                    temp.append(str(class_.__name__))
-                    docstring.write(toUnicode(getfielddoc_(temp, 'srcFinfo')))
-                    # append_finfodocs(class_.__name__, docstring, indent)
-                    if class_ == _moose.Neutral:    # Neutral is the toplevel moose class
-                        break
-
-            info = '\t LookUp Fields \n\t ---------------- \n\t All \'lookupFinfo\' are ..................................\n'
-            docstring.write(toUnicode('%s\n') % (info))
-            docstring.write(toUnicode(getfielddoc_(tokens, 'lookupFinfo')))
-            # append_finfodocs(tokens[0], docstring, indent)
-            if inherited:
-                mro = eval('_moose.%s' % (tokens[0])).mro()
-                for class_ in mro[1:]:
-                    if class_ == _moose.melement:
-                        break
-                    docstring.write(toUnicode('\n#Inherited from %s#\n' % (class_.__name__)))
-                    temp = []
-                    temp.append(str(class_.__name__))
-                    docstring.write(toUnicode(getfielddoc_(temp, 'lookupFinfo')))
-                    # append_finfodocs(class_.__name__, docstring, indent)
-                    if class_ == _moose.Neutral:    # Neutral is the toplevel moose class
-                        break
-
-            info = '\t shared fields \n\t ---------------- \n\t All \'sharedFinfo\' are ..................................\n'
-            docstring.write(toUnicode('%s\n') % (info))
-            docstring.write(toUnicode(getfielddoc_(tokens, 'sharedFinfo')))
-            # append_finfodocs(tokens[0], docstring, indent)
-            if inherited:
-                mro = eval('_moose.%s' % (tokens[0])).mro()
-                for class_ in mro[1:]:
-                    if class_ == _moose.melement:
-                        break
-                    docstring.write(toUnicode('\n#Inherited from %s#\n' % (class_.__name__)))
-                    temp = []
-                    temp.append(str(class_.__name__))
-                    docstring.write(toUnicode(getfielddoc_(temp, 'sharedFinfo')))
-                    # append_finfodocs(class_.__name__, docstring, indent)
-                    if class_ == _moose.Neutral:    # Neutral is the toplevel moose class
-                        break
-
-        return docstring.getvalue()
-
-def append_finfodocs(classname, docstring, indent):
-    """Append list of finfos in class name to docstring"""
-    try:
-        class_element = _moose.element('/classes/%s' % (classname))
-    except ValueError:
-        raise NameError('class \'%s\' not defined.' % (classname))
-    for ftype, rname in finfotypes:
-        docstring.write(toUnicode('\n*%s*\n' % (rname.capitalize())))
-        try:
-            finfo = _moose.element('%s/%s' % (class_element.path, ftype))
-            for field in finfo.vec:
-                docstring.write(toUnicode(
-                    '%s%s: %s\n' % (indent, field.fieldName, field.type)))
-        except ValueError:
-            docstring.write(toUnicode('%sNone\n' % (indent)))
-
-# the global pager is set from pydoc even if the user asks for paged
-# help once. this is to strike a balance between GENESIS user's
-# expectation of control returning to command line after printing the
-# help and python user's expectation of seeing the help via more/less.
-pager = None
-
-
-def doc(arg, inherited=True, paged=True):
-    """Display the documentation for class or field in a class.
-
-    Parameters
-    ----------
-    arg : str/class/melement/vec
-        A string specifying a moose class name and a field name
-        separated by a dot. e.g., 'Neutral.name'. Prepending `moose.`
-        is allowed. Thus moose.doc('moose.Neutral.name') is equivalent
-        to the above.
-        It can also be string specifying just a moose class name or a
-        moose class or a moose object (instance of melement or vec
-        or there subclasses). In that case, the builtin documentation
-        for the corresponding moose class is displayed.
-
-    paged: bool
-        Whether to display the docs via builtin pager or print and
-        exit. If not specified, it defaults to False and
-        moose.doc(xyz) will print help on xyz and return control to
-        command line.
+"""
+from .moose import *
 
-    Returns
-    -------
-    None
+# Wrapper to get moose version information.
+__version__ = moose._moose.__version__
 
-    Raises
-    ------
-    NameError
-        If class or field does not exist.
+VERSION = moose._moose.VERSION
 
-    """
-    # There is no way to dynamically access the MOOSE docs using
-    # pydoc. (using properties requires copying all the docs strings
-    # from MOOSE increasing the loading time by ~3x). Hence we provide a
-    # separate function.
-    global pager
-    if paged and pager is None:
-        pager = pydoc.pager
-    tokens = []
-    text = ''
-    if isinstance(arg, str):
-        tokens = arg.split('.')
-        if tokens[0] == 'moose':
-            tokens = tokens[1:]
-    elif isinstance(arg, type):
-        tokens = [arg.__name__]
-    elif isinstance(arg, melement) or isinstance(arg, vec):
-        text = '%s: %s\n\n' % (arg.path, arg.className)
-        tokens = [arg.className]
-    if tokens:
-        text += getmoosedoc(tokens, inherited=inherited)
-    else:
-        text += pydoc.getdoc(arg)
-    if pager:
-        pager(text)
-    else:
-        print(text, width=80)
+# NOTE: No module should be imported here. Use moose.py to write imports.
diff --git a/moose-core/python/moose/genesis/writeKkit.py b/moose-core/python/moose/genesis/writeKkit.py
index 2bd33e212590cad4216ca54e733b45bde7ad60b3..ba71603148d5e5096a41e14499027a7a11b442c2 100644
--- a/moose-core/python/moose/genesis/writeKkit.py
+++ b/moose-core/python/moose/genesis/writeKkit.py
@@ -8,21 +8,15 @@ __version__          = "1.0.0"
 __maintainer__       = "Harsha Rani"
 __email__            = "hrani@ncbs.res.in"
 __status__           = "Development"
-__updated__          = "Feb 13 2017"
+
 import sys
 import random
 import re
+import matplotlib
 import moose
 from moose.chemUtil.chemConnectUtil import *
 from moose.chemUtil.graphUtils import *
 
-foundmatplotlib_ = False
-try:
-    import matplotlib
-    foundmatplotlib_ = True
-except Exception as e:
-    pass
-
 GENESIS_COLOR_SEQUENCE = ((248, 0, 255), (240, 0, 255), (232, 0, 255), (224, 0, 255), (216, 0, 255), (208, 0, 255),
  (200, 0, 255), (192, 0, 255), (184, 0, 255), (176, 0, 255), (168, 0, 255), (160, 0, 255), (152, 0, 255), (144, 0, 255),
  (136, 0, 255), (128, 0, 255), (120, 0, 255), (112, 0, 255), (104, 0, 255), (96, 0, 255), (88, 0, 255), (80, 0, 255),
@@ -44,91 +38,78 @@ GENESIS_COLOR_SEQUENCE = ((248, 0, 255), (240, 0, 255), (232, 0, 255), (224, 0,
 #               --StimulusTable
 
 def mooseWriteKkit( modelpath, filename, sceneitems={}):
-    global foundmatplotlib_ 
-    if not foundmatplotlib_:
-        print('No maplotlib found.' 
-            '\nThis module can be installed by following command in terminal:'
-            '\n\t sudo apt install python-maplotlib', "")
-        return False
+    if filename.rfind('.') != -1:
+        filename = filename[:filename.rfind('.')]
     else:
-        
-        ignoreColor= ["mistyrose","antiquewhite","aliceblue","azure","bisque","black","blanchedalmond","blue","cornsilk","darkolivegreen","darkslategray","dimgray","floralwhite","gainsboro","ghostwhite","honeydew","ivory","lavender","lavenderblush","lemonchiffon","lightcyan","lightgoldenrodyellow","lightgray","lightyellow","linen","mediumblue","mintcream","navy","oldlace","papayawhip","saddlebrown","seashell","snow","wheat","white","whitesmoke","aquamarine","lightsalmon","moccasin","limegreen","snow","sienna","beige","dimgrey","lightsage"]
-        matplotcolor = {}
-        for name,hexno in matplotlib.colors.cnames.items():
-            matplotcolor[name]=hexno
-
-        if filename.rfind('.') != -1:
-            filename = filename[:filename.rfind('.')]
-        else:
-            filename = filename[:len(filename)]
-        filename = filename+'.g'
-        global NA
-        NA = 6.0221415e23
-        global cmin,cmax,xmin,xmax,ymin,ymax
-        cmin, xmin, ymin = 0, 0, 0
-        cmax, xmax, ymax = 1, 1, 1
-        
-        compt = moose.wildcardFind(modelpath+'/##[ISA=ChemCompt]')
-        maxVol = estimateDefaultVol(compt)
-        positionInfoExist = True
-        if compt:
-            if bool(sceneitems):
-                cmin,cmax,xmin1,xmax1,ymin1,ymax1 = findMinMax(sceneitems)
-            elif not bool(sceneitems):
-                srcdesConnection = {}
-                setupItem(modelpath,srcdesConnection)
-                meshEntry,xmin,xmax,ymin,ymax,positionInfoExist,sceneitems = setupMeshObj(modelpath)
-                if not positionInfoExist:
-                    #cmin,cmax,sceneitems = autoCoordinates(meshEntry,srcdesConnection)
-                    sceneitems = autoCoordinates(meshEntry,srcdesConnection)
-
-            if not positionInfoExist:        
-                # if position are not from kkit, then zoom factor is applied while
-                # writing to genesis. Like if position is from pyqtSceneItem or auto-coordinates
-                cmin,cmax,xmin1,xmax1,ymin1,ymax1 = findMinMax(sceneitems)
-                for k,v in list(sceneitems.items()):
-                    anno = moose.element(k.path+'/info')
-                    x1 = calPrime(v['x'])
-                    y1 = calPrime(v['y'])
-                    sceneitems[k]['x'] = x1
-                    sceneitems[k]['y'] = y1
-
-            f = open(filename, 'w')
-            writeHeader (f,maxVol)
-
-            gtId_vol = writeCompartment(modelpath,compt,f)
-            writePool(modelpath,f,gtId_vol,sceneitems)
-            reacList = writeReac(modelpath,f,sceneitems)
-            enzList = writeEnz(modelpath,f,sceneitems)
-            writeSumtotal(modelpath,f)
-            f.write("simundump xgraph /graphs/conc1 0 0 99 0.001 0.999 0\n"
-                    "simundump xgraph /graphs/conc2 0 0 100 0 1 0\n")
-            tgraphs = moose.wildcardFind(modelpath+'/##[ISA=Table2]')
-            first, second = " ", " "
-            if tgraphs:
-                first,second = writeplot(tgraphs,f)
-            if first:
-                f.write(first)
-            f.write("simundump xgraph /moregraphs/conc3 0 0 100 0 1 0\n"
-                    "simundump xgraph /moregraphs/conc4 0 0 100 0 1 0\n")
-            if second:
-                f.write(second)
-            f.write("simundump xcoredraw /edit/draw 0 -6 4 -2 6\n"
-                    "simundump xtree /edit/draw/tree 0 \\\n"
-                    "  /kinetics/#[],/kinetics/#[]/#[],/kinetics/#[]/#[]/#[][TYPE!=proto],/kinetics/#[]/#[]/#[][TYPE!=linkinfo]/##[] \"edit_elm.D <v>; drag_from_edit.w <d> <S> <x> <y> <z>\" auto 0.6\n"
-                    "simundump xtext /file/notes 0 1\n")
-            storeReacMsg(reacList,f)
-            storeEnzMsg(enzList,f)
-            if tgraphs:
-                storePlotMsgs(tgraphs,f)
-            writeFooter1(f)
-            writeNotes(modelpath,f)
-            writeFooter2(f)
-            print('Written to file '+filename)
-            return True
-        else:
-            print(("Warning: writeKkit:: No model found on " , modelpath))
-            return False
+        filename = filename[:len(filename)]
+    filename = filename+'.g'
+    global NA
+    NA = 6.0221415e23
+    global cmin,cmax,xmin,xmax,ymin,ymax
+    cmin, xmin, ymin = 0, 0, 0
+    cmax, xmax, ymax = 1, 1, 1
+    
+    compt = moose.wildcardFind(modelpath+'/##[ISA=ChemCompt]')
+    maxVol = estimateDefaultVol(compt)
+    positionInfoExist = True
+    if compt:
+        if bool(sceneitems):
+            cmin,cmax,xmin1,xmax1,ymin1,ymax1 = findMinMax(sceneitems)
+        elif not bool(sceneitems):
+            srcdesConnection = {}
+            setupItem(modelpath,srcdesConnection)
+            meshEntry,xmin,xmax,ymin,ymax,positionInfoExist,sceneitems = setupMeshObj(modelpath)
+            if not positionInfoExist:
+                #cmin,cmax,sceneitems = autoCoordinates(meshEntry,srcdesConnection)
+                sceneitems = autoCoordinates(meshEntry,srcdesConnection)
+
+        if not positionInfoExist:        
+            # if position are not from kkit, then zoom factor is applied while
+            # writing to genesis. Like if position is from pyqtSceneItem or auto-coordinates
+            cmin,cmax,xmin1,xmax1,ymin1,ymax1 = findMinMax(sceneitems)
+            for k,v in list(sceneitems.items()):
+                anno = moose.element(k.path+'/info')
+                x1 = calPrime(v['x'])
+                y1 = calPrime(v['y'])
+                sceneitems[k]['x'] = x1
+                sceneitems[k]['y'] = y1
+
+        f = open(filename, 'w')
+        writeHeader (f,maxVol)
+
+        gtId_vol = writeCompartment(modelpath,compt,f)
+        writePool(modelpath,f,gtId_vol,sceneitems)
+        reacList = writeReac(modelpath,f,sceneitems)
+        enzList = writeEnz(modelpath,f,sceneitems)
+        writeSumtotal(modelpath,f)
+        f.write("simundump xgraph /graphs/conc1 0 0 99 0.001 0.999 0\n"
+                "simundump xgraph /graphs/conc2 0 0 100 0 1 0\n")
+        tgraphs = moose.wildcardFind(modelpath+'/##[ISA=Table2]')
+        first, second = " ", " "
+        if tgraphs:
+            first,second = writeplot(tgraphs,f)
+        if first:
+            f.write(first)
+        f.write("simundump xgraph /moregraphs/conc3 0 0 100 0 1 0\n"
+                "simundump xgraph /moregraphs/conc4 0 0 100 0 1 0\n")
+        if second:
+            f.write(second)
+        f.write("simundump xcoredraw /edit/draw 0 -6 4 -2 6\n"
+                "simundump xtree /edit/draw/tree 0 \\\n"
+                "  /kinetics/#[],/kinetics/#[]/#[],/kinetics/#[]/#[]/#[][TYPE!=proto],/kinetics/#[]/#[]/#[][TYPE!=linkinfo]/##[] \"edit_elm.D <v>; drag_from_edit.w <d> <S> <x> <y> <z>\" auto 0.6\n"
+                "simundump xtext /file/notes 0 1\n")
+        storeReacMsg(reacList,f)
+        storeEnzMsg(enzList,f)
+        if tgraphs:
+            storePlotMsgs(tgraphs,f)
+        writeFooter1(f)
+        writeNotes(modelpath,f)
+        writeFooter2(f)
+        print('Written to file '+filename)
+        return True
+    else:
+        print(("Warning: writeKkit:: No model found on " , modelpath))
+        return False
 
 def findMinMax(sceneitems):
     cmin = 0.0
@@ -503,6 +484,11 @@ def getColorCheck(color,GENESIS_COLOR_SEQUENCE):
     else:
         raise Exception("Invalid Color Value!")
 
+ignoreColor= ["mistyrose","antiquewhite","aliceblue","azure","bisque","black","blanchedalmond","blue","cornsilk","darkolivegreen","darkslategray","dimgray","floralwhite","gainsboro","ghostwhite","honeydew","ivory","lavender","lavenderblush","lemonchiffon","lightcyan","lightgoldenrodyellow","lightgray","lightyellow","linen","mediumblue","mintcream","navy","oldlace","papayawhip","saddlebrown","seashell","snow","wheat","white","whitesmoke","aquamarine","lightsalmon","moccasin","limegreen","snow","sienna","beige","dimgrey","lightsage"]
+matplotcolor = {}
+for name,hexno in matplotlib.colors.cnames.items():
+    matplotcolor[name]=hexno
+
 def getRandColor():
     k = random.choice(list(matplotcolor.keys()))
     if k in ignoreColor:
@@ -631,19 +617,13 @@ def writeFooter2(f):
 
 if __name__ == "__main__":
     import sys
-    import os
-    filename = sys.argv[1]
-    filepath, filenameWithext = os.path.split(filename)
-    if filenameWithext.find('.') != -1:
-        modelpath = filenameWithext[:filenameWithext.find('.')]
-    else:
-        modelpath = filenameWithext
 
+    filename = sys.argv[1]
+    modelpath = filename[0:filename.find('.')]
     moose.loadModel(filename,'/'+modelpath,"gsl")
     output = modelpath+"_.g"
-    written = mooseWriteKkit('/'+modelpath,output)
-    
+    written = write('/'+modelpath,output)
     if written:
             print((" file written to ",output))
     else:
-            print(" could be written to kkit format")
\ No newline at end of file
+            print(" could be written to kkit format")
diff --git a/moose-core/python/moose/merge/merge.py b/moose-core/python/moose/merge/merge.py
index ee940162b2f47fd0417dee223d777d7d8e9891c6..f76ca494b3daffccc1fa6318dd9783564c3a09d1 100644
--- a/moose-core/python/moose/merge/merge.py
+++ b/moose-core/python/moose/merge/merge.py
@@ -11,31 +11,15 @@
 #**           copyright (C) 2003-2017 Upinder S. Bhalla. and NCBS
 #Created : Friday Dec 16 23:19:00 2016(+0530)
 #Version 
-#Last-Updated: Tuesday Feb 28 15:05:33 2017(+0530)
+#Last-Updated: Thursday Jan 12 17:30:33 2017(+0530)
 #         By: Harsha
 #**********************************************************************/
 
-# This program is used to merge models from src to destination 
-#Rules are :
-#   -- If Compartment from the src model doesn't exist in destination model, 
-#       then entire compartment and its children are copied over including groups
-#   -- Models are mergered at group level (if exists) 
-#       (Group is Neutral object in moose, which may represent pathway in network model)
-#   -- Pool's are copied from source to destination if it doesn't exist, if exist nothing is done
-#   -- Reaction (Reac), Enzyme (Enz) are copied 
-#       --- if any danglling Reac or Enz exist then that is not copied
-#    
-#       --- if Reac Name's is different for a given path (group level) 
-#            then copy the entire Reac along with substrate/product
-#       --- if same Reac Name and same sub and prd then nothing is copied
-#       --- if same Reac Name but sub or prd is different then duplicated and copied
-#
-#       --- if Enz Name's is different for a given parent pool path 
-#            then copy the entire Enz along with substrate/product
-#       --- if same Enz Name and same sub and prd then nothing is copied
-#       --- if same Enz Name but sub or prd is different then duplicated and copied       
-#   -- Function are copied only if destination pool to which its suppose to connect doesn't exist with function of its own
-#      
+# This program is used to merge models
+# -- Model B is merged to modelA
+#Rules are
+#--In this models are mergered at group level (if exists)
+
 
 
 import sys
@@ -47,60 +31,42 @@ import mtypes
 from moose.chemUtil.chemConnectUtil import *
 from moose.chemUtil.graphUtils import *
 
-def mergeChemModel(src,des):
-
+def mergeChemModel(A,B):
     """ Merges two model or the path """
-    A = src
-    B = des
-    loadedA = False
-    loadedB = False
-
-    if os.path.isfile(A):
-        modelA,loadedA = loadModels(A)
-    elif moose.exists(A):
-        modelA = A
-        loadedA = True
-    else:
-        print ("%s path or file doesnot exists. Mergering will exist" % (A))
-        exit(0)
-
-    if os.path.isfile(B):
-        modelB,loadedB = loadModels(B)
-    elif moose.exists(B):
-        modelB = B
-        loadedB = True
-    else:
-        print ("%s path or file doesnot exists. Mergering will exist " % (B))
-        exit(0)
-
-    if loadedA and loadedB:
-        ## yet deleteSolver is called to make sure all the moose object are off from solver
-        deleteSolver(modelA) 
-        deleteSolver(modelB)
 
-        global poolListina
+    modelA,loadedA = loadModels(A)
+    modelB,loadedB = loadModels(B)
+    if not loadedA or not loadedB:
+        if not loadedA:
+            modelB = moose.Shell('/')
+        if not loadedB:
+            modelA = moose.Shell('/')    
+    else:
+        directory, bfname = os.path.split(B)
+        global grpNotcopiedyet,poolListina
         poolListina = {}
         grpNotcopiedyet = []
         dictComptA = dict( [ (i.name,i) for i in moose.wildcardFind(modelA+'/##[ISA=ChemCompt]') ] )
         dictComptB = dict( [ (i.name,i) for i in moose.wildcardFind(modelB+'/##[ISA=ChemCompt]') ] )
+
         poolNotcopiedyet = []
 
-        for key in list(dictComptA.keys()):
-            if key not in dictComptB:
+        for key in list(dictComptB.keys()):
+            if key not in dictComptA:
                 # if compartmentname from modelB does not exist in modelA, then copy
-                copy = moose.copy(dictComptA[key],moose.element(modelB))
+                copy = moose.copy(dictComptB[key],moose.element(modelA))
             else:       
                 #if compartmentname from modelB exist in modelA,
                 #volume is not same, then change volume of ModelB same as ModelA
-                if abs(dictComptB[key].volume - dictComptA[key].volume):
+                if abs(dictComptA[key].volume - dictComptB[key].volume):
                     #hack for now
-                    while (abs(dictComptB[key].volume - dictComptA[key].volume) != 0.0):
-                        dictComptA[key].volume = float(dictComptB[key].volume)
-                dictComptB = dict( [ (i.name,i) for i in moose.wildcardFind(modelB+'/##[ISA=ChemCompt]') ] )
+                    while (abs(dictComptA[key].volume - dictComptB[key].volume) != 0.0):
+                        dictComptB[key].volume = float(dictComptA[key].volume)
+                dictComptA = dict( [ (i.name,i) for i in moose.wildcardFind(modelA+'/##[ISA=ChemCompt]') ] )
 
                 #Mergering pool
-                poolMerge(dictComptB[key],dictComptA[key],poolNotcopiedyet)
-        
+                poolMerge(dictComptA[key],dictComptB[key],poolNotcopiedyet)
+
         if grpNotcopiedyet:
             # objA = moose.element(comptA).parent.name
             # if not moose.exists(objA+'/'+comptB.name+'/'+bpath.name):
@@ -108,36 +74,34 @@ def mergeChemModel(src,des):
             #   moose.copy(bpath,moose.element(objA+'/'+comptB.name))
             pass
 
-        comptBdict =  comptList(modelB)
-        poolListinb = {}
-        poolListinb = updatePoolList(comptBdict)
+        comptAdict =  comptList(modelA)
+        poolListina = {}
+        poolListina = updatePoolList(comptAdict)
+        funcNotallowed = []
         R_Duplicated, R_Notcopiedyet,R_Daggling = [], [], []
         E_Duplicated, E_Notcopiedyet,E_Daggling = [], [], []
-        for key in list(dictComptA.keys()):
-            funcExist, funcNotallowed = [], []
-            funcExist,funcNotallowed = functionMerge(dictComptB,dictComptA,key)
+        for key in list(dictComptB.keys()):
+            funcNotallowed = []
+            funcNotallowed = functionMerge(dictComptA,dictComptB,key)
             
-            poolListinb = updatePoolList(dictComptB)
-            R_Duplicated,R_Notcopiedyet,R_Daggling = reacMerge(dictComptB,dictComptA,key,poolListinb)
-            
-            poolListinb = updatePoolList(dictComptB)
-            E_Duplicated,E_Notcopiedyet,E_Daggling = enzymeMerge(dictComptB,dictComptA,key,poolListinb)
-        path, sfile = os.path.split(src)
-        path, dfile = os.path.split(des)
-        print("\n %s (src) model is merged to %s (des)" %(sfile, dfile))
-        if funcExist:
-            print( "\nIn model \"%s\" pool already has connection from a function, these function from model \"%s\" is not allowed to connect to same pool,\n since no two function are allowed to connect to same pool:"%(dfile, sfile))
-            for fl in list(funcExist):
-                print("\t [Pool]:  %s [Function]:  %s \n" %(str(fl.parent.name), str(fl.path)))
+            poolListina = updatePoolList(dictComptA)
+            R_Duplicated,R_Notcopiedyet,R_Daggling = reacMerge(dictComptA,dictComptB,key,poolListina)
+
+            poolListina = updatePoolList(dictComptA)
+            E_Duplicated,E_Notcopiedyet,E_Daggling = enzymeMerge(dictComptA,dictComptB,key,poolListina)
+        
+        print("\n Model is merged to %s" %modelA)
+        
         if funcNotallowed:
-            print( "\nThese functions is not to copied, since pool connected to function input are from different compartment:")
+            print( "\nPool already connected to a function, this function is not to connect to same pool, since no two function are allowed to connect to same pool:")
             for fl in list(funcNotallowed):
                 print("\t [Pool]:  %s [Function]:  %s \n" %(str(fl.parent.name), str(fl.path)))
+
         if R_Duplicated or E_Duplicated:
-            print ("These Reaction / Enzyme are \"Duplicated\" into destination file \"%s\", due to "
-                    "\n 1. If substrate / product name's are different for a give reaction/Enzyme name "
-                    "\n 2. If product belongs to different compartment "
-                    "\n Models have to decide to keep or delete these reaction/enzyme in %s" %(dfile, dfile))
+            print ("Reaction / Enzyme are Duplicate"
+                    "\n 1. The once whoes substrate / product names are different for a give reaction name "
+                    "\n 2. its compartment to which it belongs to may be is different"
+                    "\n Models have to decide to keep or delete these reaction/enzyme")
             if E_Duplicated:
                 print("Reaction: ")
             for rd in list(R_Duplicated):
@@ -161,7 +125,7 @@ def mergeChemModel(src,des):
                     print ("%s " %str(ed.name))
                 
         if R_Daggling or E_Daggling:
-            print ("\n Daggling reaction/enzyme are not allowed in moose, these are not merged to %s from %s" %(dfile, sfile))
+            print ("\n Daggling reaction/enzyme are not not allowed in moose, these are not merged")
             if R_Daggling:
                 print("Reaction: ")
                 for rd in list(R_Daggling):
@@ -170,50 +134,62 @@ def mergeChemModel(src,des):
                 print ("Enzyme:")
                 for ed in list(E_Daggling):
                     print ("%s " %str(ed.name))             
-        
+
 def functionMerge(comptA,comptB,key):
-    funcNotallowed, funcExist = [], []
+    funcNotallowed = []
     comptApath = moose.element(comptA[key]).path
     comptBpath = moose.element(comptB[key]).path
+    funcListina = moose.wildcardFind(comptApath+'/##[ISA=PoolBase]') 
+    funcListinb = moose.wildcardFind(comptBpath+'/##[ISA=Function]')
     objA = moose.element(comptApath).parent.name
     objB = moose.element(comptBpath).parent.name
-    
-    #This will give us all the function which exist in modelB
-    funcListinb = moose.wildcardFind(comptBpath+'/##[ISA=Function]')
+    #For function mergering pool name is taken as reference
+    funcNotcopiedyet = []
     for fb in funcListinb:
-        #This will give us all the pools that its connected to, for this function
-        fvalueOut = moose.element(fb).neighbors['valueOut']
-        for poolinB in fvalueOut:
-            poolinBpath = poolinB.path
-            poolinA = poolinBpath.replace(objB,objA)
-            connectionexist = []
-            if moose.exists(poolinA):
-                #This is give us if pool which is to be connected already exist any connection
-                connectionexist = moose.element(poolinA).neighbors['setN']+moose.element(poolinA).neighbors['setConc']+ moose.element(poolinA).neighbors['increment']
-                if len(connectionexist) == 0:
-                    #This pool in model A doesnot exist with any function
-                    inputs = moose.element(fb.path+'/x').neighbors['input']
-                    volumes = []
-                    for ins in inputs:
-                        volumes.append((findCompartment(moose.element(ins))).volume)
-                    if len(set(volumes)) == 1:
-                        # If all the input connected belongs to one compartment then copy
-                        createFunction(fb,poolinA,objB,objA)
-                    else:
-                        # moose doesn't allow function's input to come from different compartment
-                        funcNotallowed.append(fb)
-                else:
-                    #Pool in model 'A' already exist function "
-                    funcExist.append(fb)
-            else:
-                print(" Path in model A doesn't exists %s" %(poolinA))
-        
-    return funcExist,funcNotallowed
 
-def createFunction(fb,setpool,objB,objA):
+        if fb.parent.className in ['ZombiePool','Pool','ZombieBufPool','BufPool']:
+            objA = moose.element(comptApath).parent.name
+            fbpath = fb.path
+            #funcpath = fbpath[fbpath.find(findCompartment(fb).name)-1:len(fbpath)]
+            funcparentB = fb.parent.path
+            funcpath = fbpath.replace(objB,objA)
+            funcparentA = funcparentB.replace(objB,objA)
+            tt = moose.element(funcparentA).neighbors['setN']
+            if tt:
+                funcNotallowed.append(fb)
+            else:
+                if len(moose.element(fb.path+'/x').neighbors["input"]):
+                    #inputB = moose.element(fb.path+'/x').neighbors["input"]
+                    inputB = subprdList(moose.element(fb.path+'/x'),"input")
+                    inputB_expr = fb.expr
+                    if moose.exists(funcpath):
+                        #inputA = moose.element(objA+funcpath+'/x').neighbors["input"]
+                        inputA = subprdList(moose.element(funcpath+'/x'),"input")
+                        inputA_expr = moose.element(funcpath).expr
+                        hassameExpr = False
+                        if inputA_expr == inputB_expr:
+                            hassameExpr = True
+                        hassameLen,hassameS,hassameVols = same_len_name_vol(inputA,inputB)
+                        if not all((hassameLen,hassameS,hassameVols,hassameExpr)):
+                            fb.name = fb.name+'_duplicatedF'
+                            createFunction(fb,inputB,objB,objA)
+                    else:
+                        #function doesnot exist then copy
+                        if len(inputB):
+                            volinput = []
+                            for inb in inputB:
+                                volinput.append(findCompartment(moose.element(inb)).volume)
+                                if len(set(volinput)) == 1:
+                                    # If all the input connected belongs to one compartment then copy
+                                    createFunction(fb,inputB,objB,objA)
+                                else:
+                                    # moose doesn't allow function input to come from different compartment
+                                    funcNotallowed.append(fb)
+    return funcNotallowed
+
+def createFunction(fb,inputB,objB,objA):
     fapath1 = fb.path.replace(objB,objA)
     fapath = fapath1.replace('[0]','')
-
     if not moose.exists(fapath):
         # if fb.parent.className in ['CubeMesh','CyclMesh']:
         #   des = moose.Function('/'+objA+'/'+fb.parent.name+'/'+fb.name)
@@ -222,13 +198,7 @@ def createFunction(fb,setpool,objB,objA):
         #       if fb.parent.name == akey.name:
         #           des = moose.Function(akey.path+'/'+fb.name)
         des = moose.Function(fapath)
-    else:
-        des = moose.element(fapath)
-    inputB = moose.element(fb.path+'/x').neighbors["input"]
-    moose.connect(des, 'valueOut', moose.element(setpool),'setN' )
-    inputA = []
-    inputA = moose.element(fapath+'/x').neighbors["input"]
-    if not inputA:
+        moose.connect(des, 'valueOut', moose.element(fapath).parent,'setN' )
         for src in inputB:
             pool = ((src.path).replace(objB,objA)).replace('[0]','')
             numVariables = des.numVars
@@ -239,45 +209,46 @@ def createFunction(fb,setpool,objB,objA):
             des.expr = expr
             moose.connect( pool, 'nOut', des.x[numVariables], 'input' )
 
+        #if fb.expr != des.expr:
+        #    print "Function ",des, " which is duplicated from modelB, expression is different, this is tricky in moose to know what those constants are connected to "
+        #    print "ModelB ", fb, fb.expr, "\nModelA ",des, des.expr
+
 def comptList(modelpath):
     comptdict = {}
     for ca in moose.wildcardFind(modelpath+'/##[ISA=ChemCompt]'):
         comptdict[ca.name] = ca
     return comptdict
 
-def loadModels(filepath):
+def loadModels(filename):
     """ load models into moose if file, if moosepath itself it passes back the path and 
     delete solver if exist """
 
     modelpath = '/'
     loaded = False
 
-    if os.path.isfile(filepath) :
-        fpath, filename = os.path.split(filepath)
-        # print " head and tail ",head,  " ",tail
-        # modelpath = filename[filename.rfind('/'): filename.rfind('.')]
-        # print "modelpath ",modelpath
-        # ext = os.path.splitext(filename)[1]
-        # filename = filename.strip()
-        modelpath = '/'+filename[:filename.rfind('.')]
-        modeltype = mtypes.getType(filepath)
-        subtype = mtypes.getSubtype(filepath, modeltype)
-
+    if os.path.isfile(filename) :
+        modelpath = filename[filename.rfind('/'): filename.rfind('.')]
+        ext = os.path.splitext(filename)[1]
+        filename = filename.strip()
+        modeltype = mtypes.getType(filename)
+        subtype = mtypes.getSubtype(filename, modeltype)
         if subtype == 'kkit' or modeltype == "cspace":
-            moose.loadModel(filepath,modelpath)
+            moose.loadModel(filename,modelpath)
             loaded = True    
     
         elif subtype == 'sbml':
-            #moose.mooseReadSBML(filename,modelpath)
-            #loaded = True
+            #moose.ReadSBML()
             pass
         else:
             print("This file is not supported for mergering")
             modelpath = moose.Shell('/')
-
-    elif moose.exists(filepath):
-        modelpath = filepath
+    elif moose.exists(filename):
+        modelpath = filename
         loaded = True
+    ## default is 'ee' solver while loading the model using moose.loadModel,
+    ## yet deleteSolver is called just to be assured 
+    if loaded:
+        deleteSolver(modelpath) 
 
     return modelpath,loaded
 
@@ -329,15 +300,15 @@ def copy_deleteUnlyingPoolObj(pool,path):
     # which will automatically copie's the pool
     copied = False
 
-    if pool.parent.className not in ["Enz","ZombieEnz","MMenz","ZombieMMenz"]:
+    if pool.parent.className not in ["Enz","ZombieEnz"]:
         poolcopied = moose.copy(pool,path)
         copied = True
         # deleting function and enzyme which gets copied if exist under pool
         # This is done to ensure daggling function / enzyme not copied.
         funclist = []
         for types in ['setConc','setN','increment']:
-            funclist.extend(moose.element(poolcopied).neighbors[types])
 
+            funclist.extend(moose.element(poolcopied).neighbors[types])
         for fl in funclist:
             moose.delete(fl)
         enzlist = moose.element(poolcopied).neighbors['reac']
@@ -393,15 +364,20 @@ def enzymeMerge(comptA,comptB,key,poolListina):
                             allclean = True
                         else:
                             # didn't find sub or prd for this Enzyme
+                            #print ("didn't find sub or prd for this reaction" )
                             RE_Notcopiedyet.append(eb)
                     else:
                         #   -- it is dagging reaction
                         RE_Daggling.append(eb)
+                        #print ("This reaction \""+eb.path+"\" has no substrate/product daggling reaction are not copied")
+                        #war_msg = war_msg+"\nThis reaction \""+eb.path+"\" has no substrate/product daggling reaction are not copied"
                 else:
                     #Same Enzyme name 
                     #   -- Same substrate and product including same volume then don't copy
                     #   -- different substrate/product or if sub/prd's volume is different then DUPLICATE the Enzyme
                     allclean = False
+                    #ea = moose.element('/'+obj+'/'+enzcompartment.name+'/'+enzparent.name+'/'+eb.name)
+                    #ea = moose.element(pA.path+'/'+eb.name)
                     ea = moose.element(eb.path.replace(objB,objA))
                     eAsubname = subprdList(ea,"sub")
                     eBsubname = subprdList(eb,"sub")
@@ -431,6 +407,7 @@ def enzymeMerge(comptA,comptB,key,poolListina):
                                     moose.connect(moose.element(enz).parent,"nOut",moose.element(enz),"enzDest")
                                     #moose.connect(moose.element(enz),"enz",moose.element(enz).parent,"reac")
 
+                                #moose.connect( cplxItem, 'reac', enz, 'cplx' )
                                 connectObj(enz,eBsubname,"sub",comptA,war_msg)
                                 connectObj(enz,eBprdname,"prd",comptA,war_msg)
                                 RE_Duplicated.append(enz)
@@ -445,9 +422,12 @@ def enzymeMerge(comptA,comptB,key,poolListina):
                         #   --  it may be connected Enzyme cplx
                         if eBsubname and eBprdname:
                             RE_Notcopiedyet.append(eb)
+                            #print ("This Enzyme \""+eb.path+"\" has no substrate/product must be connect to cplx")
+                            #war_msg = war_msg+ "\nThis Enzyme \""+rb.path+"\" has no substrate/product must be connect to cplx"
                         else:
                             RE_Daggling.append(eb)
-
+                            #print ("This enzyme \""+eb.path+"\" has no substrate/product daggling reaction are not copied")
+                            #war_msg = war_msg+"\nThis reaction \""+eb.path+"\" has no substrate/product daggling reaction are not copied"
     return RE_Duplicated,RE_Notcopiedyet,RE_Daggling
 
 def reacMerge(comptA,comptB,key,poolListina):
@@ -531,12 +511,17 @@ def reacMerge(comptA,comptB,key,poolListina):
                         #   --  it may be connected Enzyme cplx
                         if rBsubname and rBprdname:
                             RE_Notcopiedyet.append(rb)
+                            #print ("This reaction \""+rb.path+"\" has no substrate/product must be connect to cplx")
+                            #war_msg = war_msg+ "\nThis reaction \""+rb.path+"\" has no substrate/product must be connect to cplx"
                         else:
                             RE_Daggling.append(rb)
+                            #print ("This reaction \""+rb.path+"\" has no substrate/product daggling reaction are not copied")
+                            #war_msg = war_msg+"\nThis reaction \""+rb.path+"\" has no substrate/product daggling reaction are not copied"      
             
     return RE_Duplicated,RE_Notcopiedyet,RE_Daggling
 
 def subprdList(reac,subprd):
+    #print  "Reac ",reac
     rtype = moose.element(reac).neighbors[subprd]
     rname = []
     for rs in rtype:
@@ -587,6 +572,8 @@ def connectObj(reac,spList,spType,comptA,war_msg):
                     allclean = True
                 else:
                     #It should not come here unless the sub/prd is connected to enzyme cplx pool
+                    #print ("This pool \""+rsp.name+"\" doesnot exists in this "+comptName+" compartment to connect to this reaction \""+reac.name+"\"")
+                    #war_msg = war_msg+ "This pool \""+rsp.name+"\" doesnot exists in this "+comptName+" compartment to connect to this reaction \""+reac.name+"\""
                     allclean = False
     return allclean
 
@@ -616,24 +603,7 @@ def mooseIsInstance(element, classNames):
 
 
 if __name__ == "__main__":
-    try:
-        sys.argv[1]
-    except IndexError:
-        print("Source filename or path not given")
-        exit(0)
-    else:
-        src = sys.argv[1]
-        if not os.path.exists(src):
-            print("Filename or path does not exist",src)
-        else:
-            try:
-                sys.argv[2]
-            except IndexError:
-                print("Destination filename or path not given")
-                exit(0)
-            else:
-                des = sys.argv[2]
-                if not os.path.exists(src):
-                    print("Filename or path does not exist",des)
-                    exit(0)
-                mergered = mergeChemModel(src,des)
\ No newline at end of file
+
+    modelA = '/home/harsha/genesis_files/gfile/acc92.g'
+    modelB = '/home/harsha/genesis_files/gfile/acc50.g'
+    mergered = mergeChemModel(modelA,modelB)
diff --git a/moose-core/python/moose/plot_utils.py b/moose-core/python/moose/plot_utils.py
index 94c8577e7491f4550f72774303f10e7a9872af1e..b2740954dc10103f0c6e6f266ce08cb4cedeb315 100644
--- a/moose-core/python/moose/plot_utils.py
+++ b/moose-core/python/moose/plot_utils.py
@@ -135,7 +135,7 @@ def plotTables(tables, outfile=None, **kwargs):
     subplot = kwargs.get('subplot', True)
     for i, tname in enumerate(tables):
         if subplot:
-            plt.subplot(len(tables), 1, i+1)
+            plt.subplot(len(tables), 1, i)
         yvec = tables[tname].vector 
         xvec = np.linspace(0, moose.Clock('/clock').currentTime, len(yvec))
         plt.plot(xvec, yvec, label=tname)
@@ -165,7 +165,7 @@ def plotVector(vec, xvec = None, **options):
     :param vec: Given vector.
     :param **kwargs: Optional to pass to maplotlib.
     """
-    ax = options[ 'ax' ]
+
     assert type(vec) == np.ndarray, "Expected type %s" % type(vec)
     legend = options.get('legend', True)
 
@@ -176,29 +176,28 @@ def plotVector(vec, xvec = None, **options):
         xx = xvec[:]
 
     assert len(xx) == len(vec), "Expecting %s got %s" % (len(vec), len(xvec))
-    ax.plot(xx, vec, label=options.get('label', ''))
 
+    plt.plot(xx, vec, label=options.get('label', ''))
     if legend:
         # This may not be available on older version of matplotlib.
         try:
-            ax.legend(loc='best', framealpha=0.4)
+            plt.legend(loc='best', framealpha=0.4)
         except:
-            ax.legend(loc='best')
+            plt.legend(loc='best')
 
     if xvec is None:
-        ax.set_xlabel('Time (sec)')
+        plt.xlabel('Time (sec)')
     else:
-        ax.set_xlabel(options.get('xlabel', ''))
+        plt.xlabel(options.get('xlabel', ''))
     
-    ax.set_ylabel = options.get('ylabel', '')
-    ax.set_title(options.get('title', ''))
+    plt.ylabel = options.get('ylabel', '')
+    plt.title(options.get('title', ''))
 
     if(options.get('legend', True)):
         try:
-            ax.legend(loc='best', framealpha=0.4, prop={'size' : 9})
+            plt.legend(loc='best', framealpha=0.4, prop={'size' : 9})
         except:
-            ax.legend(loc='best', prop={'size' : 9})
-    return ax
+            plt.legend(loc='best', prop={'size' : 9})
 
 
 def saveRecords(records, xvec = None, **kwargs):
@@ -268,7 +267,7 @@ def plotRecords(records, xvec = None, **kwargs):
                 yvec = dataDict[k].vector
                 plotVector(yvec, xvec, label=k, **kwargs)
             else:
-                kwargs[ 'ax' ] = plt.subplot(len(dataDict), 1, i)
+                plt.subplot(len(dataDict), 1, i)
                 yvec = dataDict[k].vector
                 plotVector(yvec, xvec, label=k, **kwargs)
 
@@ -287,13 +286,9 @@ def plotRecords(records, xvec = None, **kwargs):
     else:
         plt.show()
 
-def plot_records( data_dict, xvec = None, **kwargs ):
-    """Renamed (deprecated)
-    """
-    return plot_tables( data_dict, xvec, **kwargs )
 
-def plot_tables(data_dict, xvec = None, **kwargs):
-    """plot_tables plots moose.Table stored in a dictionary.
+def plot_records(data_dict, xvec = None, **kwargs):
+    """plot_records Plot given dictionary.
 
     :param data_dict:
     :param xvec: If None, use moose.Clock to generate xvec.
@@ -305,12 +300,7 @@ def plot_tables(data_dict, xvec = None, **kwargs):
     subplot = kwargs.get('subplot', False)
     filters = [ x.lower() for x in kwargs.get('filter', [])]
 
-    ax = kwargs.get( 'ax', None )
-    if ax is None:
-        plt.figure(figsize=(10, 1.5*len(data_dict)))
-        if not subplot:
-            ax = plt.subplot( 1, 1, 1 )
-
+    plt.figure(figsize=(10, 1.5*len(data_dict)))
     for i, k in enumerate(data_dict):
         pu.info("+ Plotting for %s" % k)
         plotThis = False
@@ -322,10 +312,10 @@ def plot_tables(data_dict, xvec = None, **kwargs):
                 
         if plotThis:
             if not subplot: 
-                yvec = data_dict[k].vector
+                yvec = data_dict[k]
                 plotVector(yvec, xvec, label=k, **kwargs)
             else:
-                ax = plt.subplot(len(data_dict), 1, i)
+                plt.subplot(len(data_dict), 1, i)
                 yvec = data_dict[k]
                 plotVector(yvec, xvec, label=k, **kwargs)
     if subplot:
diff --git a/moose-core/python/rdesigneur/rdesigneur.py b/moose-core/python/rdesigneur/rdesigneur.py
index 632e7ead2a16364e4f6e4154d82a1f75ea6b5a14..e267921c404d9c2954ab5503601778ea4818fae0 100644
--- a/moose-core/python/rdesigneur/rdesigneur.py
+++ b/moose-core/python/rdesigneur/rdesigneur.py
@@ -80,7 +80,6 @@ class rdesigneur:
             useGssa = True,
             combineSegments = True,
             stealCellFromLibrary = False,
-            verbose = True,
             diffusionLength= 2e-6,
             meshLambda = -1.0,    #This is a backward compatibility hack
             temperature = 32,
@@ -112,7 +111,6 @@ class rdesigneur:
         self.useGssa = useGssa
         self.combineSegments = combineSegments
         self.stealCellFromLibrary = stealCellFromLibrary
-        self.verbose = verbose
         self.diffusionLength= diffusionLength
         if meshLambda > 0.0:
             print("Warning: meshLambda argument is deprecated. Please use 'diffusionLength' instead.\nFor now rdesigneur will accept this argument.")
@@ -203,8 +201,7 @@ class rdesigneur:
             self._buildMoogli()
             self._buildStims()
             self._configureClocks()
-            if self.verbose:
-                self._printModelStats()
+            self._printModelStats()
             self._savePlots()
 
         except BuildError as msg:
@@ -318,8 +315,7 @@ class rdesigneur:
                 return True
             if moose.exists( '/library/' + protoVec[0] ):
                 #moose.copy('/library/' + protoVec[0], '/library/', protoVec[1])
-                if self.verbose:
-                    print('renaming /library/' + protoVec[0] + ' to ' + protoVec[1])
+                print('renaming /library/' + protoVec[0] + ' to ' + protoVec[1])
                 moose.element( '/library/' + protoVec[0]).name = protoVec[1]
                 #moose.le( '/library' )
                 return True
@@ -458,7 +454,6 @@ class rdesigneur:
                     "buildChemDistrib: No elec compartments found in path: '" \
                         + pair + "'" )
             self.spineComptElist = self.elecid.spinesFromExpression[ pair ]
-            #print( 'LEN SPINECOMPTELIST =' + str( pair ) + ", " str( len( self.spineComptElist ) ) )
             '''
             if len( self.spineComptElist ) == 0:
                 raise BuildError( \
@@ -600,7 +595,6 @@ class rdesigneur:
     def _buildMoogli( self ):
         knownFields = {
             'Vm':('CompartmentBase', 'getVm', 1000, 'Memb. Potential (mV)', -80.0, 40.0 ),
-            'initVm':('CompartmentBase', 'getInitVm', 1000, 'Init. Memb. Potl (mV)', -80.0, 40.0 ),
             'Im':('CompartmentBase', 'getIm', 1e9, 'Memb. current (nA)', -10.0, 10.0 ),
             'inject':('CompartmentBase', 'getInject', 1e9, 'inject current (nA)', -10.0, 10.0 ),
             'Gbar':('ChanBase', 'getGbar', 1e9, 'chan max conductance (nS)', 0.0, 1.0 ),
@@ -1282,8 +1276,8 @@ class rdesigneur:
             else:
                 ePath = i[0].path + '/' + elecRelPath
                 if not( moose.exists( ePath ) ):
-                    continue
-                    #raise BuildError( "Error: buildAdaptor: no elec obj in " + ePath )
+                    raise BuildError( \
+                        "Error: buildAdaptor: no elec obj in " + ePath )
                 elObj = moose.element( i[0].path + '/' + elecRelPath )
             if ( isElecToChem ):
                 elecFieldSrc = 'get' + capField
diff --git a/moose-core/python/rdesigneur/rmoogli.py b/moose-core/python/rdesigneur/rmoogli.py
index c1b0d3aad7038c60bc26bf0c3dbfb68ba86c7a51..7f8fa883b372bea23ec50fc754653e93c3f5995c 100644
--- a/moose-core/python/rdesigneur/rmoogli.py
+++ b/moose-core/python/rdesigneur/rmoogli.py
@@ -17,7 +17,6 @@ import os
 # Check if DISPLAY environment variable is properly set. If not, warn the user
 # and continue.
 hasDisplay = True
-hasMoogli = False
 display = os.environ.get('DISPLAY',  '' )
 if not display:
     hasDisplay = False
@@ -26,6 +25,7 @@ if not display:
             "Anyway, MOOSE will continue without graphics.\n"
             )
 
+hasMoogli = True
 
 if hasDisplay:
     try: 
@@ -33,11 +33,11 @@ if hasDisplay:
         import moogli
         import moogli.extensions.moose
         app = QtGui.QApplication(sys.argv)
-        hasMoogli = True
     except Exception as e:
         print( 'Warning: Moogli not found. All moogli calls will use dummy functions' )
         hasMoogli = False
 
+
 runtime = 0.0
 moogliDt = 1.0
 rotation = math.pi / 500.0
diff --git a/moose-core/python/setup.py b/moose-core/python/setup.py
index 475826a54e32a25fdbf6e64181d8fbe08ec3eb6f..a6c3852c787d09e3d59d8b03ba82c359759e8f11 100644
--- a/moose-core/python/setup.py
+++ b/moose-core/python/setup.py
@@ -33,7 +33,7 @@ from distutils.core import setup
 
 script_dir = os.path.dirname( os.path.abspath( __file__ ) )
 
-version = '3.2.git'
+version = '3.1'
 try:
     with open( os.path.join( script_dir, '..', 'VERSION'), 'r' ) as f:
         version = f.read( )
diff --git a/moose-core/scheduling/Clock.cpp b/moose-core/scheduling/Clock.cpp
index 434d2f62e94e54674310b3d363d1ef9a3733a6d3..b5bac41b1219c87702b57fe37736fa7605966c8c 100644
--- a/moose-core/scheduling/Clock.cpp
+++ b/moose-core/scheduling/Clock.cpp
@@ -327,7 +327,7 @@ const Cinfo* Clock::initCinfo()
         "The clock also starts up with some default timesteps for each "
         "of these ticks, and this can be overridden using the shell "
         "command setClock, or by directly assigning tickStep values on the "
-        "clock object. \n"
+        "clock object."
         "Which objects use which tick? As a rule of thumb, try this: \n"
         "Electrical/compartmental model calculations: Ticks 0-7 \n"
         "Tables and output objects for electrical output: Tick 8 \n"
@@ -342,57 +342,57 @@ const Cinfo* Clock::initCinfo()
         "clock ticks for the tables/fileIO objects handling output at "
         "different time-resolutions. Typically one uses tick 8 and 18.\n"
         "Here are the detailed mappings of class to tick.\n"
-        "	Class				Tick		dt \n"
-        "	DiffAmp				0		50e-6\n"
-        "	Interpol			0		50e-6\n"
-        "	PIDController			0		50e-6\n"
-        "	PulseGen			0		50e-6\n"
-        "	StimulusTable			0		50e-6\n"
-        "	testSched			0		50e-6\n"
-        "	VClamp				0		50e-6\n"
-        "	SynHandlerBase			1		50e-6\n"
-        "	SimpleSynHandler		1		50e-6\n"
-        "   STDPSynHandler		1		50e-6\n"
-        "   GraupnerBrunel2012CaPlasticitySynHandler    1		50e-6\n"
-        "   SeqSynHandler		1		50e-6\n"
+        "   Class              Tick       dt \n"
+        "   DiffAmp             0       50e-6\n"
+        "   Interpol            0       50e-6\n"
+        "   PIDController       0       50e-6\n"
+        "   PulseGen            0       50e-6\n"
+        "   StimulusTable       0       50e-6\n"
+        "   testSched           0       50e-6\n"
+        "   VClamp              0       50e-6\n"
+        "   SynHandlerBase      1       50e-6\n"
+        "   SimpleSynHandler    1       50e-6\n"
+        "   STDPSynHandler      1       50e-6\n"
+        "   GraupnerBrunel2012CaPlasticitySynHandler    1        50e-6\n"
+        "   SeqSynHandler       1       50e-6\n"
         "	CaConc				1		50e-6\n"
         "	CaConcBase			1		50e-6\n"
         "	DifShell			1		50e-6\n"
-	"	DifShellBase			1		50e-6\n"
-	"       MMPump                          1               50e-6\n"
-	"	DifBuffer			1		50e-6\n"
-	"	DifBufferBase			1		50e-6\n"
+	    "	DifShellBase		1		50e-6\n"
+	    "   MMPump              1       50e-6\n"
+	    "	DifBuffer			1		50e-6\n"
+	    "	DifBufferBase		1		50e-6\n"
         "	MgBlock				1		50e-6\n"
         "	Nernst				1		50e-6\n"
         "	RandSpike			1		50e-6\n"
         "	ChanBase			2		50e-6\n"
         "	IntFire				2		50e-6\n"
         "	IntFireBase			2		50e-6\n"
-        "	LIF				2		50e-6\n"
-        "	QIF				2		50e-6\n"
+        "	LIF					2		50e-6\n"
+        "	QIF					2		50e-6\n"
         "	ExIF				2		50e-6\n"
         "	AdExIF				2		50e-6\n"
-        "	AdThreshIF				2		50e-6\n"
+        "	AdThreshIF			2		50e-6\n"
         "	IzhIF				2		50e-6\n"
-        "	IzhikevichNrn			2		50e-6\n"
+        "	IzhikevichNrn		2		50e-6\n"
         "	SynChan				2		50e-6\n"
-        "	NMDAChan				2		50e-6\n"
+        "	NMDAChan			2		50e-6\n"
         "	GapJunction			2		50e-6\n"
         "	HHChannel			2		50e-6\n"
         "	HHChannel2D			2		50e-6\n"
         "	Leakage				2		50e-6\n"
-        "	MarkovChannel			2		50e-6\n"
-        "	MarkovGslSolver			2		50e-6\n"
-        "	MarkovRateTable			2		50e-6\n"
-        "	MarkovSolver			2		50e-6\n"
-        "	MarkovSolverBase		2		50e-6\n"
-        "	RC				2		50e-6\n"
-        "	Compartment (init)		3		50e-6\n"
+        "	MarkovChannel		2		50e-6\n"
+        "	MarkovGslSolver		2		50e-6\n"
+        "	MarkovRateTable		2		50e-6\n"
+        "	MarkovSolver		2		50e-6\n"
+        "	MarkovSolverBase	2		50e-6\n"
+        "	RC					2		50e-6\n"
+        "	Compartment (init)	3		50e-6\n"
         "	CompartmentBase (init )		3		50e-6\n"
         "	SymCompartment	(init)		3		50e-6\n"
-        "	Compartment 			4		50e-6\n"
-        "	CompartmentBase			4		50e-6\n"
-        "	SymCompartment			4		50e-6\n"
+        "	Compartment 		4		50e-6\n"
+        "	CompartmentBase		4		50e-6\n"
+        "	SymCompartment		4		50e-6\n"
         "	SpikeGen			5		50e-6\n"
         "	HSolve				6		50e-6\n"
         "	SpikeStats			7		50e-6\n"
@@ -408,23 +408,23 @@ const Cinfo* Clock::initCinfo()
         "	Pool				13		0.1\n"
         "	PoolBase			13		0.1\n"
         "	CplxEnzBase			14		0.1\n"
-        "	Enz				14		0.1\n"
+        "	Enz					14		0.1\n"
         "	EnzBase				14		0.1\n"
         "	MMenz				14		0.1\n"
         "	Reac				14		0.1\n"
         "	ReacBase			14		0.1\n"
-        "	Gsolve	(init)			15		0.1\n"
-        "	Ksolve	(init)			15		0.1\n"
+        "	Gsolve	(init)		15		0.1\n"
+        "	Ksolve	(init)		15		0.1\n"
         "	Gsolve				16		0.1\n"
         "	Ksolve				16		0.1\n"
         "	Stats				17		0.1\n"
         "	Table2				18		1\n"
         "	Streamer			19		10\n"
 
-        "	HDF5DataWriter			30		1\n"
-        "	HDF5WriterBase			30		1\n"
+        "	HDF5DataWriter		30		1\n"
+        "	HDF5WriterBase		30		1\n"
         "	NSDFWriter			30		1\n"
-        "       PyRun                           30              1\n"
+        "   PyRun           	30      1\n"
         "	PostMaster			31		0.01\n"
         "	\n"
         "	Note that the other classes are not scheduled at all.",
@@ -746,7 +746,7 @@ void Clock::handleStep( const Eref& e, unsigned long numSteps )
                 time( &rawtime );
                 timeinfo = localtime( &rawtime );
                 strftime(now, 80, "%c", timeinfo);
-                cout << "@ " << now << ": " << 100 * currentTime_ / runTime_ 
+                cout << "@ " << now << ": " << 100 * currentTime_ / runTime_
                     << "% of total " << runTime_ << " seconds is over." << endl;
             }
         }
@@ -999,5 +999,3 @@ unsigned int Clock::lookupDefaultTick( const string& className )
     }
     return i->second;
 }
-
-
diff --git a/moose-core/synapse/CMakeLists.txt b/moose-core/synapse/CMakeLists.txt
index 2b7d36221cd5c50d3afa67766da3f403a1cd75c2..bb47b9779b8f3d9c7393cd01f44c27f803ee4248 100644
--- a/moose-core/synapse/CMakeLists.txt
+++ b/moose-core/synapse/CMakeLists.txt
@@ -1,18 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-
 include_directories( ../basecode ../utility ../kinetics)
 include_directories( ../external/muparser/include/ )
-
-set( SYNAPSE_SRCS 
-    GraupnerBrunel2012CaPlasticitySynHandler.cpp
-    RollingMatrix.cpp
-    SeqSynHandler.cpp
-    SimpleSynHandler.cpp
-    STDPSynapse.cpp
-    STDPSynHandler.cpp
-    Synapse.cpp
-    SynHandlerBase.cpp
-    testSynapse.cpp
-    )
-
+file(GLOB SYNAPSE_SRCS *.cpp)
 add_library(synapse ${SYNAPSE_SRCS} )
diff --git a/moose-core/synapse/RollingMatrix.cpp b/moose-core/synapse/RollingMatrix.cpp
index 01818a83f98d356536ca787c696a3f67cac6e03d..5fd84a9bfe83c4ab42a239731bc2d96a827759de 100644
--- a/moose-core/synapse/RollingMatrix.cpp
+++ b/moose-core/synapse/RollingMatrix.cpp
@@ -11,7 +11,6 @@
 using namespace std;
 #include "RollingMatrix.h"
 #include <cassert>
-// #include <iostream>
 
 RollingMatrix::RollingMatrix()
 		: nrows_(0), ncolumns_(0), currentStartRow_(0)
@@ -68,21 +67,9 @@ void RollingMatrix::sumIntoRow( const vector< double >& input, unsigned int row
 double RollingMatrix::dotProduct( const vector< double >& input, 
 				unsigned int row, unsigned int startColumn ) const
 {
-	/// startColumn is the middle of the kernel.
 	unsigned int index = (row + currentStartRow_) % nrows_;
 	const SparseVector& sv = rows_[index];
-	unsigned int i2 = input.size()/2;
-	unsigned int istart = (startColumn >= i2) ? 0 : i2-startColumn;
-	unsigned int colstart = (startColumn <= i2) ? 0 : startColumn - i2;
-	unsigned int iend = (sv.size()-startColumn > i2 ) ? input.size() :
-			i2 - startColumn + sv.size();
 
-	// if ( iend >= istart ) cout << startColumn << i2 << istart << iend << colstart << "\n";
-	double ret = 0;
-	for (unsigned int i = istart, j = 0; i < iend; ++i, ++j )
-		ret += sv[j + colstart] * input[i];
-
-	/*
 	double ret = 0;
 	if ( input.size() + startColumn <= sv.size() ) {
 		for (unsigned int i = 0; i < input.size(); ++i )
@@ -92,7 +79,6 @@ double RollingMatrix::dotProduct( const vector< double >& input,
 		for (unsigned int i = 0; i < end; ++i )
 			ret += sv[i + startColumn] * input[i];
 	}
-	*/
 	return ret;
 }
 
diff --git a/moose-core/synapse/SeqSynHandler.cpp b/moose-core/synapse/SeqSynHandler.cpp
index f31f91171120706a2c54f1ffc7ecadbe151409af..51a231ed50906b42e5efcf78e349102244abd57b 100644
--- a/moose-core/synapse/SeqSynHandler.cpp
+++ b/moose-core/synapse/SeqSynHandler.cpp
@@ -8,7 +8,6 @@
 **********************************************************************/
 
 #include <queue>
-#include "global.h"
 #include "header.h"
 #include "Synapse.h"
 #include "SynEvent.h"
@@ -43,22 +42,17 @@ const Cinfo* SeqSynHandler::initCinfo()
 		    "kernel with the history[time][synapse#] matrix."
 			"\nThe local response can affect the synapse in three ways: " 
 			"1. It can sum the entire response vector, scale by the "
-			"*sequenceScale* term, and send to the synapse as a steady "
+			"*responseScale* term, and send to the synapse as a steady "
 			"activation. Consider this a cell-wide immediate response to "
 			"a sequence that it likes.\n"
 			"2. It do an instantaneous scaling of the weight of each "
 			"individual synapse by the corresponding entry in the response "
-			"vector. It uses the *plasticityScale* term to do this. "
-			"Consider "
+			"vector. It uses the *weightScale* term to do this. Consider "
 			"this a short-term plasticity effect on specific synapses. \n"
 			"3. It can do long-term plasticity of each individual synapse "
 			"using the matched local entries in the response vector and "
 			"individual synapse history as inputs to the learning rule. "
 			"This is not yet implemented.\n"
-			"In addition to all these, the SeqSynHandler can act just like "
-			"a regular synapse, where it responds to individual synaptic "
-			"input according to the weight of the synapse. The size of "
-			"this component of the output is scaled by *baseScale*\n"
 	};
 
 	static FieldElementFinfo< SynHandlerBase, Synapse > synFinfo( 
@@ -94,51 +88,22 @@ const Cinfo* SeqSynHandler::initCinfo()
 			&SeqSynHandler::setHistoryTime,
 			&SeqSynHandler::getHistoryTime
 	);
-	static ValueFinfo< SeqSynHandler, double > baseScale(
-			"baseScale",
-			"Basal scaling factor for regular synaptic activation.",
-			&SeqSynHandler::setBaseScale,
-			&SeqSynHandler::getBaseScale
-	);
-	static ValueFinfo< SeqSynHandler, double > sequenceScale(
-			"sequenceScale",
+	static ValueFinfo< SeqSynHandler, double > responseScale(
+			"responseScale",
 			"Scaling factor for sustained activation of synapse by seq",
-			&SeqSynHandler::setSequenceScale,
-			&SeqSynHandler::getSequenceScale
-	);
-	static ValueFinfo< SeqSynHandler, vector< unsigned int > > synapseOrder(
-			"synapseOrder",
-			"Mapping of synapse input order to spatial order on syn array."
-			"Entries in this vector are indices which must remain smaller "
-			"than numSynapses. The system will fix up if you mess up. "
-			"It does not insist on unique mappings, but these are "
-			"desirable as outcome is undefined for repeated entries.",
-			&SeqSynHandler::setSynapseOrder,
-			&SeqSynHandler::getSynapseOrder
-	);
-	static ValueFinfo< SeqSynHandler, int > synapseOrderOption(
-			"synapseOrderOption",
-			"How to do the synapse order remapping. This rule stays in "
-			"place and guarantees safe mappings even if the number of "
-			"synapses is altered. Options:\n"
-		    "-2: User ordering.\n"
-		    "-1: Sequential ordering, 0 to numSynapses-1.\n"
-		    "0: Random ordering using existing system seed.\n"
-		    ">0: Random ordering using seed specified by this number\n"
-			"Default is -1, sequential ordering.",
-			&SeqSynHandler::setSynapseOrderOption,
-			&SeqSynHandler::getSynapseOrderOption
+			&SeqSynHandler::setResponseScale,
+			&SeqSynHandler::getResponseScale
 	);
 	static ReadOnlyValueFinfo< SeqSynHandler, double > seqActivation(
 			"seqActivation",
 			"Reports summed activation of synaptic channel by sequence",
 			&SeqSynHandler::getSeqActivation
 	);
-	static ValueFinfo< SeqSynHandler, double > plasticityScale(
-			"plasticityScale",
-			"Scaling factor for doing plasticity by scaling each synapse by response vector",
-			&SeqSynHandler::setPlasticityScale,
-			&SeqSynHandler::getPlasticityScale
+	static ValueFinfo< SeqSynHandler, double > weightScale(
+			"weightScale",
+			"Scaling factor for weight of each synapse by response vector",
+			&SeqSynHandler::setWeightScale,
+			&SeqSynHandler::getWeightScale
 	);
 	static ReadOnlyValueFinfo< SeqSynHandler, vector< double > > 
 			weightScaleVec(
@@ -163,13 +128,10 @@ const Cinfo* SeqSynHandler::initCinfo()
 		&kernelWidth,				// Field
 		&seqDt,						// Field
 		&historyTime,				// Field
-		&sequenceScale,				// Field
-		&baseScale,					// Field
-		&synapseOrder,				// Field
-		&synapseOrderOption,		// Field
-		&seqActivation,				// ReadOnlyField
-		&plasticityScale,			// Field
-		&weightScaleVec,			// ReadOnlyField
+		&responseScale,				// Field
+		&seqActivation,				// Field
+		&weightScale,				// Field
+		&weightScaleVec,			// Field
 		&kernel,					// ReadOnlyField
 		&history					// ReadOnlyField
 	};
@@ -198,13 +160,12 @@ SeqSynHandler::SeqSynHandler()
 		kernelWidth_( 5 ),
 		historyTime_( 2.0 ), 
 		seqDt_ ( 1.0 ), 
-		baseScale_( 0.0 ),
-		sequenceScale_( 1.0 ),
-		plasticityScale_( 0.0 ),
-		seqActivation_( 0.0 ),
-		synapseOrderOption_( -1 ) // sequential ordering
+		responseScale_( 1.0 ),
+		weightScale_( 0.0 ),
+		seqActivation_( 0.0 )
 { 
-	history_.resize( numHistory(), 0 );
+	int numHistory = static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
+	history_.resize( numHistory, 0 );
 }
 
 SeqSynHandler::~SeqSynHandler()
@@ -232,10 +193,10 @@ void SeqSynHandler::vSetNumSynapses( const unsigned int v )
 	for ( unsigned int i = prevSize; i < v; ++i )
 		synapses_[i].setHandler( this );
 
-	history_.resize( numHistory(), v );
+	int numHistory = static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
+	history_.resize( numHistory, v );
 	latestSpikes_.resize( v, 0.0 );
 	weightScaleVec_.resize( v, 0.0 );
-	refillSynapseOrder( v );
 	updateKernel();
 }
 
@@ -255,65 +216,6 @@ Synapse* SeqSynHandler::vGetSynapse( unsigned int i )
 }
 
 //////////////////////////////////////////////////////////////////////
-
-// Checks for numbers bigger than the size. Replaces with
-// values within the range that have not yet been used.
-void SeqSynHandler::fixSynapseOrder() 
-{
-	unsigned int sz = synapseOrder_.size();
-	vector< unsigned int > availableEntries( sz );
-	iota( availableEntries.begin(), availableEntries.end(), 0 );
-	for( unsigned int i = 0; i < sz; ++i ) {
-		if ( synapseOrder_[i] < sz )
-			availableEntries[ synapseOrder_[i] ] = sz;
-	}
-	vector< unsigned int > ae;
-	for( unsigned int i = 0; i < sz; ++i )
-		if ( availableEntries[i] < sz )
-			ae.push_back( availableEntries[i] );
-
-	auto jj = ae.begin();
-	for( unsigned int i = 0; i < sz; ++i ) {
-		if ( synapseOrder_[i] >= sz )
-			synapseOrder_[i] = *jj++;
-	}
-}
-
-// Beautiful snippet from Lukasz Wiklendt on StackOverflow. Returns order
-// of entries in a vector.
-template <typename T> vector<size_t> sort_indexes(const vector<T> &v) {
-	// initialize original index locations
-	vector<size_t> idx(v.size());
-	iota(idx.begin(), idx.end(), 0);
-	// sort indexes based on comparing values in v
-	sort(idx.begin(), idx.end(),
-		[&v](size_t i1, size_t i2) {return v[i1] < v[i2];});
-	return idx;
-}
-
-void SeqSynHandler::refillSynapseOrder( unsigned int newSize )
-{
-	if ( synapseOrderOption_ <= -2 ) { // User order
-		synapseOrder_.resize( newSize, newSize );
-		fixSynapseOrder();
-	} else if ( synapseOrderOption_ == -1 ) { // Ordered
-		synapseOrder_.resize( newSize );
-		for ( unsigned int i = 0 ; i < newSize; ++i )
-			synapseOrder_[i] = i;
-	} else {
-		synapseOrder_.resize( newSize );
-		if ( synapseOrderOption_ > 0 ) { // Specify seed explicitly
-                    moose::mtseed( synapseOrderOption_ );
-		}
-		vector< double > x;
-		for ( unsigned int i = 0; i < newSize; ++i )
-			x.push_back( moose::mtrand() );
-		auto idx = sort_indexes< double >( x );
-		for ( unsigned int i = 0; i < newSize; ++i )
-			synapseOrder_[i] = idx[i];
-	}
-}
-
 void SeqSynHandler::updateKernel()
 {
 	if ( kernelEquation_ == "" || seqDt_ < 1e-9 || historyTime_ < 1e-9 )
@@ -327,9 +229,9 @@ void SeqSynHandler::updateKernel()
 	p.DefineConst(_T("e"), (mu::value_type)M_E);
 	p.SetExpr( kernelEquation_ );
 	kernel_.clear();
-	int nh = numHistory();
-	kernel_.resize( nh );
-	for ( int i = 0; i < nh; ++i ) {
+	int numHistory = static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
+	kernel_.resize( numHistory );
+	for ( int i = 0; i < numHistory; ++i ) {
 		kernel_[i].resize( kernelWidth_ );
 		t = i * seqDt_;
 		for ( unsigned int j = 0; j < kernelWidth_; ++j ) {
@@ -366,7 +268,8 @@ void SeqSynHandler::setSeqDt( double v )
 {
 	seqDt_ = v;
 	updateKernel();
-	history_.resize( numHistory(), vGetNumSynapses() );
+	int numHistory = static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
+	history_.resize( numHistory, vGetNumSynapses() );
 }
 
 double SeqSynHandler::getSeqDt() const
@@ -377,7 +280,8 @@ double SeqSynHandler::getSeqDt() const
 void SeqSynHandler::setHistoryTime( double v )
 {
 	historyTime_ = v;
-	history_.resize( numHistory(), vGetNumSynapses() );
+	int numHistory = static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
+	history_.resize( numHistory, vGetNumSynapses() );
 	updateKernel();
 }
 
@@ -386,24 +290,14 @@ double SeqSynHandler::getHistoryTime() const
 	return historyTime_;
 }
 
-void SeqSynHandler::setBaseScale( double v )
-{
-	baseScale_ = v;
-}
-
-double SeqSynHandler::getBaseScale() const
-{
-	return baseScale_;
-}
-
-void SeqSynHandler::setSequenceScale( double v )
+void SeqSynHandler::setResponseScale( double v )
 {
-	sequenceScale_ = v;
+	responseScale_ = v;
 }
 
-double SeqSynHandler::getSequenceScale() const
+double SeqSynHandler::getResponseScale() const
 {
-	return sequenceScale_;
+	return responseScale_;
 }
 
 double SeqSynHandler::getSeqActivation() const
@@ -411,26 +305,26 @@ double SeqSynHandler::getSeqActivation() const
 	return seqActivation_;
 }
 
-double SeqSynHandler::getPlasticityScale() const
+double SeqSynHandler::getWeightScale() const
 {
-	return plasticityScale_;
+	return weightScale_;
 }
 
-void SeqSynHandler::setPlasticityScale( double v )
+vector< double >SeqSynHandler::getWeightScaleVec() const
 {
-	plasticityScale_ = v;
+	return weightScaleVec_;
 }
 
-vector< double >SeqSynHandler::getWeightScaleVec() const
+void SeqSynHandler::setWeightScale( double v )
 {
-	return weightScaleVec_;
+	weightScale_ = v;
 }
 
 vector< double > SeqSynHandler::getKernel() const
 {
-	int nh = numHistory();
+	int numHistory = static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
 	vector< double > ret;
-	for ( int i = 0; i < nh; ++i ) {
+	for ( int i = 0; i < numHistory; ++i ) {
 		ret.insert( ret.end(), kernel_[i].begin(), kernel_[i].end() );
 	}
 	return ret;
@@ -438,40 +332,17 @@ vector< double > SeqSynHandler::getKernel() const
 
 vector< double > SeqSynHandler::getHistory() const
 {
-	int nh = numHistory();
+	int numHistory = static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
 	int numX = vGetNumSynapses();
-	vector< double > ret( numX * nh, 0.0 );
+	vector< double > ret( numX * numHistory, 0.0 );
 	vector< double >::iterator k = ret.begin();
-	for ( int i = 0; i < nh; ++i ) {
+	for ( int i = 0; i < numHistory; ++i ) {
 		for ( int j = 0; j < numX; ++j )
 			*k++ = history_.get( i, j );
 	}
 	return ret;
 }
 
-void SeqSynHandler::setSynapseOrder( vector< unsigned int > v )
-{
-	synapseOrder_ = v;
-	fixSynapseOrder();
-	synapseOrderOption_ = -2; // Set the flag to say it is User defined.
-}
-
-vector< unsigned int > SeqSynHandler::getSynapseOrder() const
-{
-	return synapseOrder_;
-}
-
-void SeqSynHandler::setSynapseOrderOption( int v )
-{
-	synapseOrderOption_ = v;
-	refillSynapseOrder( synapseOrder_.size() );
-}
-
-int SeqSynHandler::getSynapseOrderOption() const
-{
-	return synapseOrderOption_;
-}
-
 /////////////////////////////////////////////////////////////////////
 
 void SeqSynHandler::addSpike(unsigned int index, double time, double weight)
@@ -483,9 +354,7 @@ void SeqSynHandler::addSpike(unsigned int index, double time, double weight)
 	// slice. For now, to get it going for LIF neurons, this will do.
 	// Even in the general case we will probably have a very wide window
 	// for the latestSpikes slice.
-	//
-	// Here we reorder the entries in latestSpikes by the synapse order.
-	latestSpikes_[ synapseOrder_[index] ] += weight;
+	latestSpikes_[index] += weight;
 }
 
 unsigned int SeqSynHandler::addSynapse()
@@ -506,10 +375,10 @@ void SeqSynHandler::dropSynapse( unsigned int msgLookup )
 void SeqSynHandler::vProcess( const Eref& e, ProcPtr p ) 
 {
 	// Here we look at the correlations and do something with them.
-	int nh = numHistory();
+	int numHistory = static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
 
 	// Check if we need to do correlations at all.
-	if ( nh > 0 && kernel_.size() > 0 ) {
+	if ( numHistory > 0 && kernel_.size() > 0 ) {
 		// Check if timestep rolls over a seqDt boundary
 		if ( static_cast< int >( p->currTime / seqDt_ ) > 
 				static_cast< int >( (p->currTime - p->dt) / seqDt_ ) ) {
@@ -519,22 +388,22 @@ void SeqSynHandler::vProcess( const Eref& e, ProcPtr p )
 	
 			// Build up the sum of correlations over time
 			vector< double > correlVec( vGetNumSynapses(), 0.0 );
-			for ( int i = 0; i < nh; ++i )
+			for ( int i = 0; i < numHistory; ++i )
 				history_.correl( correlVec, kernel_[i], i );
-			if ( sequenceScale_ > 0.0 ) { // Sum all responses, send to chan
+			if ( responseScale_ > 0.0 ) { // Sum all responses, send to chan
 				seqActivation_ = 0.0;
 				for ( vector< double >::iterator y = correlVec.begin(); 
 								y != correlVec.end(); ++y )
 					seqActivation_ += *y;
 	
 				// We'll use the seqActivation_ to send a special msg.
-				seqActivation_ *= sequenceScale_;
+				seqActivation_ *= responseScale_;
 			}
-			if ( plasticityScale_ > 0.0 ) { // Short term changes in individual wts
+			if ( weightScale_ > 0.0 ) { // Short term changes in individual wts
 				weightScaleVec_ = correlVec;
 				for ( vector< double >::iterator y=weightScaleVec_.begin(); 
 							y != weightScaleVec_.end(); ++y )
-					*y *= plasticityScale_;
+					*y *= weightScale_;
 			}
 		}
 	}
@@ -543,15 +412,15 @@ void SeqSynHandler::vProcess( const Eref& e, ProcPtr p )
 	// We can't leave it to the base class vProcess, because we need
 	// to scale the weights individually in some cases.
 	double activation = seqActivation_; // Start with seq activation
-	if ( plasticityScale_ > 0.0 ) {
+	if ( weightScale_ > 0.0 ) {
 		while( !events_.empty() && events_.top().time <= p->currTime ) {
-			activation += events_.top().weight * baseScale_ * 
+			activation += events_.top().weight * 
 					weightScaleVec_[ events_.top().synIndex ] / p->dt;
 			events_.pop();
 		}
 	} else {
 		while( !events_.empty() && events_.top().time <= p->currTime ) {
-			activation += baseScale_ * events_.top().weight / p->dt;
+			activation += events_.top().weight / p->dt;
 			events_.pop();
 		}
 	}
@@ -565,8 +434,3 @@ void SeqSynHandler::vReinit( const Eref& e, ProcPtr p )
 	while( !events_.empty() )
 		events_.pop();
 }
-
-int SeqSynHandler::numHistory() const
-{
-	return static_cast< int >( 1.0 + floor( historyTime_ * (1.0 - 1e-6 ) / seqDt_ ) );
-}
diff --git a/moose-core/synapse/SeqSynHandler.h b/moose-core/synapse/SeqSynHandler.h
index 45217ba0c4c6e052de5ae11cbc47d35714554a8b..55fd01181bcf868b610c0192456fc04f5c05b71d 100644
--- a/moose-core/synapse/SeqSynHandler.h
+++ b/moose-core/synapse/SeqSynHandler.h
@@ -55,26 +55,15 @@ class SeqSynHandler: public SynHandlerBase
  		double getSeqDt() const;
 		void setHistoryTime( double v );
  		double getHistoryTime() const;
-		void setBaseScale( double v );
- 		double getBaseScale() const;
-		void setSequenceScale( double v );
- 		double getSequenceScale() const;
-		void setSynapseOrder( vector< unsigned int> v );
- 		vector< unsigned int> getSynapseOrder() const;
-		void setSynapseOrderOption( int v );
- 		int getSynapseOrderOption() const;
+		void setResponseScale( double v );
+ 		double getResponseScale() const;
  		double getSeqActivation() const; // summed activation of syn chan
-		void setPlasticityScale( double v );
- 		double getPlasticityScale() const;
+		void setWeightScale( double v );
+ 		double getWeightScale() const;
  		vector< double > getWeightScaleVec() const;
  		vector< double > getKernel() const;
  		vector< double > getHistory() const;
 
-		////////////////////////////////////////////////////////////////
-		// Utility func
-		int numHistory() const;
-		void refillSynapseOrder( unsigned int newSize );
-		void fixSynapseOrder();
 		////////////////////////////////////////////////////////////////
 		static const Cinfo* initCinfo();
 	private:
@@ -95,19 +84,13 @@ class SeqSynHandler: public SynHandlerBase
 		string kernelEquation_;
 		unsigned int kernelWidth_; // Width in terms of number of synapses 
 
-		/// Time to store history. KernelDt defines num of rows
+		// Time to store history. KernelDt defines num of rows
 		double historyTime_;	
 		double seqDt_;	// Time step for successive entries in kernel
-		/// Scaling factor for baseline synaptic responses.
-		double baseScale_; 
-		/// Scaling factor for sequence recognition responses.
-		double sequenceScale_; 
-
-		/**
-		 * Scaling factor for short-term plastic weight changes in each 
-		 * synapse arising from sequential input.
-		 */
-		double plasticityScale_;
+		// Scaling factor for sustained activation of synapse from response
+		double responseScale_; 
+		// Scaling factor for weight changes in each synapse from response
+		double weightScale_;
 
 		///////////////////////////////////////////
 		// Some readonly fields
@@ -122,23 +105,8 @@ class SeqSynHandler: public SynHandlerBase
 		vector< double > latestSpikes_; 
 
 		///////////////////////////////////////////
-		vector< vector<  double > > kernel_; ///Kernel for seq selectivity
-		RollingMatrix history_;	/// Rows = time; cols = synInputs
-		/**
-		 * Remaps synapse order to avoid correlations based on presynaptic 
-		 * object Id order, or on connection building order. This 
-		 * undesirable ordering occurs even when random synaptic
-		 * projections are used. User can alter as preferred. This is 
-		 * simply a look up table so that the incoming synapse index is
-		 * remapped: index_on_Handler = synapseOrder_[original_syn_index]
-		 * This must only have numbers from zero to numSynapses, and should
-		 * normally have all the numbers.
-		 */
-		vector< unsigned int > synapseOrder_; 
-
-		/// Options: -2: User. -1: ordered. 0: random by system seed. 
-		/// > 0: Random by seed specified by this number
-		int synapseOrderOption_;
+		vector< vector<  double > > kernel_;	//Kernel for seq selectivity
+		RollingMatrix history_;	// Rows = time; cols = synInputs
 
 		vector< Synapse > synapses_;
 		priority_queue< PreSynEvent, vector< PreSynEvent >, CompareSynEvent > events_;
diff --git a/moose-core/synapse/testSynapse.cpp b/moose-core/synapse/testSynapse.cpp
index b39b87bd654e47cd3b03dfd7f8af665b31068715..2edd4165c1c5866effe687f2e08e5bc943e792fe 100644
--- a/moose-core/synapse/testSynapse.cpp
+++ b/moose-core/synapse/testSynapse.cpp
@@ -20,48 +20,6 @@
 #include "../shell/Shell.h"
 #include "../randnum/randnum.h"
 
-double doCorrel( RollingMatrix& rm, vector< vector< double >> & kernel )
-{
-	int nr = kernel.size();
-	vector< double > correlVec( nr, 0.0 );
-	for ( int i = 0; i < nr; ++i )
-		rm.correl( correlVec, kernel[i], i );
-	double seqActivation = 0.0;
-	for ( int i = 0; i < nr; ++i )
-		seqActivation += correlVec[i];
-	return seqActivation;
-}
-
-void testRollingMatrix2()
-{
-	int nr = 5;
-	RollingMatrix rm;
-	rm.resize( nr, nr );
-	vector< vector< double > > kernel( nr );
-	for ( int i = 0; i < nr; ++i ) {
-		kernel[i].resize( nr, 0.0 );
-		rm.zeroOutRow( i );
-		for ( int j = 0; j < nr; ++j ) {
-			kernel[i][j] = 16 - (i-j)*(i-j); // symmetric, forward
-			rm.sumIntoEntry( (i==j), i, j );
-		}
-	}
-	double ret1 = doCorrel( rm, kernel );
-
-	for ( int i = 0; i < nr; ++i ) {
-		kernel[i].clear();
-		kernel[i].resize( nr, 0.0 );
-		rm.zeroOutRow( i );
-		for ( int j = 0; j < nr; ++j ) {
-			int k = nr-i-1;
-			kernel[i][j] = 16 - (k-j)*(k-j); // symmetric, backwards
-			rm.sumIntoEntry( (k==j), i, j );
-		}
-	}
-	double ret2 = doCorrel( rm, kernel );
-	assert( doubleEq( ret1, ret2 ) );
-}
-
 void testRollingMatrix()
 {
 	int nr = 5;
@@ -99,59 +57,44 @@ void testRollingMatrix()
 	for ( int i = 0; i < nr; ++i )
 			input[i] = i + 1;
 
-	assert( doubleEq( rm.dotProduct( input, 0, 5 ), 0.0 ) );
-	assert( doubleEq( rm.dotProduct( input, 1, 5 ), 1.0 ) );
-	assert( doubleEq( rm.dotProduct( input, 2, 5 ), 4.0 ) );
-	assert( doubleEq( rm.dotProduct( input, 3, 5 ), 9.0 ) );
-	assert( doubleEq( rm.dotProduct( input, 4, 5 ), 16.0 ) );
-	assert( doubleEq( rm.dotProduct( input, 4, 6 ), 12.0 ) );
-	assert( doubleEq( rm.dotProduct( input, 4, 7 ), 8.0 ) );
-	assert( doubleEq( rm.dotProduct( input, 4, 8 ), 4.0 ) );
-	assert( doubleEq( rm.dotProduct( input, 4, 9 ), 0.0 ) );
-
-	// Note that the input and the row are aligned at col=5, the 
-	// middle of the input vector. 
+	assert( doubleEq( rm.dotProduct( input, 0, 0 ), 0.0 ) );
+	assert( doubleEq( rm.dotProduct( input, 1, 0 ), 1.0 ) );
+	assert( doubleEq( rm.dotProduct( input, 2, 0 ), 4.0 ) );
+	assert( doubleEq( rm.dotProduct( input, 3, 0 ), 9.0 ) );
+	assert( doubleEq( rm.dotProduct( input, 4, 0 ), 16.0 ) );
+	assert( doubleEq( rm.dotProduct( input, 4, 1 ), 12.0 ) );
+	assert( doubleEq( rm.dotProduct( input, 4, 2 ), 8.0 ) );
+	assert( doubleEq( rm.dotProduct( input, 4, 3 ), 4.0 ) );
+	assert( doubleEq( rm.dotProduct( input, 4, 4 ), 0.0 ) );
+
 	rm.sumIntoRow( input, 0 );	// input == [1234500000]
 	vector< double > corr;
 	rm.correl( corr, input, 4 );	// rm[4] == [00040000]
-	assert( doubleEq( corr[0], 0.0 ) );
-	assert( doubleEq( corr[1], 0.0 ) );
-	assert( doubleEq( corr[2], 0.0 ) );
-	assert( doubleEq( corr[3], 0.0 ) );
-	assert( doubleEq( corr[4], 20.0 ) );
-	assert( doubleEq( corr[5], 16.0 ) );
-	assert( doubleEq( corr[6], 12.0 ) );
-	assert( doubleEq( corr[7], 8.0 ) );
-	assert( doubleEq( corr[8], 4.0 ) );
-	assert( doubleEq( corr[9], 0.0 ) );
+	assert( doubleEq( corr[0], 16.0 ) );
+	assert( doubleEq( corr[1], 12.0 ) );
+	assert( doubleEq( corr[2], 8.0 ) );
+	assert( doubleEq( corr[3], 4.0 ) );
+	assert( doubleEq( corr[4], 0.0 ) );
 
 	corr.assign( corr.size(), 0 );
 	rm.correl( corr, input, 0 );	// rm[0] == [1234500000]
-	assert( doubleEq( corr[0], 0.0 ) );
-	assert( doubleEq( corr[1], 5.0 ) );
-	assert( doubleEq( corr[2], 14.0 ) );
-	assert( doubleEq( corr[3], 26.0 ) );
-	assert( doubleEq( corr[4], 40.0 ) );
-	assert( doubleEq( corr[5], 55.0 ) );
-	assert( doubleEq( corr[6], 40.0 ) );
-	assert( doubleEq( corr[7], 26.0 ) );
-	assert( doubleEq( corr[8], 14.0 ) );
-	assert( doubleEq( corr[9], 5.0 ) );
+	assert( doubleEq( corr[0], 55.0 ) );
+	assert( doubleEq( corr[1], 40.0 ) );
+	assert( doubleEq( corr[2], 26.0 ) );
+	assert( doubleEq( corr[3], 14.0 ) );
+	assert( doubleEq( corr[4], 5.0 ) );
 
 	cout << "." << flush;
 }
 
-// FIXME: This test is failing on travis.
 void testSeqSynapse()
 {
 	int numSyn = 10;
 	int kernelWidth = 5;
 	SeqSynHandler ssh;
 	ssh.vSetNumSynapses( numSyn );
-
 	// for ( int i = 0; i < numSyn; ++i )
 		// ssh.addSynapse();
-
 	assert( static_cast< int >( ssh.vGetNumSynapses() ) == numSyn );
 	ssh.setSeqDt( 1.0 );
 	ssh.setHistoryTime( 5.0 );
@@ -170,12 +113,11 @@ void testSeqSynapse()
 
 	cout << "." << flush;
 
-	ssh.setBaseScale( 1.0 );
-	ssh.setSequenceScale( 1.0 );
+	ssh.setResponseScale( 1.0 );
 	for ( int i = 0; i < numSyn; ++i ) {
 		ssh.addSpike( i, 0.0, 1.0 );
 	}
-	ssh.setPlasticityScale( 1.0 );
+	ssh.setWeightScale( 1.0 );
 	ProcInfo p;
 
 	Eref sheller( Id().eref() );
@@ -187,13 +129,14 @@ void testSeqSynapse()
 	// Here we correlate the vector [1,1,1,1,1,1,1,1,1,1,1] with
 	// the kernel [4,1,-1,-1,-1]
 	// Other lines are zeros.
-	assert( doubleEq( ssh.getSeqActivation(), 14.0 ) );
+	// Should really make the kernel mapping symmetrical.
+	assert( doubleEq( ssh.getSeqActivation(), 28.0 ) );
 	vector< double > wts = ssh.getWeightScaleVec();
-	for ( int i = 2; i < numSyn-2; ++i )
+	for ( int i = 0; i < numSyn-4; ++i )
 		assert( doubleEq( wts[i], 2.0 ) );
-	assert( doubleEq( wts[0], -3 ) ); // Edge effects.
-	assert( doubleEq( wts[1], -2 ) ); // Edge effects. 
-	assert( doubleEq( wts[8], 3 ) ); // Edge effects.
+	assert( doubleEq( wts[6], 3 ) ); // Edge effects. Last -1 vanishes.
+	assert( doubleEq( wts[7], 4 ) ); // Edge effects. 
+	assert( doubleEq( wts[8], 5 ) ); // Edge effects.
 	assert( doubleEq( wts[9], 4 ) ); // Edge effects.
 		
 	cout << "." << flush;
@@ -207,7 +150,6 @@ void testSynapse()
 {
 #ifdef DO_UNIT_TESTS
 	testRollingMatrix();
-	testRollingMatrix2();
 	testSeqSynapse();
 #endif // DO_UNIT_TESTS
 }
diff --git a/moose-core/tests/python/test_difshells.py b/moose-core/tests/python/test_difshells.py
index 367b953a8a55d3bcb8d6563b4fa57f7688a42450..669f46a891717c87cac7892988f86b652af8af05 100644
--- a/moose-core/tests/python/test_difshells.py
+++ b/moose-core/tests/python/test_difshells.py
@@ -115,6 +115,7 @@ if __name__ == '__main__':
     dend.initVm = Vm_0
     dend.diameter = dend_diameter
     dend.length = dend_length
+
     pulse.delay[0] = 8.
     pulse.width[0] = 500e-3
     pulse.level[0] = inject
diff --git a/moose-examples/.travis.yml b/moose-examples/.travis.yml
index 9dd0e12f56f0581926f81b81d1a92905da260ef8..7118d2512a86d01c670fcbb07c9fbb6c6f82af46 100644
--- a/moose-examples/.travis.yml
+++ b/moose-examples/.travis.yml
@@ -3,7 +3,7 @@ notifications:
         recipients:
             - dilawar.s.rajput@gmail.com
             - upi.bhalla@gmail.com
-            - malavs@ncbs.res.in
+            - ray.shubhasis@gmail.com
             - hrani@ncbs.res.in
 
 
diff --git a/moose-examples/snippets/cspaceSteadyState.py b/moose-examples/snippets/cspaceSteadyState.py
index 7cd2f012fa2b0b359d8f6aa3e515c9fc0976d0d1..3f25731170e021dba1b2d7f0702cacd20b0be923 100644
--- a/moose-examples/snippets/cspaceSteadyState.py
+++ b/moose-examples/snippets/cspaceSteadyState.py
@@ -35,12 +35,12 @@ def getState( ksolve, state ):
 
 def main():
     """
+
     This example sets up the kinetic solver and steady-state finder, on
     a bistable model.
     It looks for the fixed points 100 times, as follows:
     - Set up the random initial condition that fits the conservation laws
     - Run for 2 seconds. This should not be mathematically necessary, but
-<<<<<<< HEAD
       for obscure numerical reasons it makes it much more likely that the
       steady state solver will succeed in finding a state.
     - Find the fixed point
@@ -48,15 +48,6 @@ def main():
     - Run for 10 seconds. This is completely unnecessary, and is done here
       just so that the resultant graph will show what kind of state has been
       found.
-=======
-           for obscure numerical reasons it makes it much more likely that the
-           steady state solver will succeed in finding a state.
-    - Find the fixed point
-    - Print out the fixed point vector and various diagnostics.
-    - Run for 10 seconds. This is completely unnecessary, and is done here
-            just so that the resultant graph will show what kind of state has been
-           found.
->>>>>>> 0e491aa41584cf7a66c0e242374d8ee61660eb7b
     After it does all this, the program runs for 100 more seconds on the last
     found fixed point (which turns out to be a saddle node), then
     is hard-switched in the script to the first attractor basin from which
@@ -65,7 +56,6 @@ def main():
     seconds.
     Looking at the output you will see many features of note:
     - the first attractor (stable point) and the saddle point
-<<<<<<< HEAD
       (unstable fixed point) are both found quite often. But the second
       attractor is found just once. Has a very small basin of attraction.
     - The values found for each of the fixed points match well with the
@@ -73,15 +63,11 @@ def main():
     - There are a large number of failures to find a fixed point. These are
       found and reported in the diagnostics. They show up on the plot
       as cases where the 10-second runs are not flat.
-=======
-           (unstable fixed point) are both found quite often. But the second
-           attractor is found just once. Has a very small basin of attraction.
     - The values found for each of the fixed points match well with the
-           values found by running the system to steady-state at the end.
+      values found by running the system to steady-state at the end.
     - There are a large number of failures to find a fixed point. These are
-            found and reported in the diagnostics. They show up on the plot
-            as cases where the 10-second runs are not flat.
->>>>>>> 0e491aa41584cf7a66c0e242374d8ee61660eb7b
+      found and reported in the diagnostics. They show up on the plot
+      as cases where the 10-second runs are not flat.
 
     If you wanted to find fixed points in a production model, you would
     not need to do the 10-second runs, and you would need to eliminate the
@@ -91,7 +77,9 @@ def main():
     this algorithm!
     You may wish to sample concentration space logarithmically rather than
     linearly.
+
     """
+
     # The wildcard uses # for single level, and ## for recursive.
     #compartment = makeModel()
     moose.loadModel( '../genesis/M1719.cspace', '/model', 'ee' )
diff --git a/moose-examples/snippets/funcInputToPools.py b/moose-examples/snippets/funcInputToPools.py
index 4a5d8033070ca20ec44022642f2bd14e4d4f0a09..279253bf2e960ba44030259082dcb37478bd8309 100644
--- a/moose-examples/snippets/funcInputToPools.py
+++ b/moose-examples/snippets/funcInputToPools.py
@@ -80,8 +80,8 @@ This example describes the special (and discouraged) use case where
 functions provide input to a reaction system. Here we have two functions of
 time which control the pool # and pool rate of change, respectively::
 
-number of molecules of a = 1 + sin(t)
-rate of change of number of molecules of b = 10 * cos(t)
+    number of molecules of a = 1 + sin(t)
+    rate of change of number of molecules of b = 10 * cos(t)
 
 In the stochastic case one must set a special flag *useClockedUpdate*
 in order to achieve clock-triggered updates from the functions. This is
diff --git a/moose-examples/snippets/loadKineticModel.py b/moose-examples/snippets/loadKineticModel.py
index f4e39bc949375414f6c6f16d6e35a380c18410e9..7cf4430b0f2249ca6e95ebb1ed4615061f63693e 100644
--- a/moose-examples/snippets/loadKineticModel.py
+++ b/moose-examples/snippets/loadKineticModel.py
@@ -6,7 +6,7 @@
 # Maintainer:
 # Created: Sat Oct 04 12:14:15 2014 (+0530)
 # Version:
-# Last-Updated: Tue Apr 18 17:40:00 2017(+0530)
+# Last-Updated:
 #           By:
 #     Update #: 0
 # URL:
@@ -48,65 +48,50 @@ import moose
 import pylab
 import numpy
 import sys
-import os
+
 def main():
-    """
+        """
     This example illustrates loading, running, and saving a kinetic
     model defined in kkit format. It uses a default kkit model but
     you can specify another using the command line
-    ``python loadKineticModel.py filepath runtime solver``.
-    We use default solver as gsl.
+
+	    ``python filename runtime solver``.
+
+    We use the gsl solver here.
     The model already defines a couple of plots and sets the runtime 20 secs.
-    """
-    
-    defaultsolver = "gsl"  # Pick any of gsl, gssa, ee..
-    defaultfile = '../genesis/kkit_objects_example.g'
-    defaultruntime = 20.0
-    
-    try:
-        sys.argv[1]
-    except IndexError:
-        filepath = defaultfile
-    else:
-        filepath = sys.argv[1]
-    if not os.path.exists(filepath):
-        print ("Filename or path does not exist \"%s\" loading default file \"%s\" " %(filepath ,defaultfile))
-        filepath = defaultfile
-    
-    try:
-        sys.argv[2]
-    except :
-        runtime = defaultruntime
-    else:
-        runtime = float(sys.argv[2])
 
-    try:
-        sys.argv[3]
-    except :
-        solver = defaultsolver
-    else:
-        solver = sys.argv[3]
-    
-    modelId = moose.loadModel( filepath, 'model', solver )
-    
-    # Increase volume so that the stochastic solver gssa
-    # gives an interesting output
-    #compt = moose.element( '/model/kinetics' )
-    #compt.volume = 1e-19
+        """
+
+        solver = "gsl"  # Pick any of gsl, gssa, ee..
+        mfile = '../genesis/kkit_objects_example.g'
+        runtime = 20.0
+        if ( len( sys.argv ) >= 3 ):
+            if sys.argv[1][0] == '/':
+                mfile = sys.argv[1]
+            else:
+                mfile = '../genesis/' + sys.argv[1]
+                runtime = float( sys.argv[2] )
+        if ( len( sys.argv ) == 4 ):
+                solver = sys.argv[3]
+        modelId = moose.loadModel( mfile, 'model', solver )
+        # Increase volume so that the stochastic solver gssa
+        # gives an interesting output
+        #compt = moose.element( '/model/kinetics' )
+        #compt.volume = 1e-19
 
-    moose.reinit()
-    moose.start( runtime )
+        moose.reinit()
+        moose.start( runtime )
 
 
-    # Display all plots.
-    for x in moose.wildcardFind( '/model/#graphs/conc#/#' ):
-        t = numpy.arange( 0, x.vector.size, 1 ) * x.dt
-        pylab.plot( t, x.vector, label=x.name )
-    pylab.legend()
-    pylab.show()
+        # Display all plots.
+        for x in moose.wildcardFind( '/model/#graphs/conc#/#' ):
+            t = numpy.arange( 0, x.vector.size, 1 ) * x.dt
+            pylab.plot( t, x.vector, label=x.name )
+        pylab.legend()
+        pylab.show()
 
-    quit()
+        quit()
 
 # Run the 'main' if this script is executed standalone.
 if __name__ == '__main__':
-    main()
+        main()
diff --git a/moose-examples/snippets/loadSbmlmodel.py b/moose-examples/snippets/loadSbmlmodel.py
index 53ebd078f317da80b6923c1dc5eb6be9e0aa2fa9..153eeb07fd466d7ce3db9a54d54850b53bb8bc34 100644
--- a/moose-examples/snippets/loadSbmlmodel.py
+++ b/moose-examples/snippets/loadSbmlmodel.py
@@ -47,13 +47,15 @@ from moose.chemUtil.add_Delete_ChemicalSolver import *
 
 def main():
     """
-This example illustrates loading, running of an SBML model defined in XML format.
-Default this  file load's 00001-sbml-l3v1.xml which is taken from l3v1 SBML testcase.
-Plots are setup.
-Model is run for 20sec.
-As a general rule we created model under '/path/model' and plots under '/path/graphs'.
-If someone wants to load anyother file then 
+    This example illustrates loading, running of an SBML model defined in XML format.
+    Default this  file load's 00001-sbml-l3v1.xml which is taken from l3v1 SBML testcase.
+    Plots are setup.
+    Model is run for 20sec.
+    As a general rule we created model under '/path/model' and plots under '/path/graphs'.
+    If someone wants to load anyother file then
+
     `python loadSbmlmodel filepath runtime`
+
     """
 
     dfilepath = "../genesis/00001-sbml-l3v1.xml"
@@ -63,13 +65,13 @@ If someone wants to load anyother file then
         sys.argv[1]
     except IndexError:
         filepath = dfilepath
-        
+
     else:
         filepath = sys.argv[1]
     if not os.path.exists(filepath):
         msg = "Filename or path does not exist",filepath,"loading default file",dfilepath
         filepath = dfilepath
-        
+
     try:
         sys.argv[2]
     except :
@@ -103,7 +105,7 @@ If someone wants to load anyother file then
         moose.reinit()
         moose.start(runtime)
         return sbmlId,True,msg
-    return sbmlId,False,msg 
+    return sbmlId,False,msg
 
 def displayPlots():
     # Display all plots.
@@ -119,11 +121,9 @@ def displayPlots():
 if __name__=='__main__':
     modelPath = moose.element('/')
     modelpathexist = False
-    msg = "" 
+    msg = ""
     modelPath, modelpathexist,msg = main()
     if msg:
         print (msg)
     if modelpathexist == True:
         displayPlots()
-
-    
diff --git a/moose-examples/snippets/nsdf_demo.h5 b/moose-examples/snippets/nsdf_demo.h5
index 1e67dd0d1e6ab30bb8aa15494b479f51f9f84404..4f9e9607414a5db9633db7f3ae6e571e86326b58 100644
Binary files a/moose-examples/snippets/nsdf_demo.h5 and b/moose-examples/snippets/nsdf_demo.h5 differ
diff --git a/moose-examples/snippets/nsdf_vec_demo.h5 b/moose-examples/snippets/nsdf_vec_demo.h5
index c58441f1caffa9b7954c35b989672a7dd23f99b1..53193ce7dd17bab952c1f0c4ba45b9793a861c4a 100644
Binary files a/moose-examples/snippets/nsdf_vec_demo.h5 and b/moose-examples/snippets/nsdf_vec_demo.h5 differ
diff --git a/moose-examples/snippets/output_hdfdemo.h5 b/moose-examples/snippets/output_hdfdemo.h5
index 392542373caba52878c01627ad94146bcf81babf..64a09e6feb9c15cb5db3380f635f087775005f2a 100644
Binary files a/moose-examples/snippets/output_hdfdemo.h5 and b/moose-examples/snippets/output_hdfdemo.h5 differ
diff --git a/moose-examples/snippets/pyrun.py b/moose-examples/snippets/pyrun.py
index 80bcaf38680756f0a862952c21acb1e87d5c09e0..ab1df2bd76603e7aca14087f89878e56f642780b 100644
--- a/moose-examples/snippets/pyrun.py
+++ b/moose-examples/snippets/pyrun.py
@@ -91,7 +91,7 @@ print 'Hello count =', hello_count
 hello_count += 1
 """
     hello_runner.run('from datetime import datetime')
-    hello_runner.run('print "Hello: current time:", datetime.now().isoformat()')
+    hello_runner.run('print("Hello: current time:", datetime.now().isoformat())')
     moose.useClock(0, hello_runner.path, 'process')
     world_runner = moose.PyRun('World')
     world_runner.initString = """
@@ -107,7 +107,7 @@ print 'World count =', world_count
 incr_count()
 """
     world_runner.run('from datetime import datetime')
-    world_runner.run('print "World: current time:", datetime.now().isoformat()')
+    world_runner.run('print("World: current time:", datetime.now().isoformat())')
 
     moose.useClock(0, world_runner.path, 'process')
     moose.reinit()
@@ -213,4 +213,4 @@ if __name__ == '__main__':
 
 
 #
-# pyrun.py ends here
+# pyrun.py ends here
\ No newline at end of file
diff --git a/moose-examples/snippets/pyrun1.py b/moose-examples/snippets/pyrun1.py
index 312cdf5c46d43da3989833015503f598d1f49941..2e1f7f6822fdffd459acb5d148f6a8faafc352e3 100644
--- a/moose-examples/snippets/pyrun1.py
+++ b/moose-examples/snippets/pyrun1.py
@@ -99,7 +99,7 @@ print 'Hello count =', hello_count
 hello_count += 1
 """
     hello_runner.run('from datetime import datetime')
-    hello_runner.run('print "Hello: current time:", datetime.now().isoformat()')
+    hello_runner.run('print("Hello: current time:", datetime.now().isoformat())')
     moose.useClock(0, hello_runner.path, 'process')
     world_runner = moose.PyRun('World')
     world_runner.initString = """
@@ -115,7 +115,7 @@ print 'World count =', world_count
 incr_count()
 """
     world_runner.run('from datetime import datetime')
-    world_runner.run('print "World: current time:", datetime.now().isoformat()')
+    world_runner.run('print("World: current time:", datetime.now().isoformat())')
 
     moose.useClock(0, world_runner.path, 'process')
     moose.reinit()
@@ -218,4 +218,4 @@ if __name__ == '__main__':
     main()
 
 #
-# pyrun.py ends here
+# pyrun.py ends here
\ No newline at end of file
diff --git a/moose-examples/snippets/reacDiffBranchingNeuron.py b/moose-examples/snippets/reacDiffBranchingNeuron.py
index ac4de98234afd462ae5ad11d15ad4cc14ef605c4..f2ef7980304ffe2553840e00628aa6f00c69c728 100644
--- a/moose-examples/snippets/reacDiffBranchingNeuron.py
+++ b/moose-examples/snippets/reacDiffBranchingNeuron.py
@@ -120,21 +120,17 @@ def makeChemModel( compt ):
     """
 This function sets up a simple oscillatory chemical system within
 the script. The reaction system is::
-<<<<<<< HEAD
 
     s ---a---> a  // s goes to a, catalyzed by a.
     s ---a---> b  // s goes to b, catalyzed by a.
     a ---b---> s  // a goes to s, catalyzed by b.
     b -------> s  // b is degraded irreversibly to s.
 
-=======
-
     s ---a---> a  // s goes to a, catalyzed by a.
     s ---a---> b  // s goes to b, catalyzed by a.
     a ---b---> s  // a goes to s, catalyzed by b.
     b -------> s  // b is degraded irreversibly to s.
 
->>>>>>> 0e491aa41584cf7a66c0e242374d8ee61660eb7b
 in sum, **a** has a positive feedback onto itself and also forms **b**.
 **b** has a negative feedback onto **a**.
 Finally, the diffusion constant for **a** is 1/10 that of **b**.
diff --git a/moose-examples/snippets/recurrentIntFire.py b/moose-examples/snippets/recurrentIntFire.py
index 18222b945e6d257cd607f22561082d0da6890c24..81228613d6f12931795ebaec202cc70cfa5929f9 100644
--- a/moose-examples/snippets/recurrentIntFire.py
+++ b/moose-examples/snippets/recurrentIntFire.py
@@ -66,9 +66,9 @@ def make_network():
         stats.vec.windowLength = 1 # timesteps to put together.
         plots = moose.Table( '/plot', numStats )
         convergence = size / numStats
-        for i in range( numStats ):
-            for j in range( size/numStats ):
-                k = i * convergence + j
+        for i in range( int(numStats) ):
+            for j in range( int(size/numStats) ):
+                k = int(i * convergence + j)
                 moose.connect( network.vec[k], 'spikeOut', stats.vec[i], 'addSpike' )
         moose.connect( plots, 'requestOut', stats, 'getMean', 'OneToOne' )
 
@@ -114,4 +114,4 @@ def main():
 	make_network()
 
 if __name__ == '__main__':
-	main()
+	main()
\ No newline at end of file
diff --git a/moose-examples/snippets/recurrentLIF.py b/moose-examples/snippets/recurrentLIF.py
index d59fcd3eae848a726af2899a46b37d3a4cdf5fe5..aaf5220cb56206617a7bb11df52e0d0cf1905d84 100644
--- a/moose-examples/snippets/recurrentLIF.py
+++ b/moose-examples/snippets/recurrentLIF.py
@@ -67,10 +67,11 @@ def make_network():
         stats.vec.windowLength = 1 # timesteps to put together.
         plots = moose.Table( '/plot', numStats )
         convergence = size / numStats
-        for i in range( numStats ):
-            for j in range( size/numStats ):
-                k = i * convergence + j
+        for i in range( int(numStats) ):
+            for j in range( int(size/numStats) ):
+                k = int(i * convergence + j)
                 moose.connect( network.vec[k], 'spikeOut', stats.vec[i], 'addSpike' )
+
         moose.connect( plots, 'requestOut', stats, 'getMean', 'OneToOne' )
 
         #moose.useClock( 0, '/network/syns,/network', 'process' )
@@ -114,4 +115,4 @@ def main():
 	make_network()
 
 if __name__ == '__main__':
-	main()
+	main()
\ No newline at end of file
diff --git a/moose-examples/snippets/rxdSpineSize.py b/moose-examples/snippets/rxdSpineSize.py
index 5ce86e6048aeb2b4f95c6d2c7adaded1d65dd2a5..6e150e2bb3d9d09bee17e54c383fdff994f89580 100644
--- a/moose-examples/snippets/rxdSpineSize.py
+++ b/moose-examples/snippets/rxdSpineSize.py
@@ -11,7 +11,7 @@ import moogli
 import moogli.extensions.moose
 import matplotlib
 
-PI = 3.141592653
+PI = numpy.pi
 ScalingForTesting = 10
 RM = 1.0 / ScalingForTesting
 RA = 1.0 * ScalingForTesting
@@ -28,7 +28,7 @@ spineSpacing = 10e-6
 spineSpacingDistrib = 1e-6
 spineSize = 1.0
 spineSizeDistrib = 0.5
-spineAngle= numpy.pi / 2.0
+spineAngle= PI / 2.0
 spineAngleDistrib = 0.0
 
 def makeCellProto( name ):
diff --git a/moose-examples/snippets/testRdesigneur.py b/moose-examples/snippets/testRdesigneur.py
index 856b905e58caf52b46bde701018ef3d7cc7fe363..1de81ad641c079b18d2cc25aad0ecc16943330ca 100644
--- a/moose-examples/snippets/testRdesigneur.py
+++ b/moose-examples/snippets/testRdesigneur.py
@@ -9,6 +9,7 @@ from PyQt4 import QtGui
 import rdesigneur as rd
 import moogli
 
+PI = numpy.pi
 RM = 1.0
 RA = 1.0
 CM = 0.01
@@ -22,8 +23,7 @@ spineSpacingDistrib = 0.0
 spineSize = 1.0
 spineSizeDistrib = 0.2
 spineAngle= 0.0
-spineAngleDistrib = 2*numpy.pi
-
+spineAngleDistrib = 2*PI
 
 # Here we define a function that is used to make a cell prototype. Normally
 # it would load in a model from a file.
diff --git a/moose-examples/snippets/testWigglySpines.py b/moose-examples/snippets/testWigglySpines.py
index bd49a6156fd037db4eb1726298aa97794ed75a83..a85bf1efef7b47793518c033cc22083a20fa4336 100644
--- a/moose-examples/snippets/testWigglySpines.py
+++ b/moose-examples/snippets/testWigglySpines.py
@@ -1,7 +1,5 @@
 from __future__ import print_function
 
-from __future__ import print_function
-
 import math
 import pylab
 import numpy
@@ -16,7 +14,7 @@ import os
 scriptDir = os.path.dirname( os.path.realpath( __file__ ) )
 sys.path.append( os.path.join( scriptDir, '../util' ) )
 
-PI = 3.141592653
+PI = numpy.pi
 ScalingForTesting = 10
 RM = 1.0 / ScalingForTesting
 RA = 1.0 * ScalingForTesting
@@ -28,7 +26,7 @@ spineSpacing = 1.5e-6
 spineSpacingDistrib = 1e-10
 spineSize = 1.0
 spineSizeDistrib = 0
-spineAngle= numpy.pi / 2.0
+spineAngle= PI / 2.0
 spineAngleDistrib = 0.0
 
 
diff --git a/moose-examples/snippets/testsave.g b/moose-examples/snippets/testsave.g
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5b6516f6d26217fbf06afd9991b13a2652bcaccd 100644
--- a/moose-examples/snippets/testsave.g
+++ b/moose-examples/snippets/testsave.g
@@ -0,0 +1,68 @@
+//genesis
+// kkit Version 11 flat dumpfile
+
+// Saved on 100
+include kkit {argv 1}
+FASTDT = 0.001
+SIMDT = 0.001
+CONTROLDT = 0.1
+PLOTDT = 0.1
+MAXTIME = 100
+TRANSIENT_TIME = 2
+VARIABLE_DT_FLAG = 0
+DEFAULT_VOL = 1.66666666667e-19
+VERSION = 11.0 
+setfield /file/modpath value ~/scripts/modules
+kparms
+
+//genesis
+initdump -version 3 -ignoreorphans 1
+simobjdump table input output alloced step_mode stepsize x y z
+simobjdump xtree path script namemode sizescale
+simobjdump xcoredraw xmin xmax ymin ymax
+simobjdump xtext editable
+simobjdump xgraph xmin xmax ymin ymax overlay
+simobjdump xplot pixflags script fg ysquish do_slope wy
+simobjdump group xtree_fg_req xtree_textfg_req plotfield expanded movealone \
+  link savename file version md5sum mod_save_flag x y z
+simobjdump geometry size dim shape outside xtree_fg_req xtree_textfg_req x y z
+simobjdump kpool DiffConst CoInit Co n nInit mwt nMin vol slave_enable \
+  geomname xtree_fg_req xtree_textfg_req x y z
+simobjdump kreac kf kb notes xtree_fg_req xtree_textfg_req x y z
+simobjdump kenz CoComplexInit CoComplex nComplexInit nComplex vol k1 k2 k3 \
+  keepconc usecomplex notes xtree_fg_req xtree_textfg_req link x y z
+simobjdump stim level1 width1 delay1 level2 width2 delay2 baselevel trig_time \
+  trig_mode notes xtree_fg_req xtree_textfg_req is_running x y z
+simobjdump xtab input output alloced step_mode stepsize notes editfunc \
+  xtree_fg_req xtree_textfg_req baselevel last_x last_y is_running x y z
+simobjdump kchan perm gmax Vm is_active use_nernst notes xtree_fg_req \
+  xtree_textfg_req x y z
+simobjdump transport input output alloced step_mode stepsize dt delay clock \
+  kf xtree_fg_req xtree_textfg_req x y z
+simobjdump proto x y z
+simundump geometry /kinetics/geometry 0 1.66666666667e-19 3 sphere  "" white black -2 5 0
+simundump kpool /kinetics/Sub 0 0.0 0 0 0 100.369025 0 0 100.369025 0 /kinetics/geometry blue black -6 1 0
+simundump kpool /kinetics/Prd 0 0.0 0 0 0 0.0 0 0 100.369025 0 /kinetics/geometry 60 black 4 0 0
+simundump kreac /kinetics/kreac 0 0.1 0.1 "" 45 black -1 4 0
+simundump xgraph /graphs/conc1 0 0 99 0.001 0.999 0
+simundump xgraph /graphs/conc2 0 0 100 0 1 0
+ simundump xplot /graphs/conc1/Sub.Co 3 524288 \
+"delete_plot.w <s> <d>; edit_plot.D <w>" black 0 0 1
+simundump xplot /graphs/conc1/Prd.Co 3 524288 \
+"delete_plot.w <s> <d>; edit_plot.D <w>" black 0 0 1
+simundump xgraph /moregraphs/conc3 0 0 100 0 1 0
+simundump xgraph /moregraphs/conc4 0 0 100 0 1 0
+ simundump xcoredraw /edit/draw 0 -6 4 -2 6
+simundump xtree /edit/draw/tree 0 \
+  /kinetics/#[],/kinetics/#[]/#[],/kinetics/#[]/#[]/#[][TYPE!=proto],/kinetics/#[]/#[]/#[][TYPE!=linkinfo]/##[] "edit_elm.D <v>; drag_from_edit.w <d> <S> <x> <y> <z>" auto 0.6
+simundump xtext /file/notes 0 1
+addmsg /kinetics/Sub /kinetics/kreac SUBSTRATE n 
+addmsg /kinetics/kreac /kinetics/Sub REAC A B 
+addmsg /kinetics/Prd /kinetics/kreac PRODUCT n 
+addmsg /kinetics/kreac /kinetics/Prd REAC B A
+addmsg /kinetics/Sub /graphs/conc1/Sub.Co PLOT Co *Sub *blue
+addmsg /kinetics/Prd /graphs/conc1/Prd.Co PLOT Co *Prd *60
+
+enddump
+ // End of dump
+complete_loading
diff --git a/moose-examples/snippets/threading_demo.dat b/moose-examples/snippets/threading_demo.dat
index 1586270b063a4c62fe8c60c49c04045a6d30d226..7a9a56b925c3353a0ca79d1312e5ea18f85005ea 100644
--- a/moose-examples/snippets/threading_demo.dat
+++ b/moose-examples/snippets/threading_demo.dat
@@ -10002,3 +10002,10007 @@
 0
 0
 
+/newplot
+/plotname pulsegen_output
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+10
+10
+10
+10
+10
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+
diff --git a/moose-examples/snippets/transportBranchingNeuron.py b/moose-examples/snippets/transportBranchingNeuron.py
index 2970862cee5472cd8f491e61711cf5b6d0004059..5f5ed9bb0f54eca5bf8335c6a34d243f0563663d 100644
--- a/moose-examples/snippets/transportBranchingNeuron.py
+++ b/moose-examples/snippets/transportBranchingNeuron.py
@@ -106,7 +106,7 @@ def makeDisplay():
         pos = compt.voxelMidpoint
         i = len( pos ) / 3
         r2 = numpy.sqrt( 0.5 )
-        yp = [ -r2 * pos[j] * 1e6 for j in range( i ) ]
+        yp = [ -r2 * pos[j] * 1e6 for j in range( int(i) ) ]
         xp = pos[i:2*i] * 1e6 - yp
         aline, = aConc.plot( xp, yp, 'b.' )
 
@@ -214,4 +214,4 @@ def main():
 
 # Run the 'main' if this script is executed standalone.
 if __name__ == '__main__':
-        main()
+        main()
\ No newline at end of file
diff --git a/moose-gui/.travis.yml b/moose-gui/.travis.yml
index 111481f042d54ad55facf5abd4408d6496911f62..5e29a4846ea26d48637ce99e46e52b124fc4abb7 100644
--- a/moose-gui/.travis.yml
+++ b/moose-gui/.travis.yml
@@ -7,14 +7,12 @@ notifications:
 
 
 install:
-    - sudo apt-get clean
-    - sudo apt-get update
     - wget http://download.opensuse.org/repositories/home:moose/xUbuntu_12.04/Release.key
     - sudo apt-key add - < Release.key  
     - sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/moose/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/moose.list"
     - sudo apt-get -y update
-    - sudo apt-get -y --force-yes install python3
-    - sudo apt-get  -y --force-yes install moose
+    - sudo apt-get install python3
+    - sudo apt-get -y install moose
 
 script:
     - # Making sure no python incompatible file is added.
diff --git a/moose-gui/PlotWidgetContainer.py b/moose-gui/PlotWidgetContainer.py
index a9656203e3749a0f00b2917bb5555e4a46b5569f..f42e0a87e27ba9fe891b53344957d2f43a29b402 100644
--- a/moose-gui/PlotWidgetContainer.py
+++ b/moose-gui/PlotWidgetContainer.py
@@ -9,10 +9,10 @@ __author__      =   "Aviral Goel"
 __credits__     =   ["Upi Lab"]
 __license__     =   "GPL3"
 __version__     =   "1.0.0"
-__maintainer__  =   "Aviral Goel,HarshaRani"
+__maintainer__  =   "Aviral Goel"
 __email__       =   "goel.aviral@gmail.com"
 __status__      =   "Development"
-__updated__     =   "Feb 14 2017"
+
 
 import sys
 import os
@@ -49,8 +49,6 @@ class PlotWidgetContainer(QWidget):
 
         self.model          = moose.element(self.modelRoot)
         if self.modelRoot != "/":
-            self.modelRoot = self.findModelPath(self.modelRoot)
-
             if moose.exists(modelRoot + "/data"):
                 self.data   = moose.element(self.modelRoot + "/data")
             else:
@@ -89,18 +87,6 @@ class PlotWidgetContainer(QWidget):
         if len(self.data.children) == 0:
             self.addPlotWidget()
 
-    def mooseIsInstance(self,element, classNames):
-        return moose.element(element).__class__.__name__ in classNames
-
-
-    def findModelPath(self,element):
-        child = element
-        while not self.mooseIsInstance(element, "Shell"):
-            child = moose.element(element).path
-            element = moose.element(element).parent
-
-        return child
-    
     def deleteWidget(self, graphWidget):
         # print("Deleted => ", graphWidget)
         self.graphWidgets.remove(graphWidget)
diff --git a/moose-gui/defaults.py b/moose-gui/defaults.py
index 4ab8008f506ef5033149a22fb4db90dd0c7a1e5a..6551d2d9eb2cc5ba6d79bf396de8b1d5c81bebfc 100644
--- a/moose-gui/defaults.py
+++ b/moose-gui/defaults.py
@@ -12,9 +12,6 @@ FIELD_UNITS={
     'volume':'m3',
     'Km':'mM',
     'kcat':'s-1',
-    'k1' :'1/# s',
-    'k2' :'s-1',
-    'k3' :'s-1',
     'Vm':'V',
     'conc':'mM',
     'concInit':'mM',
diff --git a/moose-gui/mgui.py b/moose-gui/mgui.py
index 0226db504bd7c22af2e1b2ca87098d43bec745df..ede1ba954889a588d8ef37f41645daa6d0f0ec13 100644
--- a/moose-gui/mgui.py
+++ b/moose-gui/mgui.py
@@ -6,9 +6,9 @@
 # Maintainer:
 # Created: Mon Nov 12 09:38:09 2012 (+0530)
 # Version:
-# Last-Updated: Sat Mar 7 13:47:33 2017 (+0530)
+# Last-Updated: Fri Oct 30 11:54:33 2015 (+0530)
 #           By: Harsha
-#     Update #: 
+#     Update #: 1338
 # URL:
 # Keywords:
 # Compatibility:
@@ -206,7 +206,7 @@ class MWindow(QtGui.QMainWindow):
                                       ("Fig5A (20s)",       "../moose-examples/paper-2015/Fig5_CellMultiscale/Fig5A.py"),
                                       ("Fig5BCD (240s)" ,   "../moose-examples/paper-2015/Fig5_CellMultiscale/Fig5BCD.py"),
                                       ("Fig6A (60s)",       "../moose-examples/paper-2015/Fig6_NetMultiscale/Fig6A.py" ),
-                                      ("ReducedModel (200s)",   "../moose-examples/paper-2015/Fig6_NetMultiscale/ReducedModel.py"),
+                                      ("Reduced6 (200s)",   "../moose-examples/paper-2015/Fig6_NetMultiscale/ReducedModel.py"),
                                       ("Squid" ,            "../moose-examples/squid/squid_demo.py")
                                      ])
         layout.setContentsMargins(QtCore.QMargins(20,20,20,20))
@@ -246,7 +246,7 @@ class MWindow(QtGui.QMainWindow):
                 button.setToolTip("<span style=\"color:black;\">Illustrates building a panel of multiscale models to test neuronal plasticity in different contexts</span>")
             elif k[0] == "Fig6A (60s)":
                 button.setToolTip("<span style=\"color:black;\">This LIF network with Ca plasticity is based on: Memory Maintenance in Synapses with Calcium-Based Plasticity in the Presence of Background Activity PLOS Computational Biology, 2014</span>")
-            elif k[0] == "ReducedModel (200s)":
+            elif k[0] == "Reduced6 (200s)":
                 button.setToolTip("<span style=\"color:black;\">This is the Reduced version of LIF network with Ca plasticity model based on: Memory Maintenance in Synapses with Calcium-Based Plasticity in the Presence of Background Activity PLOS Computational Biology, 2014</span>")
             elif k[0] == "Squid":
                 button.setToolTip("<span style=\"color:black;\">squid Demo</span>")
@@ -258,7 +258,7 @@ class MWindow(QtGui.QMainWindow):
                 layout4.addWidget(button)
             elif k[0] in ["Fig5A (20s)","Fig5BCD (240s)"]:
                 layout5.addWidget(button)
-            elif k[0] in ["Fig6A (60s)","ReducedModel (200s)"]:
+            elif k[0] in ["Fig6A (60s)","Reduced6 (200s)"]:
                 layout6.addWidget(button)
             elif k[0] in ["Squid"]:
                 layout7.addWidget(button)
@@ -476,12 +476,11 @@ class MWindow(QtGui.QMainWindow):
         if name == 'kkit':
             self.objectEditDockWidget.objectNameChanged.connect(self.plugin.getEditorView().getCentralWidget().updateItemSlot)
             self.objectEditDockWidget.colorChanged.connect(self.plugin.getEditorView().getCentralWidget().updateColorSlot)
-            #self.plugin.objectSolverChanged.connect(self.plugin.mainWindow.objectEditClearSlot)
 
         self.setCurrentView('editor')
         freeCursor()
         return self.plugin
-    
+
     def updateExistingMenu(self, menu):
         """Check if a menu with same title
         already exists. If so, update the same and return
@@ -565,7 +564,7 @@ class MWindow(QtGui.QMainWindow):
                 break
         if newSubWindow:
             subwin = self.mdiArea.addSubWindow(widget)
-            title = widget.modelRoot
+            title = widget.modelRoot+'/model'
             #subwin.setWindowTitle('%s: %s' % (view, widget.modelRoot))
             subwin.setWindowTitle('%s: %s' % (view, title))
             subwin.setSizePolicy(QtGui.QSizePolicy.Minimum |
@@ -642,67 +641,24 @@ class MWindow(QtGui.QMainWindow):
                                         ("Fig5A (20s)",     "../moose-examples/paper-2015/Fig5_CellMultiscale/Fig5A.py"),
                                         ("Fig5BCD (240s)" , "../moose-examples/paper-2015/Fig5_CellMultiscale/Fig5BCD.py"),
                                         ("Fig6A (60s)",     "../moose-examples/paper-2015/Fig6_NetMultiscale/Fig6A.py" ),
-                                        ("ReducedModel (200s)", "../moose-examples/paper-2015/Fig6_NetMultiscale/ReducedModel.py"),
+                                        ("Reduced6 (200s)", "../moose-examples/paper-2015/Fig6_NetMultiscale/ReducedModel.py"),
                                         ("Squid" ,          "../moose-examples/squid/squid_demo.py")
                                      ])
-            
-            self.subMenu = QtGui.QMenu('Demos')
+            self.subMenu = QtGui.QMenu('Paper_2015_Demos')
             for i in range(0,len(self.menuitems)):
                 k = self.menuitems.popitem(0)
-                if k[0] == "Fig2C (6s)":
-                    self.Fig2Caction = QtGui.QAction('Fig2C (6s)', self)
-                    self.Fig2Caction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig2_elecModels/Fig2C.py'))
-                    self.subMenu.addAction(self.Fig2Caction)
-                elif k[0] == "Fig2D (35s)":
-                    self.Fig2Daction = QtGui.QAction('Fig2D (35s)', self)
-                    self.Fig2Daction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig2_elecModels/Fig2D.py'))
-                    self.subMenu.addAction(self.Fig2Daction)
-                elif k[0] == "Fig2E (5s)":
-                    self.Fig2Eaction = QtGui.QAction('Fig2E (5s)', self)
-                    self.Fig2Eaction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig2_elecModels/Fig2E.py'))
-                    self.subMenu.addAction(self.Fig2Eaction)
+                t = "self."+k[0]+"Action"
+                t = QtGui.QAction(k[0],self)
+                self.subMenu.addAction(t)
+                if k[0] == "Fig3C_Gsl (2s)":
+                    t.connect(t,QtCore.SIGNAL('triggered()'),lambda script = k[1]: self.run_genesis_script(script,"gsl"))
                 elif k[0] == "Fig3B_Gssa (2s)":
-                    self.Fig3B_Gssaaction = QtGui.QAction('Fig3B_Gssa (2s)', self)
-                    self.Fig3B_Gssaaction.triggered.connect(lambda :self.run_genesis_script('../moose-examples/paper-2015/Fig3_chemModels/Fig3ABC.g',"gssa"))
-                    self.subMenu.addAction(self.Fig3B_Gssaaction)
-                elif k[0] == "Fig3C_Gsl (2s)":
-                    self.Fig3C_Gslaction = QtGui.QAction('Fig3C_Gsl (2s)', self)
-                    self.Fig3C_Gslaction.triggered.connect(lambda :self.run_genesis_script('../moose-examples/paper-2015/Fig3_chemModels/Fig3ABC.g',"gsl"))
-                    self.subMenu.addAction(self.Fig3C_Gslaction)
-                elif k[0] == "Fig3D (1s)":
-                    self.Fig3Daction = QtGui.QAction('Fig3D (1s)', self)
-                    self.Fig3Daction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig3_chemModels/Fig3D.py'))
-                    self.subMenu.addAction(self.Fig3Daction)
-                elif k[0] == "Fig4B (10s)":
-                    self.Fig4Baction = QtGui.QAction('Fig4B (10s)', self)
-                    self.Fig4Baction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig4_ReacDiff/Fig4B.py'))
-                    self.subMenu.addAction(self.Fig4Baction)
-                elif k[0] == "Fig4K":
-                    self.Fig4Kaction = QtGui.QAction('Fig4K', self)
-                    self.Fig4Kaction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig4_ReacDiff/rxdSpineSize.py'))
-                    self.subMenu.addAction(self.Fig4Kaction)
-                elif k[0] == "Fig5A (20s)":
-                    self.Fig5Aaction = QtGui.QAction('Fig5A (20s)', self)
-                    self.Fig5Aaction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig5_CellMultiscale/Fig5A.py'))
-                    self.subMenu.addAction(self.Fig5Aaction)
-                elif k[0] == "Fig5BCD (240s)":
-                    self.Fig5BCDaction = QtGui.QAction('Fig5BCD (240s)', self)
-                    self.Fig5BCDaction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig5_CellMultiscale/Fig5BCD.py'))
-                    self.subMenu.addAction(self.Fig5BCDaction)
-                elif k[0] == "Fig6A (60s)":
-                    self.Fig6Aaction = QtGui.QAction('Fig6A (60s)', self)
-                    self.Fig6Aaction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig6_NetMultiscale/Fig6A.py'))
-                    self.subMenu.addAction(self.Fig6Aaction)
-                elif k[0] == "ReducedModel (200s)":
-                    self.ReducedModelaction = QtGui.QAction('ReducedModel (200s)', self)
-                    self.ReducedModelaction.triggered.connect(lambda :self.run_python_script('../moose-examples/paper-2015/Fig6_NetMultiscale/ReducedModel.py'))
-                    self.subMenu.addAction(self.ReducedModelaction)
+                    t.connect(t,QtCore.SIGNAL('triggered()'),lambda script = k[1]: self.run_genesis_script(script,"gssa"))
                 else:
-                    self.Squidaction = QtGui.QAction('Squid', self)
-                    self.Squidaction.triggered.connect(lambda :self.run_python_script('../moose-examples/squid/squid_demo.py'))
-                    self.subMenu.addAction(self.Squidaction)
-                
+                    t.connect(t,QtCore.SIGNAL('triggered()'),lambda : self.run_python_script(k[1]))
+                self.subMenu.addAction(t)    
             self.fileMenu.addMenu(self.subMenu)
+
         if not hasattr(self,'loadedModels'):
             self.loadedModelAction = QtGui.QAction('Recently Loaded Models',self)
             self.loadedModelAction.setCheckable(False)
@@ -1069,16 +1025,11 @@ class MWindow(QtGui.QMainWindow):
     '''
     #Harsha: added visible=True so that loadModelDialogSlot and NewModelDialogSlot call this function
     #        to clear out object path
-
     def objectEditSlot(self, mobj, visible=True):
         """Slot for switching the current object in object editor."""
         self.objectEditDockWidget.setObject(mobj)
         self.objectEditDockWidget.setVisible(visible)
 
-    # def objectEditClearSlot(self):
-    #     #clearning the views which is stored
-    #     self.objectEditDockWidget.clearDict()
-
     def loadedModelsAction(self,modelPath,pluginName):
         #Harsha: added under file Menu, Recently Loaded Models
         #All the previously loaded chemical models, solver's and table's ticks are made -1
@@ -1154,27 +1105,20 @@ class MWindow(QtGui.QMainWindow):
             ret = []
             ret,pluginName = self.checkPlugin(dialog)
             if pluginName == 'kkit':
-                if (ret['subtype'] == 'sbml' and ret['foundlib'] == False):
-                    reply = QtGui.QMessageBox.question(self, "python-libsbml is not found.","\n Read SBML is not possible.\n This can be installed using \n \n pip python-libsbml  or \n apt-get install python-libsbml",
-                                               QtGui.QMessageBox.Ok)
-                    if reply == QtGui.QMessageBox.Ok:
-                        QtGui.QApplication.restoreOverrideCursor()
+                compt = moose.wildcardFind(ret['model'].path+'/##[ISA=ChemCompt]')
+                if not len(compt):
+                    reply = QtGui.QMessageBox.question(self, "Model is empty","Model has no compartment, atleast one compartment should exist to display the widget\n Do you want another file",
+                                               QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
+                    if reply == QtGui.QMessageBox.Yes:
+                        dialog = LoaderDialog(self,self.tr('Load model from file'))
+                        if dialog.exec_():
+                            ret,pluginName = self.checkPlugin(dialog)
+                            ret,valid = self.dialog_check(ret)
+                    else:
+                        QtGui.QApplication.restoreOverrideCursor()        
                         return
                 else:
-                    compt = moose.wildcardFind(ret['model'].path+'/##[ISA=ChemCompt]')
-                    if not len(compt):
-                        reply = QtGui.QMessageBox.question(self, "Model is empty","Model has no compartment, atleast one compartment should exist to display the widget\n Do you want another file",
-                                                   QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
-                        if reply == QtGui.QMessageBox.Yes:
-                            dialog = LoaderDialog(self,self.tr('Load model from file'))
-                            if dialog.exec_():
-                                ret,pluginName = self.checkPlugin(dialog)
-                                ret,valid = self.dialog_check(ret)
-                        else:
-                            QtGui.QApplication.restoreOverrideCursor()        
-                            return
-                    else:
-                        valid = True
+                    valid = True
             if valid == True:
                 modelAnno = moose.Annotator(ret['model'].path+'/info')
                 if ret['subtype']:
@@ -1197,7 +1141,6 @@ class MWindow(QtGui.QMainWindow):
             #ret = loadFile(str(fileName), '/model/%s' % (modelName), merge=False)
             #This will clear out object editor's objectpath and make it invisible
             self.objectEditSlot('/',False)
-
             #if subtype is None, in case of cspace then pluginLookup = /cspace/None
             #     which will not call kkit plugin so cleaning to /cspace
             pluginLookup = '%s/%s' % (ret['modeltype'], ret['subtype'])
@@ -1205,8 +1148,7 @@ class MWindow(QtGui.QMainWindow):
                 pluginName = subtype_plugin_map['%s/%s' % (ret['modeltype'], ret['subtype'])]
             except KeyError:
                 pluginName = 'default'
-            if ret['foundlib']:
-                print ('Loaded model %s' %(ret['model'].path))
+            print 'Loaded model', ret['model'].path
             return ret,pluginName
 
     def dialog_check(self,ret):
diff --git a/moose-gui/mload.py b/moose-gui/mload.py
index cf0aeccd0c0cf2d4cfd74c254ba823085b1d5bb1..b91e2888592a75138554a28521cb0f1fea98c218 100644
--- a/moose-gui/mload.py
+++ b/moose-gui/mload.py
@@ -118,8 +118,6 @@ def loadFile(filename, target, solver="gsl", merge=True):
     modelroot: root element of the model, None if could not be located - as is the case with Python scripts
     """
     num = 1
-    libsfound = True
-    model = '/'
     newTarget = target
     while moose.exists(newTarget):
         newTarget = target + "-" + str(num)
@@ -186,21 +184,13 @@ def loadFile(filename, target, solver="gsl", merge=True):
 
             # moose.move("cells/", cell.path)
         elif subtype == 'sbml':
-            foundLibSBML_ = False
-            try:
-                import libsbml
-                foundLibSBML_ = True
-            except ImportError:
-                pass
-            if foundLibSBML_:
-                if target != '/':
-                    if moose.exists(target):
-                        moose.delete(target)
-                model = mooseReadSBML(filename,target)
-                if moose.exists(moose.element(model).path):
-                    moose.Annotator(moose.element(model).path+'/info').modeltype = "sbml"
-                addSolver(target,'gsl')
-            libsfound = foundLibSBML_
+            if target != '/':
+                if moose.exists(target):
+                    moose.delete(target)
+            model = mooseReadSBML(filename,target)
+            if moose.exists(moose.element(model).path):
+                moose.Annotator(moose.element(model).path+'/info').modeltype = "sbml"
+            addSolver(target,'gsl')
     else:
         raise FileLoadError('Do not know how to handle this filetype: %s' % (filename))
     moose.setCwe(pwe) # The MOOSE loadModel changes the current working element to newly loaded model. We revert that behaviour
@@ -210,8 +200,7 @@ def loadFile(filename, target, solver="gsl", merge=True):
     # app.restoreOverrideCursor()
     return {'modeltype': modeltype,
             'subtype': subtype,
-            'model': model,
-            'foundlib' :libsfound}
+            'model': model}
 
 
 
diff --git a/moose-gui/objectedit.py b/moose-gui/objectedit.py
index 8e59eb07f38b32a111a32f1718358b1cede38c6e..2545a1e2a562c60ab88cc3cb2a3197ab933d2594 100644
--- a/moose-gui/objectedit.py
+++ b/moose-gui/objectedit.py
@@ -6,7 +6,7 @@
 # Maintainer:
 # Created: Wed Jun 30 11:18:34 2010 (+0530)
 # Version:
-# Last-Updated: Tue Mar 7 12:45:59 2017 (+0530)
+# Last-Updated: Wed Aug 3 15:55:59 2016 (+0530)
 #           By: Harsha
 #     Update #: 
 # URL:
@@ -188,7 +188,7 @@ class ObjectEditModel(QtCore.QAbstractTableModel):
     def setData(self, index, value, role=QtCore.Qt.EditRole):
         if not index.isValid() or index.row () >= len(self.fields) or index.column() != 1:
             return False
-        
+        print(value)
         field = self.fields[index.row()]
         if (role == QtCore.Qt.CheckStateRole):
             if (index.column() == 1):
@@ -231,18 +231,8 @@ class ObjectEditModel(QtCore.QAbstractTableModel):
             
             else:
                 oldValue = self.mooseObject.getField(field)
-                if field != "isBuffered":
-                    value = type(oldValue)(value)
-                    self.mooseObject.setField(field, value)
-                else:
-                    if self.mooseObject.className == "ZombiePool" or self.mooseObject.className =="ZombieBufPool":
-                        QtGui.QMessageBox.warning(None,'Solver is set, Could not set the value','\n Unset the solver by clicking \n run widget -> Preferences -> Exponential Euler->Apply')
-                    else:
-                        if value.lower() in ("yes", "true", "t", "1"):
-                            self.mooseObject.setField(field, True)
-                        else:
-                            self.mooseObject.setField(field, False)
-
+                value = type(oldValue)(value)
+                tt = self.mooseObject.setField(field, value)
                 self.undoStack.append((index, oldValue))
             if field == 'name':
                 self.emit(QtCore.SIGNAL('objectNameChanged(PyQt_PyObject)'), self.mooseObject)
@@ -252,7 +242,7 @@ class ObjectEditModel(QtCore.QAbstractTableModel):
         return True
 
     def undo(self):
-        print ('Undo')
+        print 'Undo'
         if len(self.undoStack) == 0:
             raise Info('No more undo information')
         index, oldvalue, = self.undoStack.pop()
@@ -411,7 +401,7 @@ class ObjectEditView(QtGui.QTableView):
             self.setColor(getColor(self.model().mooseObject.path+'/info')[1])
         except:
             pass
-        print ('Created view with %s' %(mobject))
+        print 'Created view with', mobject
 
     def setColor(self, color):
         self.colorButton.setStyleSheet(
@@ -456,8 +446,6 @@ class ObjectEditDockWidget(QtGui.QDockWidget):
         # self.view.colorDialog.colorSelected.connect(self.colorChangedEmit)
 
 
-    # def clearDict(self):
-    #     self.view_dict.clear()
 
     def setObject(self, mobj):
         element = moose.element(mobj)
diff --git a/moose-gui/plugins/kkit.py b/moose-gui/plugins/kkit.py
index 83cd224f99820ffd1be4055648973d0f2be233a5..5b79ea6fa2514f7fa9968b412d210f904cfdf03f 100644
--- a/moose-gui/plugins/kkit.py
+++ b/moose-gui/plugins/kkit.py
@@ -1,13 +1,3 @@
-
-__author__      =   "HarshaRani"
-__credits__     =   ["Upi Lab"]
-__license__     =   "GPL3"
-__version__     =   "1.0.0"
-__maintainer__  =   "HarshaRani"
-__email__       =   "hrani@ncbs.res.in"
-__status__      =   "Development"
-__updated__     =   "Mar 7 2017"
-
 import sys
 from PyQt4 import QtGui, QtCore, Qt
 from default import *
@@ -33,7 +23,6 @@ from setsolver import *
 
 class KkitPlugin(MoosePlugin):
     """Default plugin for MOOSE GUI"""
-    #objectSolverChanged = pyqtSignal()
     def __init__(self, *args):
         #print args
         MoosePlugin.__init__(self, *args)
@@ -89,7 +78,7 @@ class KkitPlugin(MoosePlugin):
                 writeerror,consistencyMessages,writtentofile = moose.SBML.mooseWriteSBML(self.modelRoot,str(filename),self.coOrdinates)
                 if writeerror == -2:
                     #QtGui.QMessageBox.warning(None,'Could not save the Model','\n WriteSBML :  This copy of MOOSE has not been compiled with SBML writing support.')
-                    QtGui.QMessageBox.warning(None,'python-libsbml is not found',consistencyMessages)
+                    QtGui.QMessageBox.warning(None,'Could not save the Model',consistencyMessages)
                 elif writeerror == -1:
                     QtGui.QMessageBox.warning(None,'Could not save the Model','\n This model is not valid SBML Model, failed in the consistency check')
                 elif writeerror == 1:
@@ -251,7 +240,6 @@ class AnotherKkitRunView(RunView):
             reinit = addSolver(modelRoot,solver)
             if reinit:
                 self.getSchedulingDockWidget().widget().resetSimulation()
-                #self.plugin.objectSolverChanged.emit()
 
             #self.kkitRunView.getCentralWidget().addSolver(solver)
 
@@ -554,15 +542,12 @@ class  KineticsWidget(EditorWidgetBase):
 
             for funcObj in find_index(memb,'function'):
                 funcinfo = moose.element(funcObj).path+'/info'
-                poolt = ["ZombieBufPool","BufPool","ZombiePool","Pool"]
-                if funcObj.parent.className in poolt:
+                if funcObj.parent.className == "ZombieBufPool" or funcObj.parent.className == "BufPool":
                     funcinfo = moose.element(funcObj).path+'/info'
                     Af = Annotator(funcinfo)
                     funcParent =self.mooseId_GObj[element(funcObj.parent)]
-
                 elif funcObj.parent.className == "CubeMesh" or funcObj.parent.className == "CylMesh":
                     funcParent = self.qGraCompt[cmpt]
-
                 funcItem = FuncItem(funcObj,funcParent)
                 self.mooseId_GObj[element(funcObj.getId())] = funcItem
                 self.setupDisplay(funcinfo,funcItem,"Function")
@@ -602,14 +587,12 @@ class  KineticsWidget(EditorWidgetBase):
             if bgcolor.name() == "#ffffff" or bgcolor == "white":
                 bgcolor = getRandColor()
                 Annoinfo.color = str(bgcolor.name())
-
         if isinstance(self,kineticEditorWidget):
             funct = ["Function","ZombieFunction"]
             comptt = ["CubeMesh","CylMesh"]
 
             if objClass in funct:
-                poolt = ["ZombieBufPool","BufPool","ZombiePool","Pool"]
-
+                poolt = ["ZombieBufPool","BufPool"]
                 if graphicalObj.mobj.parent.className in poolt:
                     xpos = 0
                     ypos = 30
@@ -617,7 +600,7 @@ class  KineticsWidget(EditorWidgetBase):
                     xpos,ypos = self.positioninfo(info)
             else:
                 xpos,ypos = self.positioninfo(info)
-            
+
             self.xylist = [xpos,ypos]
             self.xyCord[moose.element(info).parent] = [xpos,ypos]
 
@@ -626,7 +609,6 @@ class  KineticsWidget(EditorWidgetBase):
             editorItem = self.editormooseId_GObj[moose.element(info).parent]
             xpos = editorItem.scenePos().x()
             ypos = editorItem.scenePos().y()
-
             #Annoinfo.x = xpos
             #Annoinfo.y = -ypos 
         graphicalObj.setDisplayProperties(xpos,ypos,textcolor,bgcolor)
@@ -670,13 +652,13 @@ class  KineticsWidget(EditorWidgetBase):
             if isinstance(out,tuple):
                 src = self.mooseId_GObj[inn]
                 if len(out[0])== 0:
-                    print (inn.className + ' : ' +inn.name+ " doesn't output message")
+                    print inn.className + ' : ' +inn.name+ " doesn't output message"
                 else:
                     for items in (items for items in out[0] ):
                         des = self.mooseId_GObj[element(items[0])]
                         self.lineCord(src,des,items,itemignoreZooming)
                 if len(out[1]) == 0:
-                    print (inn.className + ' : ' +inn.name+ " doesn't output message")
+                    print inn.className + ' : ' +inn.name+ " doesn't output message"
                 else:
                     for items in (items for items in out[1] ):
                         des = self.mooseId_GObj[element(items[0])]
@@ -684,9 +666,9 @@ class  KineticsWidget(EditorWidgetBase):
             elif isinstance(out,list):
                 if len(out) == 0:
                     if inn.className == "StimulusTable":
-                        print( inn.name +" doesn't have output")
+                        print inn.name +" doesn't have output"
                     elif inn.className == "ZombieFunction" or inn.className == "Function":
-                        print (inn.name + " doesn't have sumtotal ")
+                        print inn.name + " doesn't have sumtotal "
                 else:
                     src = self.mooseId_GObj[inn]
                     for items in (items for items in out ):
@@ -697,7 +679,7 @@ class  KineticsWidget(EditorWidgetBase):
         endtype = type_no[1]
         line = 0
         if (src == "") and (des == ""):
-            print ("Source or destination is missing or incorrect")
+            print "Source or destination is missing or incorrect"
             return
         srcdes_list = [src,des,endtype,line]
         arrow = calcArrow(srcdes_list,itemignoreZooming,self.iconScale)
@@ -710,7 +692,7 @@ class  KineticsWidget(EditorWidgetBase):
             line = line +1
 
         if type_no[2] > 5:
-            print ("Higher order reaction will not be displayed")
+            print "Higher order reaction will not be displayed"
 
     def drawLine(self,srcdes_list,arrow):
         src = srcdes_list[0]
@@ -1045,7 +1027,7 @@ if __name__ == "__main__":
     try:
         filepath = '../../Demos/Genesis_files/'+modelPath+'.g'
         filepath = '/home/harsha/genesis_files/gfile/'+modelPath+'.g'
-        print( "%s" %(filepath))
+        print filepath
         f = open(filepath, "r")
         loadModel(filepath,'/'+modelPath)
 
@@ -1061,6 +1043,6 @@ if __name__ == "__main__":
 
     except  IOError, what:
       (errno, strerror) = what
-      print ("Error number",errno,"(%s)" %(strerror))
+      print "Error number",errno,"(%s)" %strerror
       sys.exit(0)
     sys.exit(app.exec_())
diff --git a/moose-gui/plugins/kkitCalcArrow.py b/moose-gui/plugins/kkitCalcArrow.py
index 3b46a2c80502383b12429f3185eb1aef0d053212..e11ebe3ff29d3110751239f00782dd1f260143ed 100644
--- a/moose-gui/plugins/kkitCalcArrow.py
+++ b/moose-gui/plugins/kkitCalcArrow.py
@@ -1,6 +1,6 @@
 from PyQt4.QtGui import QPolygonF
 from PyQt4.QtCore import QLineF,QPointF
-from math import sin,cos,atan2,radians
+import math
 from kkitQGraphics import PoolItem #, ReacItem,EnzItem,CplxItem,ComptItem
 
 ''' One to need to pass the source, destination,endtype and order for drawing the arrow between 2 object \
@@ -46,9 +46,9 @@ def calcArrow(srcdes_list,itemignoreZooming,iconScale):
         dy = desRect.center().y()- srcRect.center().y()
         dx0 = dy
         dy0 = -dx
-        tetha1 = (atan2(dy0,dx0))
-        a0 = 4 *(cos(tetha1))
-        b0 = 4 *(sin(tetha1))
+        tetha1 = (math.atan2(dy0,dx0))
+        a0 = 4 *(math.cos(tetha1))
+        b0 = 4 *(math.sin(tetha1))
         ''' Higher order ( > 4) connectivity will not be done'''
         if ((order == 3) or (order == 4)):
             a0 = a0*2
@@ -154,9 +154,9 @@ def calcLineRectIntersection(rect, centerLine):
 def arrowHead(srcAngle,degree,lineSpoint,iconScale):
     '''  arrow head is calculated '''
     r = 8*iconScale
-    delta = radians(srcAngle) + radians(degree)
-    width = sin(delta)*r
-    height = cos(delta)*r
+    delta = math.radians(srcAngle) + math.radians(degree)
+    width = math.sin(delta)*r
+    height = math.cos(delta)*r
     srcXArr = (lineSpoint.x() + width)
     srcYArr = (lineSpoint.y() + height)
     return srcXArr,srcYArr
diff --git a/moose-gui/plugins/kkitOrdinateUtil.py b/moose-gui/plugins/kkitOrdinateUtil.py
index dcfeb8ac9df78d8f39096ea9c97d800194ea4f99..03484f19ca5e61d3e56921e89e99ab8edd06c037 100644
--- a/moose-gui/plugins/kkitOrdinateUtil.py
+++ b/moose-gui/plugins/kkitOrdinateUtil.py
@@ -1,18 +1,8 @@
-__author__      =   "HarshaRani"
-__credits__     =   ["Upi Lab"]
-__license__     =   "GPL3"
-__version__     =   "1.0.0"
-__maintainer__  =   "HarshaRani"
-__email__       =   "hrani@ncbs.res.in"
-__status__      =   "Development"
-__updated__     =   "Feb 14 2017"
-
 from moose import *
 import numpy as np
-from collections import Counter
 import networkx as nx
-from networkx.drawing.nx_agraph import graphviz_layout
-#import pygraphviz as pgv
+from collections import Counter
+
 def xyPosition(objInfo,xory):
     try:
         return(float(element(objInfo).getField(xory)))
@@ -191,8 +181,6 @@ def autoCoordinates(meshEntry,srcdesConnection):
     ymin = 0.0
     ymax = 1.0
     G = nx.Graph()
-    #G = pgv.AGraph()
-    positionInfo = {}
     for cmpt,memb in meshEntry.items():
         for enzObj in find_index(memb,'enzyme'):
             #G.add_node(enzObj.path)
@@ -230,10 +218,19 @@ def autoCoordinates(meshEntry,srcdesConnection):
             else:
                 for items in (items for items in out ):
                     G.add_edge(element(items[0]).path,inn.path)
+    position = nx.spring_layout(G)
+    #nx.draw(G,pos=nx.spring_layout(G))
+    #position = nx.spring_layout(G)
+    #import matplotlib.pyplot as plt
+    #plt.savefig('/home/harsha/Trash/Trash_SBML/test.png')
+    position = nx.graphviz_layout(G, prog = 'dot')
+    if int( nx.__version__.split( '.' )[-1] ) >= 11:
+        position = nx.spring_layout( G )
+    #agraph = nx.to_agraph(G)
+    #agraph.draw("test.png", format = 'png', prog = 'dot')
     xcord = []
     ycord = []
     
-    position = graphviz_layout(G)
     for item in position.items():
         xy = item[1]
         ann = moose.Annotator(item[0]+'/info')
@@ -242,34 +239,6 @@ def autoCoordinates(meshEntry,srcdesConnection):
         ann.y = xy[1]
         ycord.append(xy[1])
     
-    '''
-    if int( nx.__version__.split( '.' )[-1] ) >= 11:
-     	position = nx.spring_layout( G )
-    else:
-     	position = nx.graphviz_layout(G, prog = 'dot')
-    for item in position.items():
-        xy = item[1]
-        ann = moose.Annotator(item[0]+'/info')
-        ann.x = xy[0]
-        xcord.append(xy[0])
-        ann.y = xy[1]
-        ycord.append(xy[1])
-    '''
-    '''
-    #pygraphviz
-    G.layout()
-    for n in G.nodes():
-        print "inside 250 "
-        value = str(n.attr['pos'])
-        valuelist = (value.split(','))
-        positionInfo[(moose.element(n)).path] ={'x':float(valuelist[0]),'y':float(valuelist[1])}
-        ann = moose.Annotator(moose.element(n).path+'/info')
-        ann.x = float(valuelist[0])
-        ann.y = float(valuelist[1])
-        
-        xcord.append(float(valuelist[0]))
-        xcord.append(float(valuelist[1]))
-    '''
     if xcord and ycord:
         xmin = min(xcord)
         xmax = max(xcord)
diff --git a/moose-gui/plugins/kkitQGraphics.py b/moose-gui/plugins/kkitQGraphics.py
index 1a804b0d530b324539aa76f29f512cc6a9afedfc..27ddbe3555d0bff5f9672ba9db5dd2b15b3dc7c6 100644
--- a/moose-gui/plugins/kkitQGraphics.py
+++ b/moose-gui/plugins/kkitQGraphics.py
@@ -1,13 +1,3 @@
-
-__author__      =   "HarshaRani"
-__credits__     =   ["Upi Lab"]
-__license__     =   "GPL3"
-__version__     =   "1.0.0"
-__maintainer__  =   "HarshaRani"
-__email__       =   "hrani@ncbs.res.in"
-__status__      =   "Development"
-__updated__     =   "Mar 7 2017"
-
 #import sys
 #sys.path.insert(0, '/home/harsha/trunk/gui')
 import config
@@ -15,7 +5,6 @@ from PyQt4 import QtGui, QtCore, Qt
 from moose import *
 from PyQt4.QtGui import QPixmap, QImage, QGraphicsPixmapItem
 from constants import *
-from os import path
 
 class KineticsDisplayItem(QtGui.QGraphicsWidget):
     """Base class for display elemenets in kinetics layout"""
@@ -72,9 +61,7 @@ class FuncItem(KineticsDisplayItem):
     def __init__(self, mobj, parent):
         super(FuncItem, self).__init__(mobj, parent)
         self.setFlag(QtGui.QGraphicsItem.ItemIsMovable, True)
-        #self.funcImage = QImage('icons/classIcon/Function.png').scaled(15,33)
-        iconmap_file = (path.join(config.settings[config.KEY_ICON_DIR], 'classIcon/Function.png'))
-        self.funcImage = QImage(iconmap_file).scaled(15,33)
+        self.funcImage = QImage('icons/classIcon/Function.png').scaled(15,33)
         self.bg = QtGui.QGraphicsRectItem(self)
         self.bg.setAcceptHoverEvents(True)
         self.gobj = QtGui.QGraphicsPixmapItem(QtGui.QPixmap.fromImage(self.funcImage),self.bg)
@@ -88,12 +75,11 @@ class FuncItem(KineticsDisplayItem):
         
     def setDisplayProperties(self,x,y,textcolor,bgcolor):
         """Set the display properties of this item."""
-        #With Respect to BufPool (as parent which is in old genesis) then function are placed at 0,30 (which is below the BufPool)
+        #With Respect to BuffPool (as parent which is in old genesis) then function are placed at 0,30 (which is below the BuffPool)
         #else if droped from the GUI then placed wrt position
         #self.setGeometry(0, 30,self.gobj.boundingRect().width(),self.gobj.boundingRect().height())
         #self.setGeometry(x,y)
-        poolt = ["ZombieBufPool","BufPool","ZombiePool","Pool"]
-        if self.gobj.mobj.parent.className in poolt:
+        if self.gobj.mobj.parent.className == "ZombieBufPool" or self.gobj.mobj.parent.className == "BufPool":
             self.setGeometry(0, 30,self.gobj.boundingRect().width(),self.gobj.boundingRect().height())
         else:
             self.setGeometry(x,y,self.gobj.boundingRect().width(),self.gobj.boundingRect().height())
@@ -198,9 +184,6 @@ class PoolItem(KineticsDisplayItem):
         #This func will adjust the background color with respect to text size
         self.gobj.setText(self.mobj.name)
         self.bg.setRect(0, 0, self.gobj.boundingRect().width()+PoolItem.fontMetrics.width('  '), self.gobj.boundingRect().height())
-        self.setGeometry(self.pos().x(),self.pos().y(),self.gobj.boundingRect().width()
-                        +PoolItem.fontMetrics.width(''), 
-                        self.gobj.boundingRect().height())
     
     def updateColor(self,bgcolor):
         self.bg.setBrush(QtGui.QBrush(QtGui.QColor(bgcolor)))
@@ -496,9 +479,7 @@ class ComptItem(QtGui.QGraphicsRectItem):
 
         self.setFlag(QtGui.QGraphicsItem.ItemIsMovable, True);
         self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable)
-        #self.setFlag(QtGui.QGraphicsItem.ItemSendsGeometryChanges, 1)
-        QT_VERSION = str(QtCore.QT_VERSION_STR).split('.')
-        QT_MINOR_VERSION = int(QT_VERSION[1])
+        #self.setFlag(QtGui.QGraphicsItem.ItemSendsGeometryChanges, 1) 
         if config.QT_MINOR_VERSION >= 6:
             self.setFlag(QtGui.QGraphicsItem.ItemSendsGeometryChanges, 1) 
     '''
diff --git a/moose-gui/plugins/modelBuild.py b/moose-gui/plugins/modelBuild.py
index 27e57a12579c04699b810d5887c5bbe8ed0cd8c6..471d8e9eaf63953343cb3a7e968e5e2135e27860 100644
--- a/moose-gui/plugins/modelBuild.py
+++ b/moose-gui/plugins/modelBuild.py
@@ -25,16 +25,16 @@ def checkCreate(scene,view,modelpath,mobj,string,ret_string,num,event_pos,layout
     #     modelRoot = modelpath[0:modelpath.find('/',1)]
     # else:
     #     modelRoot = modelpath
-    #print "28 ",modelpath
+    print "28 ",modelpath
     if moose.exists(modelpath+'/info'):
         mType = moose.Annotator((moose.element(modelpath+'/info'))).modeltype
-    #print " 1 event_pos ",event_pos
+    print " 1 event_pos ",event_pos
     itemAtView = view.sceneContainerPt.itemAt(view.mapToScene(event_pos))
-    #print "2 ",itemAtView
+    print "2 ",itemAtView
     pos = view.mapToScene(event_pos)
-    #print " 3 ",pos
+    print " 3 ",pos
     modelpath = moose.element(modelpath)
-    #print " model path @34 ",modelpath
+    print " model path @34 ",modelpath
     if num:
         string_num = ret_string+str(num)
     else:
@@ -297,4 +297,4 @@ def findCompartment(mooseObj):
     elif isinstance(mooseObj,ChemCompt):
         return (mooseObj)
     else:
-        return findCompartment(moose.element(mooseObj.parent))
+        return findCompartment(moose.element(mooseObj.parent))
\ No newline at end of file