diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3c60729736a556a4fb70d1399b814b63a23edffc..3665844e4a6e846644fb4fca4ec0b6a7ad6212c6 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,3 +4,11 @@ The [developer documentation](http://www.mantidproject.org/Category:Development)
  2. Make changes as you see fit. Please still follow the guidelines for [running the unit tests](http://www.mantidproject.org/Running_the_unit_tests) and the [build servers](http://www.mantidproject.org/The_automated_build_process).
  3. Before submitting pull requests email mantid-help@mantidproject.org, and a developer will set up a branch that you can submit pull requests to.
  4. Submit a [pull request](https://help.github.com/articles/using-pull-requests) to this branch.
+
+
+Hints to make the integration of your changes easy:
+- Keep your pull requests small
+- Don't forget your unit tests
+- All algorithms need documentation, don't forget the .rst file
+- Contact us before creating the pull request
+- Don't take changes requests to change your code personally
diff --git a/Code/Mantid/Build/CMake/WindowsNSIS.cmake b/Code/Mantid/Build/CMake/WindowsNSIS.cmake
index 010f511f9335d664cef487a0d95032143449a79d..583a99ef3b3a7a979e087448eb669056607ea167 100644
--- a/Code/Mantid/Build/CMake/WindowsNSIS.cmake
+++ b/Code/Mantid/Build/CMake/WindowsNSIS.cmake
@@ -97,9 +97,6 @@
               REGEX "^.*d4.dll$" EXCLUDE  )
     install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/Installers/WinInstaller/qt.conf DESTINATION bin )
    
-    # Copy assistant.exe
-    install ( FILES ${CMAKE_LIBRARY_PATH}/assistant.exe DESTINATION bin )
-    
     # Release deployments do modify enviromental variables, other deployments do not.
     if(CPACK_PACKAGE_SUFFIX STREQUAL "") 
         # On install
diff --git a/Code/Mantid/Build/Jenkins/buildscript b/Code/Mantid/Build/Jenkins/buildscript
index e0f86540b0644cdf026447e6ae2473d29e7eb895..c07ec708bcfded164b6db943cf5b857f072d0151 100755
--- a/Code/Mantid/Build/Jenkins/buildscript
+++ b/Code/Mantid/Build/Jenkins/buildscript
@@ -35,10 +35,11 @@ if [[ ${JOB_NAME} == *clean* ]]; then
   # Set some variables relating to the linux packages created from clean builds
   if [[ $(uname) != 'Darwin' ]]; then
     if [[ ${JOB_NAME} == *master* ]]; then
-      PACKAGINGVARS="-DENVVARS_ON_INSTALL=False -DCMAKE_INSTALL_PREFIX=/opt/mantidnightly -DCPACK_PACKAGE_SUFFIX=nightly -DCPACK_SET_DESTDIR=OFF"
+      SUFFIX=nightly
     elif [[ ${JOB_NAME} == *develop* ]]; then
-      PACKAGINGVARS="-DENVVARS_ON_INSTALL=False -DCMAKE_INSTALL_PREFIX=/opt/mantidunstable -DCPACK_PACKAGE_SUFFIX=unstable -DCPACK_SET_DESTDIR=OFF"
+      SUFFIX=unstable
     fi
+    PACKAGINGVARS="-DENVVARS_ON_INSTALL=False -DCMAKE_INSTALL_PREFIX=/opt/mantid${SUFFIX} -DCPACK_PACKAGE_SUFFIX=${SUFFIX} -DCPACK_SET_DESTDIR=OFF -DPACKAGE_DOCS=True"
   fi
 fi
 
@@ -79,11 +80,19 @@ $SCL_ON_RHEL6 "ctest -j$BUILD_THREADS --schedule-random --output-on-failure -E M
 $SCL_ON_RHEL6 "ctest --output-on-failure -R MantidPlot"
 
 ###############################################################################
-# Build the documentation - tests first then html
-# Only rhel6 nodes to avoid redundant work
+# Documentation
+# Only run tests on RHEL6 incremental but have to build html on all platforms
+# for a clean build so that it can be packaged
 ###############################################################################
 if [[ "$ON_RHEL6" == true ]]; then
   $SCL_ON_RHEL6 "make docs-test"
+fi
+if [[ "$CLEANBUILD" == true ]]; then
+  # Workaround so that the html target can find the properties file
+  # CMake doesn't easily allow environment variables on custom targets
+  if [[ $(uname) == 'Darwin' ]]; then
+    export MANTIDPATH=$PWD/bin
+  fi
   $SCL_ON_RHEL6 "make docs-html"
 fi
 
diff --git a/Code/Mantid/Build/Jenkins/buildscript.bat b/Code/Mantid/Build/Jenkins/buildscript.bat
index 40f6b1f8462d62c2750daeb767a647198bf2b4a2..4933070ece9acd0fc69b9c9494b97e114548b057 100755
--- a/Code/Mantid/Build/Jenkins/buildscript.bat
+++ b/Code/Mantid/Build/Jenkins/buildscript.bat
@@ -19,11 +19,12 @@ set PATH=%WORKSPACE%\Code\Third_Party\lib\win64;%WORKSPACE%\Code\Third_Party\lib
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 :: Check whether this is a clean build (must have 'clean' in the job name)
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-set DOC_IMAGES=
+set PACKAGE_DOCS=
 if "%JOB_NAME%"=="%JOB_NAME:clean=%" (
     set CLEANBUILD=no
 ) else  (
     set CLEANBUILD=yes
+    set PACKAGE_DOCS=-DPACKAGE_DOCS=True
     rmdir /S /Q build
 )
 
@@ -36,7 +37,7 @@ cd %WORKSPACE%\build
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 :: CMake configuration
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -G "Visual Studio 11 Win64" -DCONSOLE=OFF -DENABLE_CPACK=ON -DMAKE_VATES=ON -DParaView_DIR=%PARAVIEW_DIR% -DUSE_PRECOMPILED_HEADERS=ON ..\Code\Mantid
+"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -G "Visual Studio 11 Win64" -DCONSOLE=OFF -DENABLE_CPACK=ON -DMAKE_VATES=ON -DParaView_DIR=%PARAVIEW_DIR% -DUSE_PRECOMPILED_HEADERS=ON %PACKAGE_DOCS% ..\Code\Mantid
 if ERRORLEVEL 1 exit /B %ERRORLEVEL%
 
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -58,6 +59,10 @@ if ERRORLEVEL 1 exit /B %ERRORLEVEL%
 :: Create the install kit if this is a clean build
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 if "%CLEANBUILD%" EQU "yes" (
-    if ERRORLEVEL 1 exit /B %ERRORLEVEL%
+    :: Build offline documentation
+    msbuild /nologo /nr:false /p:Configuration=Release docs/docs-html.vcxproj
+
+    :: ignore errors as the exit code of the build isn't correct
+    ::if ERRORLEVEL 1 exit /B %ERRORLEVEL%
     cpack -C Release --config CPackConfig.cmake
 )
diff --git a/Code/Mantid/Build/class_maker.py b/Code/Mantid/Build/class_maker.py
index 9fdb3ab9cba5e4197f185daa4f693588fe8b6bb8..10a4f192fa48f98d4d46fcf0171385250548ddfd 100755
--- a/Code/Mantid/Build/class_maker.py
+++ b/Code/Mantid/Build/class_maker.py
@@ -118,6 +118,9 @@ def write_source(subproject, classname, filename, args):
     f = open(filename, 'w')
     
     algorithm_top = """
+  using Mantid::Kernel::Direction;
+  using Mantid::API::WorkspaceProperty;
+
   // Register the algorithm into the AlgorithmFactory
   DECLARE_ALGORITHM(%s)
   
@@ -153,21 +156,14 @@ def write_source(subproject, classname, filename, args):
     // TODO Auto-generated execute stub
   }
 
-""" % (classname, classname, classname, classname, classname, classname, classname)   
+""" % (classname, classname, classname, classname, classname)   
 
     if not args.alg:
         algorithm_top = ""
         algorithm_source = ""
-        s = ""
-    else:
-        s = """/*WIKI*
-TODO: Enter a full wiki-markup description of your algorithm here. You can then use the Build/wiki_maker.py script to generate your full wiki page.
-*WIKI*/
-
-"""
 
     # ------- Now the normal class text ------------------------------    
-    s += """#include "Mantid%s/%s%s.h"
+    s = """#include "Mantid%s/%s%s.h"
 
 namespace Mantid
 {
@@ -252,6 +248,7 @@ def write_test(subproject, classname, filename, args):
 #include "Mantid%s/%s%s.h"
 
 using Mantid::%s::%s;
+using namespace Mantid::API;
 
 class %sTest : public CxxTest::TestSuite
 {
@@ -281,6 +278,64 @@ public:
     
     
     
+       
+
+#======================================================================
+def write_rst(subproject, classname, filename, args):
+    """Write an algorithm rst documentation file"""
+    print "Writing rst file to %s" % filename
+    f = open(filename, 'w')
+    
+    s = """
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+TODO: Enter a full rst-markup description of your algorithm here. 
+
+
+Usage
+-----
+..  Try not to use files in your examples, 
+    but if you cannot avoid it then the (small) files must be added to 
+    autotestdata\UsageData and the following tag unindented
+    .. include:: ../usagedata-note.txt
+
+**Example - %s**
+
+.. testcode:: %sExample
+
+   # Create a host workspace
+   ws = CreateWorkspace(DataX=range(0,3), DataY=(0,2))
+   or
+   ws = CreateSampleWorkspace()
+
+   wsOut = %s()
+
+   # Print the result
+   print "The output workspace has %%i spectra" %% wsOut.getNumberHistograms()
+
+Output:
+
+.. testoutput:: %sExample 
+
+  The output workspace has ?? spectra
+
+.. categories::
+
+""" % (classname,classname,classname,classname)
+
+    f.write(s)
+    f.close()
+
+
 #======================================================================
 def generate(subproject, classname, overwrite, args):
     
@@ -290,6 +345,9 @@ def generate(subproject, classname, overwrite, args):
     headerfile = os.path.join(basedir, "inc", header_folder, args.subfolder + classname + ".h")
     sourcefile = os.path.join(basedir, "src", args.subfolder + classname + ".cpp")
     testfile = os.path.join(basedir, "test", classname + "Test.h")
+    #up two from the subproject basedir and then docs\source\algorithms
+    mantiddir = os.path.dirname(os.path.dirname(basedir))
+    rstfile = os.path.join(mantiddir, "docs", "source", "algorithms", classname + "-v1.rst")
     
     if args.header and not overwrite and os.path.exists(headerfile):
         print "\nError! Header file %s already exists. Use --force to overwrite.\n" % headerfile
@@ -300,6 +358,9 @@ def generate(subproject, classname, overwrite, args):
     if args.test and not overwrite and os.path.exists(testfile):
         print "\nError! Test file %s already exists. Use --force to overwrite.\n" % testfile
         return
+    if args.rst and args.alg and not overwrite and os.path.exists(rstfile):
+        print "\nError! Rst documentation file %s already exists. Use --force to overwrite.\n" % rstfile
+        return
       
     print
     if args.header:
@@ -308,6 +369,8 @@ def generate(subproject, classname, overwrite, args):
         write_source(subproject, classname, sourcefile, args)
     if args.test:
         write_test(subproject, classname, testfile, args)
+    if args.rst and args.alg:
+        write_rst(subproject, classname, rstfile, args)
     
     # Insert into the cmake list
     add_to_cmake(subproject, classname, args, args.subfolder)
@@ -344,6 +407,9 @@ if __name__ == "__main__":
         parser.add_argument('--no-cpp', dest='cpp', action='store_const',
                             const=False, default=True,
                             help="Don't create the cpp file")
+        parser.add_argument('--no-rst', dest='rst', action='store_const',
+                            const=False, default=True,
+                            help="Don't create the rst file")
         parser.add_argument('--alg', dest='alg', action='store_const',
                             const=True, default=False,
                             help='Create an Algorithm stub. This adds some methods common to algorithms.')
@@ -356,10 +422,6 @@ if __name__ == "__main__":
     else:
         parser = optparse.OptionParser("Usage: %prog SUBPROJECT CLASSNAME [options]", None,
                                        optparse.Option, VERSION, 'error', 'Utility to create Mantid class files: header, source and test.')
-        #parser.add_option('--subproject', metavar='SUBPROJECT', type=str,
-        #                    help='The subproject under Framework/; e.g. Kernel')
-        #parser.add_option('--classname', metavar='CLASSNAME', type=str,
-        #                    help='Name of the class to create')
         parser.add_option('--force', dest='force', action='store_const',
                             const=True, default=False,
                             help='Force overwriting existing files. Use with caution!')
@@ -372,6 +434,9 @@ if __name__ == "__main__":
         parser.add_option('--no-cpp', dest='cpp', action='store_const',
                             const=False, default=True,
                             help="Don't create the cpp file")
+        parser.add_option('--no-rst', dest='rst', action='store_const',
+                            const=False, default=True,
+                            help="Don't create the rst file")
         parser.add_option('--alg', dest='alg', action='store_const',
                             const=True, default=False,
                             help='Create an Algorithm stub. This adds some methods common to algorithms.')
diff --git a/Code/Mantid/Build/set_optional_message.py b/Code/Mantid/Build/set_optional_message.py
deleted file mode 100755
index 096273171b3c6d1302cfcf5c645dc42406c5a84d..0000000000000000000000000000000000000000
--- a/Code/Mantid/Build/set_optional_message.py
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/usr/bin/env python
-import os
-import sys
-import glob
-import urllib
-import re
-
-s = 'const std::string name() const { return "'
-
-def get_all_algos():
-    """ Get all the algorithms .cpp files """
-    fileList = []
-    rootdir = "."
-    for root, subFolders, files in os.walk(rootdir):
-        for file in files:
-            (name, ext) = os.path.splitext(file)
-            if ext == ".cpp" and not file.endswith("Test.cpp")  and not file.endswith("_runner.cpp") :
-                fullpath = os.path.join(root,file)
-                #headerfile = os.path.join(root, ".." 
-                
-                source = open(fullpath).read()
-                regex = "DECLARE_ALGORITHM\(([\w]+)\)"
-                res = re.search(regex, source)
-                if not res is None:
-                    # The first match = the algo name
-                    name = res.group(1)
-                    fileList.append( (name, fullpath) )
-    return fileList
-
-#======================================================================================
-def de_wikify(input):
-    """ Remove wiki mark-up """
-    line = input
-    # Match for [[BLA|bla bla]]
-    regex = r"\[\[[\w\ ]+\|([\w\s]+)\]\]"
-    # replace just with the plain text one
-    replace = r"\1"
-    line = re.sub(regex, replace, line)
-    line = line.replace("[[", "")
-    line = line.replace('"', "'")
-    line = line.replace("]]", "")
-    line = line.replace("'''", "'")
-    line = line.replace("''", "'")
-    return line
-
-#======================================================================================
-def escape_for_c(rawstring):
-    """ Replace \ with \\; " with \" to escape the slash for a c-style string"""
-    out = rawstring
-    out = out.replace("\\", "\\\\")
-    out = out.replace('"', '\\"')
-    return out
-
-#======================================================================================
-def get_wiki_summary(name):
-    """ Get the wiki summary from the algorithm name """
-    url = "http://www.mantidproject.org/index.php?title=%s&action=raw&section=1" % name
-    
-    webFile = urllib.urlopen(url)
-    wiki = webFile.read()
-    webFile.close()
-    out = ""
-    wikified = ""
-    for line in wiki.split("\n"):
-        line = line.strip()
-        if (line != "== Summary ==") and (line != "==Summary=="):
-            # Keep all markup in here
-            wikified += line + " "
-            # And strip it out for this one
-            out += de_wikify(line) + " "
-            
-        if line.startswith("{{Binary"):
-            # Template in binary ops. Skip the rest
-            break
-        
-    out = out.strip()
-    return (out, wikified)
-
-
-#======================================================================================
-def get_padding(line):
-    """Return a string with the spaces padding the start of the given line."""
-    out = ""
-    for c in line:
-        if c == " ":
-            out += " "
-        else:
-            break
-    return out
-
-
-#======================================================================================
-def find_line_number(lines, searchfor, startat=0):
-    """Look line-by-line in lines[] for a line that starts with searchfor. Return
-    the line number in source where the line was found, and the padding (in spaces) before it"""
-    count = 0
-    done = False
-    padding = ""
-    for n in xrange(startat, len(lines)):
-        line = lines[n]
-        s = line.strip()
-        if s.startswith(searchfor):
-            # How much padding?
-            padding = get_padding(line)
-            return (n, padding)
-
-    return (None, None)
-
-
-#======================================================================================
-def insert_lines(lines, insert_lineno, extra, padding):
-    """Insert a text, split by lines, inside a list of 'lines', at index 'insert_lineno'
-    Adds 'padding' to each line."""
-    # split
-    extra_lines = extra.split("\n");
-    #Pad 
-    for n in xrange(len(extra_lines)):
-        extra_lines[n] = padding+extra_lines[n]
-    return lines[0:insert_lineno] + extra_lines + lines[insert_lineno:]
-
-
-#======================================================================================
-def save_lines_to(lines, fullpath):
-    """Save a list of strings to one file"""        
-    # Join into one big string
-    source = "\n".join(lines)
-    # Save to disk
-    f = open(fullpath,'w')
-    f.write(source)
-    f.close()
-
-#======================================================================================
-def add_optional_message(name, fullpath, summary, wikified_summary):
-    f = open(fullpath)
-    source = f.read()
-    f.close()
-
-
-#    regex = "setOptionalMessage\("
-#    match1 = re.search(regex, source)
-#    if not match1 is None:
-#        print name, "------> Optional message already set for", name
-        
-    # -------- Look for a spot to stick the new function ----------
-    searchfor = "DECLARE_ALGORITHM"
-    if "DECLARE_LOADALGORITHM" in source: searchfor = "DECLARE_LOADALGORITHM" 
-    lines = source.split("\n")
-    
-    (linenum, padding) = find_line_number(lines,searchfor)
-    # Look for the next empty line
-    if not linenum is None:
-        n = linenum
-        line = "!!!"
-        while line != "":
-            n += 1
-            line = lines[n].strip()
-
-        extra = """
-/// Sets documentation strings for this algorithm
-void %s::initDocs()
-{
-  this->setWikiSummary("%s");
-  this->setOptionalMessage("%s");
-}
-""" % (name, escape_for_c(wikified_summary), escape_for_c(summary))
-        
-        # Add the extra (with padding)
-        lines = insert_lines(lines, n, extra, padding)
-        
-        # Save to disk
-        save_lines_to(lines, fullpath)
-                            
-    else:
-        print name, "------> DECLARE_ALGORITHM not found"
-        
-        
-#    if 0:
-#        # Look for init() and then some padding before { 
-#        regex = "::init\(\)([\ ]+)?\n([.\s]+)?{"
-#        m = re.search(regex, source)
-#        if not m is None:
-#            n = m.end(0)
-#            padding = m.group(2)
-#            if padding is None: padding = ""
-
-
-#======================================================================================
-def find_corresponding_headerpath(cpp_path):
-    """Return the path to the header given the .cpp path"""
-    (root, filename) = os.path.split(cpp_path)
-    (barename, ext) = os.path.splitext(filename)
-    (project_path, src) = os.path.split(root)
-    (ignore, project_name) = os.path.split(project_path)
-    header_path = project_path + "/inc/Mantid%s/%s.h" % (project_name, barename)
-    return header_path
-    
-
-#======================================================================================
-def add_method_to_header(name, cpp_path, method):
-    """ Look for a header file from a cpp path.
-    Add a method declaration to it."""
-    header_path = find_corresponding_headerpath(cpp_path)
-    
-    source = open(header_path).read()
-    lines = source.split("\n");
-    
-    # Find the start of the private section
-    (n, padding) = find_line_number(lines, "private:")
-    if n is None:
-        (n, padding) = find_line_number(lines, "protected:") 
-    if n is None:
-        (n, padding) = find_line_number(lines, "public:")
-         
-    if not n is None:
-        # private is back 2 spaces, so add 2 spaces of padding
-        padding = padding+"  "
-        lines = insert_lines(lines, n+1, method, padding)
-        # Now save to disk
-        save_lines_to(lines, header_path)
-    else:
-        print name, "-------> Could not find where to insert method"
-
-
-#======================================================================================
-def find_algorithm_real_name(cpp_path):
-    """ Look in the header for the real name of the algorithm. """
-    header_path = find_corresponding_headerpath(cpp_path)
-    if not os.path.exists(header_path):
-        return None
-    source = open(header_path).read()
-    regex = r'std::string\ name\(\)\ const\ \{\ return\ \"([\w]+)\"'
-    m = re.search(regex, source)
-    if not m is None:
-        return m.group(1) 
-    else:
-        return None
-
-
-
-#======================================================================================
-if __name__=="__main__":
-    # Find paths to all algorithms
-   
-    algs = get_all_algos()
-    
-    for (name, fullpath) in algs:
-        # Find the real algo name
-        real_name = find_algorithm_real_name(fullpath)
-        if real_name is None: real_name = name
-          
-        # Extract from the wiki
-        (summary, wikified_summary) = get_wiki_summary(real_name)
-        if summary == "":
-            print name, "------> WIKI SUMMARY NOT FOUND at ", real_name
-        else:
-            add_optional_message(name, fullpath, summary, wikified_summary)
-            add_method_to_header(name, fullpath, "/// Sets documentation strings for this algorithm\nvirtual void initDocs();")
-    
-    
\ No newline at end of file
diff --git a/Code/Mantid/Build/wiki_maker.py b/Code/Mantid/Build/wiki_maker.py
deleted file mode 100755
index 8ffc4db3ad40fc2cabacffb59d8c0a23d65c974c..0000000000000000000000000000000000000000
--- a/Code/Mantid/Build/wiki_maker.py
+++ /dev/null
@@ -1,366 +0,0 @@
-#!/usr/bin/env python
-""" Utility to automatically generate and submit algorithm Wiki pages
-to the mantidproject.org"""
-from pdb import set_trace as trace
-import optparse
-import os
-import ConfigParser
-import sys
-import re
-import wiki_tools
-from wiki_tools import *
-from wiki_report import WikiReporter
-import difflib
-import platform
-
-# Junit report generator.
-reporter = WikiReporter()        
-    
-#======================================================================
-def make_group_header_line(group):
-    """ Make a group header line for the property table
-    
-     Args:
-        group :: name of the group
-    Returns:
-        string to add to the wiki
-    """
-    if group=="":
-        return "|colspan=6 align=center|   \n|-\n"
-    else:
-        return "|colspan=6 align=center|'''%s'''\n|-\n" % group
-
-#======================================================================  
-def create_property_default_string(prop):
-    """ Create a default string 
-    
-     Args:
-        default. The property default value.
-    Returns:
-        string to add to the wiki property table default section.
-    """
-    # Convert to int, then float, then any string
-    
-    default = prop.getDefault
-    defaultstr = ""
-    try:
-        val = int(default)
-        if (val >= 2147483647):
-            defaultstr = "Optional"
-        else:
-            defaultstr = str(val)
-    except:
-        try:
-            val = float(default)
-            if (val >= 1e+307):
-                defaultstr = "Optional"
-            else:
-                defaultstr = str(val)
-        except:
-            # Fall-back default for anything
-            defaultstr = str(default)
-            
-    # Replace the ugly default values with "optional"
-    if (defaultstr == "8.9884656743115785e+307") or \
-       (defaultstr == "1.7976931348623157e+308") or \
-       (defaultstr == "2147483647"):
-        defaultstr = "Optional"
-        
-    if str(prop.type) == "boolean":
-        if defaultstr == "1": defaultstr = "True" 
-        else: defaultstr = "False"
-    return defaultstr
-
-#======================================================================
-def make_property_table_line(propnum, p):
-    """ Make one line of the property table
-    
-    Args:
-        propnum :: number of the prop
-        p :: Property object
-    Returns:
-        string to add to the wiki
-    """
-    
-    out = ""
-    # The property number
-    out += "|" + str(propnum) + "\n"
-    # Name of the property
-    out += "|" + p.name + "\n"
-
-    out += "|" + direction_string[p.direction] + "\n"
-    # Type (as string) wrap an IWorkspaceProperty in a link.
-    if isinstance(p, IWorkspaceProperty): 
-        out += "|[[" + str(p.type) + "]]\n"
-    else:
-        out += "|" + str(p.type) + "\n"
-       
-    if (direction_string[p.direction] == OutputDirection) and (not isinstance(p, IWorkspaceProperty)):
-      out += "|\n" # Nothing to show under the default section for an output properties that are not workspace properties.
-    elif (p.isValid == ""): #Nothing was set, but it's still valid = NOT  mandatory
-      defaultstr = create_property_default_string(p)
-      out += "| " + defaultstr + "\n"
-    else:
-      out += "|Mandatory\n"
-      
-    # Documentation
-    out += "|" + p.documentation.replace("\n", "<br />") + "\n"
-    # End of table line
-    out += "|-\n"
-    return out
-    
-
-
-#======================================================================
-def confirm(prompt=None, resp=False, continueconfirm=False):
-    """prompts for yes or no response from the user. Returns True for yes and
-    False for no.
-
-    'resp' should be set to the default value assumed by the caller when
-    user simply types ENTER.
-    
-    if 'continueconfirm', then skip the confirmation, using No (false) as the choice.
-
-    >>> confirm(prompt='Create Directory?', resp=True)
-    Create Directory? [y]|n: 
-    True
-    >>> confirm(prompt='Create Directory?', resp=False)
-    Create Directory? [n]|y: 
-    False
-    >>> confirm(prompt='Create Directory?', resp=False)
-    Create Directory? [n]|y: y
-    True
-
-    """
-    
-    # Early exit. 
-    if continueconfirm:
-        print 'Skip confirmation, changes have not been accepted.'
-        return False
-    
-    if prompt is None:
-        prompt = 'Confirm'
-
-    if resp:
-        prompt = '%s [%s]|%s: ' % (prompt, 'y', 'n')
-    else:
-        prompt = '%s [%s]|%s: ' % (prompt, 'n', 'y')
-        
-    while True:
-        ans = raw_input(prompt)
-        if not ans:
-            return resp
-        if ans not in ['y', 'Y', 'n', 'N']:
-            print 'please enter y or n.'
-            continue
-        if ans == 'y' or ans == 'Y':
-            return True
-        if ans == 'n' or ans == 'N':
-            return False
-    
-#======================================================================
-def page_exists(page):
-    # Determine if the wikipage exists or not.
-    revisions = page.revisions()
-    for rev in revisions:
-        return True
-    return False
-
-#======================================================================   
-def last_page_editor(page):
-    #Get the last editor of the page.
-    revisions = page.revisions()
-    for rev in revisions:
-        return rev['user']
-     
-#======================================================================   
-def wiki_maker_page(page):
-    """
-    returns True if the wikimaker was the last editor.
-    determines if there is a bot comment, which implies that the wikimaker was used to create the page last.
-    """
-    # If there are no previous authors, we also count this as a wikimaker page.
-    revisions = page.revisions()
-    if len(list(page.revisions())) == 0:
-        return True;
-    # Get the last editor of the page.
-    for rev in revisions: 
-        return re.search("^Bot", rev['comment'])
-
-    
-#======================================================================
-def do_algorithm(args, algo, version):
-    """ Do the wiki page
-    @param algo :: the name of the algorithm, and it's version as a tuple"""
-    is_latest_version = True
-    
-    # Find the latest version        
-    latest_version = find_latest_alg_version(algo)
-    if (version == noversion): 
-        version = latest_version
-    # Abort if a version has bee requested that is not the latest version.
-    elif version < latest_version:
-        print "Warning: You are trying to use wiki maker on an old version of an algorithm."
-        return
-        
-    print "Latest version of %s is %d. You are making version %d." % (algo, latest_version, version)
-
-    # What should the name on the wiki page be?
-    wiki_page_name = algo
-        
-    print "Generating wiki page for %s at http://www.mantidproject.org/%s" % (algo, wiki_page_name)
-    site = wiki_tools.site
-    
-    # Use wikitools to make the new contents.    
-    new_contents = make_wiki(algo, version, latest_version) 
-    
-    # Open the page with the name of the algo
-    page = site.Pages[wiki_page_name]
-    
-    # Wiki page should have a description.
-    if re.search(missing_description, new_contents):
-        reporter.addFailureNoDescription(algo, version)
-    
-    old_contents = page.edit() + "\n"
-    
-    if old_contents == new_contents:
-        print "Generated wiki page is identical to that on the website."
-        # Report a success test case.
-        reporter.addSuccessTestCase(algo)
-    else:
-        print "Generated wiki page is DIFFERENT than that on the website."
-        print
-        print "Printing out diff:"
-        print
-        # Perform a diff of the new vs old contents
-        diff = difflib.context_diff(old_contents.splitlines(True), new_contents.splitlines(True), fromfile='website', tofile='new')
-        diff_list = []
-        for line in diff:
-            sys.stdout.write(line) 
-            diff_list.append(line)
-        print
-        
-        wiki_maker_edited_last = wiki_maker_page(page)
-        last_modifier = last_page_editor(page);
-        if not wiki_maker_edited_last:
-            print "The last edit was manual. Last edit NOT done by WIKIMAKER script."
-            if not last_modifier == None:
-                # Report a failure test case
-                reporter.addFailureTestCase(algo, version, last_modifier, ''.join(diff_list))
-        else:
-            print "The last edit was automatic via a script, or this is a new page. Last edit was done by WIKIMAKER script."
-        print "Last change by ", last_modifier
-        
-        if args.dryrun:
-            print "Dry run of saving page to http://www.mantidproject.org/%s" % wiki_page_name
-        elif wiki_maker_edited_last or args.force or confirm("Do you want to replace the website wiki page?", True, args.continueconfirm):
-            print "Saving page to http://www.mantidproject.org/%s" % wiki_page_name
-            page.save(new_contents, summary = 'Bot: replaced contents using the wiki_maker.py script.' )
-            
-    saved_text = open(wiki_page_name+'.txt', 'w')
-    saved_text.write(new_contents)
-    saved_text.close()
-    
-    
-#======================================================================
-if __name__ == "__main__":
-    
-    reload(sys).setdefaultencoding('utf8')
-    # First, get the config for the last settings
-    config = ConfigParser.ConfigParser()
-    localpath = os.path.split(__file__)[0]
-    if not localpath: localpath = '.'
-    config_filename = localpath + "/wiki_maker.ini"
-    config.read(config_filename)
-    defaultuser = ""
-    defaultpassword = ""
-    defaultmantidpath = ""
-    try:
-        defaultuser = config.get("login", "username")
-        defaultpassword = config.get("login", "password")
-        defaultmantidpath = config.get("mantid", "path")
-    except:
-        pass
-    
-    parser = optparse.OptionParser(description='Generate the Wiki documentation for one '
-                                      'or more algorithms, and updates the mantidproject.org website')
-   
-    parser.add_option('--user', dest='username', default=defaultuser,
-                        help="User name, to log into the www.mantidproject.org wiki. Default: '%s'. This value is saved to a .ini file so that you don't need to specify it after." % defaultuser)
-
-    parser.add_option('--password', dest='password', default=defaultpassword,
-                        help="Password, to log into the www.mantidproject.org wiki. Default: '%s'. Note this is saved plain text to a .ini file!" % defaultpassword)
-    
-    parser.add_option('--mantidpath', dest='mantidpath', default=defaultmantidpath,
-                        help="Full path to the Mantid compiled binary folder. Default: '%s'. This will be saved to an .ini file" % defaultmantidpath)
-
-    parser.add_option('--force', dest='force', action='store_const',
-                        const=True, default=False,
-                        help="Force overwriting the wiki page on the website if different (don't ask the user)")
-
-    parser.add_option('--alg-version', dest='algversion', default=noversion, 
-                        help='Algorithm version to create the wiki for. Latest version if absent.')
-    
-    parser.add_option('--report', dest='wikimakerreport', default=False, action='store_const', const=True,
-                        help="Record authors and corresponding algorithm wiki-pages that have not been generated with the wiki-maker")
-    
-    parser.add_option('--cache-config', dest='cacheconfig', default=False, action='store_const', const=True,
-                        help="If set, the creditials of the executor will be cached for the next run.")
-    
-    parser.add_option('--dry-run', dest='dryrun', default=False, action='store_const', const=True,
-                        help="If set, then the utility will work exactly the same, but no changes will actually be pushed to the wiki.")
-    
-    parser.add_option('--continue-confirm', dest='continueconfirm', default=False, action='store_const', const=True,
-                        help="If set, then any user-required confirmation will be skipped, without applying the change.")
-    
-
-    (args, algos) = parser.parse_args()
-    
-    if args.cacheconfig:
-        # Write out config for next time
-        config = ConfigParser.ConfigParser()
-        config.add_section("login")
-        config.set("login", "username", args.username)
-        config.set("login", "password", args.password)
-        config.add_section("mantid")
-        config.set("mantid", "path", args.mantidpath)
-        f = open(config_filename, 'w')
-        config.write(f)
-        f.close()
-
-    if len(algos)==0:
-        parser.error("You must specify at least one algorithm.")
-
-    # Command-line overrides anything for finding Mantid
-    if args.mantidpath is not None:
-        os.environ['MANTIDPATH'] = args.mantidpath        
-    elif not "MANTIDPATH" in os.environ:
-        raise RuntimeError("Cannot find Mantid. MANTIDPATH environment variable not set & --mantidpath option not given")
-    else:
-        pass
-    # Make sure the internal module use can find Mantid 
-    sys.path.append(os.environ['MANTIDPATH'])
-
-        # Check if python_d must be used to call into Mantid
-    if platform.system() == 'Windows':
-        flag_if_build_is_debug(os.environ['MANTIDPATH'])
-        module_dir = os.path.dirname(__file__)
-        os.environ["PYTHONPATH"] = os.environ.get("PYTHONPATH","") + ";" + module_dir + ";" + os.environ['MANTIDPATH']
-    
-    initialize_wiki(args)
-  
-    if len(algos) == 1 and algos[0] == "ALL":
-        print "Documenting ALL Algorithms"
-        alg_to_vers = get_algorithm_to_version_lookup()
-        for name, versions in alg_to_vers.iteritems():
-            for version in versions:
-                do_algorithm(args, name, version)
-    else:
-        for algo in algos:
-            do_algorithm(args, algo, int(args.algversion))
-            
-    if args.wikimakerreport:
-        junit_file = open('WikiMakerReport.xml', 'w')
-        junit_file.write(reporter.getResults())
-        junit_file.close()
-    
diff --git a/Code/Mantid/Build/wiki_report.py b/Code/Mantid/Build/wiki_report.py
deleted file mode 100644
index a5762f4e2b205fe282970d7c164aabd1f21d1b0f..0000000000000000000000000000000000000000
--- a/Code/Mantid/Build/wiki_report.py
+++ /dev/null
@@ -1,69 +0,0 @@
-from xml.dom.minidom import getDOMImplementation
-
-class WikiReporter:
-
-    _time_taken = 0.0
-    _failures = []
-    _skipped = []
-    
-    def __init__(self, showSkipped=True):
-        self._doc = getDOMImplementation().createDocument(None,'testsuite',None)
-        self._show_skipped = showSkipped
-
-    def reportStatus(self):
-        return len(self._failures) == 0
-
-    def getResults(self):
-        # print the command line summary version of the results
-        self._failures.sort()
-        self._skipped.sort()
-        print
-        if self._show_skipped and len(self._skipped) > 0:
-            print "SKIPPED:"
-            for test in self._skipped:
-                print test
-        if len(self._failures) > 0:
-            print "FAILED:"
-            for test in self._failures:
-                print test
-
-        # return the xml document version
-        docEl = self._doc.documentElement
-        docEl.setAttribute('name','SystemTests')
-        docEl.setAttribute('tests',str(len(docEl.childNodes)))
-        docEl.setAttribute('failures',str(len(self._failures)))
-        docEl.setAttribute('skipped', str(len(self._skipped)))
-        docEl.setAttribute('time',str(self._time_taken))
-        return self._doc.toxml()
-    
-    def __addGenericFailure__(self, contents, algorithm):
-        elem = self._doc.createElement('testcase')
-        elem.setAttribute('classname', 'WikiMaker')
-        elem.setAttribute('name', algorithm)
-        self._failures.append(algorithm)
-        failEl = self._doc.createElement('failure')
-        failEl.appendChild(self._doc.createTextNode(contents))
-        elem.appendChild(failEl)
-        time_taken = 0
-        elem.setAttribute('time',str(time_taken))
-        elem.setAttribute('totalTime',str(time_taken))
-        self._doc.documentElement.appendChild(elem)
-    
-    def addSuccessTestCase(self, algorithm):
-        elem = self._doc.createElement('testcase')
-        elem.setAttribute('classname', 'WikiMaker')
-        elem.setAttribute('name', algorithm)
-        time_taken = 0
-        elem.setAttribute('time',str(time_taken))
-        elem.setAttribute('totalTime',str(time_taken))
-        self._doc.documentElement.appendChild(elem)
-    
-    
-    def addFailureTestCase(self, algorithm, version, last_editor, diff):
-        contents = "Algorithm %s Version %i last edited by %s is out of sync.\n\nDifferences are:\n\n%s" % (algorithm, version, last_editor, diff)
-        self.__addGenericFailure__(contents, algorithm)
-        
-    def addFailureNoDescription(self, algorithm, version):
-        contents = "Algorithm %s Version %i has no description" % (algorithm, version)
-        self.__addGenericFailure__(contents, algorithm)
-
diff --git a/Code/Mantid/Build/wiki_tools.py b/Code/Mantid/Build/wiki_tools.py
deleted file mode 100755
index a4d57fe11149e45821671d202a1bea8895a1c26f..0000000000000000000000000000000000000000
--- a/Code/Mantid/Build/wiki_tools.py
+++ /dev/null
@@ -1,786 +0,0 @@
-#!/usr/bin/env python
-""" A few tools for validating the wiki at mantidproject.org """
-import warnings
-import optparse
-import os
-import ConfigParser
-import sys
-import codecs
-import fnmatch
-import platform
-import re
-
-module_name=os.path.basename(os.path.splitext(__file__)[0])
-mantid_initialized = False
-mantid_debug = False
-python_d_exe = None
-# no version identier
-noversion = -1
-# Direction
-InputDirection = "Input"
-OutputDirection = "Output"
-InOutDirection = "InOut"
-NoDirection = "None"
-direction_string = [InputDirection, OutputDirection, InOutDirection, NoDirection]
-
-# Holds on to location of sources
-file_search_done=False
-cpp_files = []
-cpp_files_bare = []
-python_files = []
-python_files_bare = []
-
-# Missing description tag.
-missing_description = "INSERT FULL DESCRIPTION HERE"
-
-#======================================================================
-def remove_wiki_from_header():
-    """One-time method to remove *WIKI* tags from all header files """
-    parent_dir = os.path.abspath(os.path.join(os.path.split(__file__)[0], os.path.pardir))
-    for root, dirnames, filenames in os.walk(parent_dir):
-      for filename in fnmatch.filter(filenames, '*.h'):
-        fullfile = os.path.join(root, filename)
-        f = open(fullfile,'r')
-        lines = f.read().split('\n')
-        f.close()
-        n = 0
-        # The output file
-        outlines = []
-        while n < len(lines) and (not lines[n].startswith("/*WIKI*") and not lines[n].startswith('"""*WIKI*')):
-            outlines.append( lines[n] )
-            n += 1
-        #Skip all the WIKI lines
-        while (n < len(lines)) and not lines[n].startswith("*WIKI*"):
-            n += 1
-        n += 1
-        # Copy the rest
-        while n < len(lines):
-            outlines.append( lines[n] )
-            n += 1
-        
-        f = open(fullfile,'w')
-        f.write('\n'.join(outlines))
-        f.close()
-
-#======================================================================
-def add_wiki_description(algo, wikidesc):
-    """One-time use method that adds a wiki description  in the algo's CPP file under comments tag."""
-    wikidesc = wikidesc.split('\n')
-    
-    source = find_algo_file(algo)
-    if source != '':
-        if len("".join(wikidesc)) == 0:
-            print "No wiki description found to add!!!!"
-        
-        f = open(source,'r')
-        lines = f.read().split('\n')
-        f.close()
-        
-        #What lines are we adding?
-        if source.endswith(".py"):
-            adding = ['"""*WIKI* ', ''] + wikidesc + ['*WIKI*"""'] 
-        else:
-            adding = ['/*WIKI* ', ''] + wikidesc + ['*WIKI*/'] 
-    
-        lines = adding + lines
-        
-        text = "\n".join(lines)
-        f = codecs.open(source, encoding='utf-8', mode='w+')
-        f.write(text)
-        f.close()
-
-#======================================================================
-def get_wiki_description(algo, version):
-    tryUseDescriptionFromBinaries = True
-    return get_custom_wiki_section(algo, version, "*WIKI*", tryUseDescriptionFromBinaries)
-
-#======================================================================
-def get_wiki_usage(algo, version):
-    wiki_usage = get_custom_wiki_section(algo, version, "*WIKI_USAGE*")
-    wiki_no_sig_usage = get_custom_wiki_section(algo, version, "*WIKI_USAGE_NO_SIGNATURE*")
-    
-    if wiki_usage:
-        return (True, wiki_usage)
-    elif wiki_no_sig_usage:
-        return (False, wiki_no_sig_usage)
-    else:
-        return (True, "")
-            
-
-#======================================================================
-def get_custom_wiki_section(algo, version, tag, tryUseDescriptionFromBinaries=False, verbose=True):
-    """ Extract the text between the *WIKI* tags in the .cpp file
-    
-    @param algo :: name of the algorithm
-    @param version :: version, -1 for latest 
-    """
-    
-    desc = ""
-    source = find_algo_file(algo, version)
-    if source == '' and tryUseDescriptionFromBinaries:
-        from mantid.api import AlgorithmManager
-        alg = AlgorithmManager.createUnmanaged(algo, version)
-        print "Getting algorithm description from binaries."
-        return alg.summary()
-    elif source == '' and not tryUseDescriptionFromBinaries:
-        print "Warning: Cannot find source for algorithm"
-        return desc
-    else:
-        return get_wiki_from_source(source, tag, verbose)
-
-def get_fitfunc_summary(name, verbose=True):
-    source = find_fitfunc_file(name)
-    if len(source) <= 0:
-        print "Warning: Cannot find source for fitfunction '%s'" % name
-        return ""
-    return get_wiki_from_source(source, "*WIKI*", verbose)
-
-def get_wiki_from_source(source, tag, verbose=True):
-        f = open(source,'r')
-        lines = f.read().split('\n')
-        #print lines
-        f.close()
-        
-        print source
-        desc = ""
-        try:
-            # Start and end location markers.
-            start_tag_cpp = "/" + tag 
-            start_tag_python = '"""%s' % tag
-            end_tag_cpp = tag + "/"
-            end_tag_python = '%s"""' % tag
-            
-            # Find the start and end lines for the wiki section in the source.
-            start_index = 0
-            end_index = 0
-            for line_index in range(0, len(lines)):
-                line = lines[line_index]
-                if line.lstrip().startswith(start_tag_cpp) or line.lstrip().startswith(start_tag_python):
-                    start_index = line_index + 1
-                    continue
-                if line.lstrip().startswith(end_tag_cpp) or line.lstrip().startswith(end_tag_python):
-                    end_index = line_index
-                    break
-            
-            # Concatinate across the range.
-            for line_index in range(start_index, end_index):
-                desc += lines[line_index] + "\n"
-
-            if verbose:
-                if start_index == end_index:
-                    print "No  '%s' section in source '%s'." % (tag, source)
-                else:
-                    print "Getting '%s' section from source '%s'." % (tag, source)
-        
-        except IndexError:
-            print "No '%s' section in source '%s'." % (tag, source)
-        return desc        
-        
-#======================================================================
-def create_function_signature(alg, algo_name):
-    """
-    create the function signature for the algorithm.
-    """
-    import mantid.simpleapi
-    from mantid.api import IWorkspaceProperty
-    from mantid.simpleapi import _get_function_spec
-
-    _alg = getattr(mantid.simpleapi, algo_name)
-    prototype =  algo_name + _get_function_spec(_alg)
-    
-    # Replace every nth column with a newline.
-    nth = 4
-    commacount = 0
-    prototype_reformated = ""
-    for char in prototype:
-        if char == ',':
-            commacount += 1
-            if (commacount % nth == 0):
-                prototype_reformated += ",\n  "
-            else:
-                prototype_reformated += char
-        else: 
-           prototype_reformated += char
-           
-    # Strip out the version.
-    prototype_reformated = prototype_reformated.replace(",[Version]", "")
-    
-    # Add the output properties
-    props = alg.getProperties()
-    allreturns = []
-    # Loop through all the properties looking for output properties
-    for prop in props:
-        if (direction_string[prop.direction] == OutputDirection):
-            allreturns.append(prop.name)
-                
-    lhs = ""
-    comments = ""
-    if not allreturns:
-        pass
-    elif (len(allreturns) == 1): 
-        lhs =   allreturns[0] + " = "
-    else :
-        lhs = "result = "
-        comments = "\n "
-        comments += "\n # -------------------------------------------------- \n"
-        comments += " # result is a tuple containing\n"
-        comments += " # (" + ",".join(allreturns ) + ")\n"
-        comments += " # To access individual outputs use result[i], where i is the index of the required output.\n"
-        
-    return lhs + prototype_reformated + comments
-
-def filter_blacklist_directories(dirnames):
-    blacklist = ['MantidPlot', 'MantidQt']
-    filtered = dirnames
-    for banneddir in blacklist:
-        if banneddir in dirnames:
-            filtered.remove(banneddir)
-    return filtered
-
-#======================================================================
-def intialize_files():
-    """ Get path to every header file """
-    global file_matches
-    parent_dir = os.path.abspath(os.path.join(os.path.split(__file__)[0], os.path.pardir))
-    file_matches = []
-    for root, dirnames, filenames in os.walk(parent_dir):
-      # Filter out mantidplot from the file search. There are a few file in MantidPlot we don't want to accidently search, such as FFT.
-      dirnames = filter_blacklist_directories(dirnames)
-      for filename in fnmatch.filter(filenames, '*.cpp'):
-          fullfile = os.path.join(root, filename)
-          cpp_files.append(fullfile)
-          cpp_files_bare.append( os.path.split(fullfile)[1] )
-      for filename in fnmatch.filter(filenames, '*.py'):
-          fullfile = os.path.join(root, filename)
-          python_files.append(fullfile)
-          python_files_bare.append( os.path.split(fullfile)[1] )
-    
-
-
-#======================================================================
-def find_algo_file(algo, version=-1):
-    """Find the files for a given algorithm (and version)"""
-    global file_search_done
-    if not file_search_done:
-        intialize_files()
-        file_search_done=True
-
-    source = ''
-    filename = algo
-    if version > 1:
-        filename += '%d' % version
-    cpp = filename + ".cpp"
-    pyfile = filename + ".py"
-    if cpp in cpp_files_bare:
-        n = cpp_files_bare.index(cpp, )
-        source = cpp_files[n]
-    elif pyfile in python_files_bare:
-        n = python_files_bare.index(pyfile, )
-        source = python_files[n]
-    return source
-
-#======================================================================
-def find_fitfunc_file(name):
-    """Find the files for a given algorithm (and version)"""
-    global file_search_done
-    if not file_search_done:
-        intialize_files()
-        file_search_done=True
-
-    source = ''
-    filename = name
-    cpp = filename + ".cpp"
-    pyfile = filename + ".py"
-    if cpp in cpp_files_bare:
-        candidates = []
-        total = cpp_files_bare.count(cpp)
-        index = -1
-        while len(candidates) < total:
-            index = cpp_files_bare.index(cpp, index+1)
-            candidates.append(cpp_files[index])
-        source = candidates[0]
-        if total > 1:
-            print candidates
-            for filename in candidates:
-                if "CurveFitting" in filename:
-                    source = filename
-                    break
-    elif pyfile in python_files_bare:
-        n = python_files_bare.index(pyfile, )
-        source = python_files[n]
-    return source
-
-#======================================================================
-def initialize_wiki(args):
-    global site
-    exec_path=sys.executable
-    if sys.executable.endswith('python_d.exe'):
-        msg="wiki_maker must be called with standard python.exe not the debug python_d.exe" + \
-            "You can still use a debug build of Mantid with wiki_maker, the use of python_d is handled internally"
-        raise RuntimeError(msg)
-
-    import mwclient
-    # Init site object
-    print "Connecting to site mantidproject.org"
-    site = mwclient.Site('www.mantidproject.org', path='/')
-    # Login, if specified
-    if hasattr(args, 'username'):
-        print "Logging in as %s" % args.username
-        site.login(args.username, args.password) 
-    
-    
-#======================================================================
-def flag_if_build_is_debug(mantidpath):
-    """
-    Check if the given build is a debug build of Mantid
-    """
-    global mantid_debug
-    global python_d_exe
-    if platform.system() != 'Windows':
-        return
-
-    kernel_path=os.path.join(mantidpath,"mantid","kernel")
-    if os.path.exists(os.path.join(kernel_path,"_kernel_d.pyd")):
-        mantid_debug=True
-        #Try & find python_d exe to use.
-        exec_path=sys.executable.replace(".exe","_d.exe")
-        if os.path.exists(exec_path):
-           python_d_exe = exec_path
-        else:
-            raise RuntimeError("No python_d.exe found next to python.exe at %s" %(sys.executable))
-        
-    elif os.path.exists(os.path.join(kernel_path,"_kernel.pyd")):
-        mantid_debug=False
-    else:
-        raise RuntimeError("Unable to locate Mantid python libraries.")
-
-#======================================================================
-def get_algorithm_to_version_lookup():
-    """
-        Returns a dictionary of all algorithm names along with a list of their versions.
-        If necessary done via a subprocess
-    """
-    global mantid_debug
-    if not mantid_debug:
-        lookup=do_get_algorithm_to_version_lookup()
-    else:
-        import subprocess
-        marker='@@@@@@@@@@@WIKI_TOOLS_END_OF_FUNCTION_CALL_STDOUT@@@@@@@@@@@@@@'
-        code="import %s;out=%s.do_get_algorithm_to_version_lookup(as_str=True);print '%s';print out" % (module_name,module_name,marker)
-        sp_output = subprocess.check_output([python_d_exe,"-c",code])
-        try:
-            fn_prints,fn_retval = sp_output.split(marker)
-            # Reconstruct dictionary
-            lookup = {}
-            all_lines = fn_retval.strip().splitlines()
-            for line in all_lines:
-                columns = line.split()
-                # First is name remaining are version numbers
-                versions = []
-                for v in columns[1:]:
-                    versions.append(int(v))
-                lookup[columns[0]] = versions
-        except ValueError:
-            raise RuntimeError("Error in processing output from subprocess. Most likely a bug in wiki_tools")
-
-    return lookup
-    
-def do_get_algorithm_to_version_lookup(as_str=False):
-    """
-        Returns a list of all algorithm names and versions as a dictionary
-        @param as_str If True, then the dictionary is transformed to a string 
-                      of one algorithm per line: "name 1 2 3 ..." with as many columns as versions afterward
-    """
-    import mantid
-    from mantid.api import AlgorithmFactory
-    algs = AlgorithmFactory.getRegisteredAlgorithms(True)
-    if not as_str:
-        return algs
-        
-    out=""
-    for name, versions in algs.iteritems():
-        out += name + " "
-        for version in versions:
-            out += str(version) + " "
-        out += "\n"
-    return out
-
-#======================================================================
-def get_all_algorithm_names():
-    """Returns a list of all algorithm names"""
-    alg_lookup = get_algorithm_to_version_lookup()
-    return alg_lookup.keys() 
-
-#======================================================================
-def find_misnamed_algos():
-    """Prints out algos that have mismatched class names and algorithm names"""
-    algos = get_all_algorithms()
-    print "\n--- The following algorithms have misnamed class files."
-    print   "--- No file matching their algorithm name could be found.\n"
-    for algo in algos:
-        source = find_algo_file(algo, -1)
-        if source=='':
-            print "%s was NOT FOUND" % (algo, )
-            
-#======================================================================
-def find_section_text(lines, section, go_to_end=False, section2=""):
-    """ Search WIKI text to find a section text there """
-    if len(lines) == 0:
-        return ""
-    n = 0
-    for line in lines:
-        line_mod = line.replace(" ", "")
-        if line_mod.startswith("==%s" % section) \
-            or (section2 != "" and line_mod.startswith("==%s" % section2)):
-            # Section started
-            n += 1
-            doc = ""
-            # collect the documents till next section or the end 
-            newline = lines[n]
-            while (go_to_end or not newline.strip().startswith('==')) \
-                  and not newline.strip().startswith('[[Category'):
-                doc += newline + '\n'
-                n += 1
-                if n < len(lines):
-                    newline = lines[n]
-                else:
-                    break
-            return doc
-        n += 1
-            
-    return ""
-    
-    
-
-#======================================================================
-def find_property_doc(lines, propname):
-    """ Search WIKI text to find a properties' documentation there """
-    if len(lines) == 0:
-        return ""
-    n = 0
-    for line in lines:
-        if line.strip() == "|" + propname:
-            doc = lines[n+4].strip()
-            if len(doc)>1:
-                doc = doc[1:]
-            return doc
-        n += 1
-            
-    return ""
-    
-#======================================================================
-def validate_wiki(args, algos):
-    """ Look for any missing wiki pages / inconsistencies """
-    missing = []
-    
-    for algo in algos:
-        print "\n================= %s ===================" % algo
-        
-        # Check wiki page and download contents
-        page = site.Pages[algo]
-        wiki = page.edit()
-        lines = []
-        if len(wiki) == 0:
-            print "- Algorithm wiki page for %s is MISSING!" % algo
-            missing.append(algo)
-        else:
-            lines = wiki.split('\n')
-            
-        source = find_algo_file(algo)
-        if source=='':
-            print "- Source file not found."
-
-        # Validate the algorithm itself
-        alg = mtd.createAlgorithm(algo)
-        summary = alg._ProxyObject__obj.getWikiSummary()
-        if len(summary) == 0: 
-            print "- Summary is missing (in the code)."
-            wikidoc = find_section_text(lines, "Summary", go_to_end=False, section2="")
-            if args.show_missing: print wikidoc
-            
-#        # One-time code to add wiki desc to CPP file
-#        desc = find_section_text(lines, "Description", True, "Introduction")
-#        # Fallback to the code one
-#        if len(desc) == 0: 
-#            desc = alg._ProxyObject__obj.getWikiDescription()
-#        add_wiki_description(algo, desc)
-            
-        props = alg._ProxyObject__obj.getProperties()
-        for prop in props:
-            if len(prop.documentation) == 0:
-                print "- Property %s has no documentation/tooltip (in the code)." % prop.name,
-                wikidoc = find_property_doc(lines, prop.name)
-                if len(wikidoc) > 0:
-                    print "Found in wiki"
-                    if args.show_missing: print "   \"%s\"" % wikidoc
-                else:
-                    print "Not found in wiki."
-            
-    print "\n\n"
-    print "Algorithms with missing wiki page:\n", " ".join(missing) 
-
-
-#======================================================================
-def find_orphan_wiki():
-    """ Look for pages on the wiki that do NOT correspond to an algorithm """
-    category = site.Pages['Category:Algorithms']
-    algos = get_all_algorithms()
-            
-    for page in category:
-        algo_name = page.name
-        if not (algo_name.startswith("Category:")):
-            if not (algo_name in algos) :
-                print "Algorithm %s was not found." % algo_name
-
-#======================================================================
-def find_latest_alg_version(algo_name):
-    """
-        Calls into mantid to find the latest version of the given algorithm
-        via subprocess call to mantid if necessary
-        @param algo_name The name of the algorithm
-    """
-    if not mantid_debug:  
-        return do_find_latest_alg_version(algo_name)
-    else:
-        import subprocess
-        code="import %s;print %s.do_find_latest_alg_version('%s')" % (module_name,module_name,algo_name)
-        output = subprocess.check_output([python_d_exe,"-c",code])
-        # Output will contain possible warnings,notices etc. Just want the last character
-        return int(output.strip()[-1])
-    
-def do_find_latest_alg_version(algo_name):
-    """
-        Calls into mantid to find the latest version of the given algorithm
-        @param algo_name The name of the algorithm
-    """
-    import mantid
-    from mantid.api import AlgorithmManager
-    return AlgorithmManager.createUnmanaged(algo_name, noversion).version()
-    
-#======================================================================
-
-def make_wiki(algo_name, version, latest_version):
-    """ Return wiki text for a given algorithm via subprocess call to mantid
-    if necessary, this allows it to work in debug on Windows.
-    @param algo_name :: name of the algorithm (bare)
-    @param version :: version requested
-    @param latest_version :: the latest algorithm 
-    """
-    if not mantid_debug:  
-        output=do_make_wiki(algo_name,version,latest_version)
-    else:
-        import subprocess
-        marker='@@@@@@@@@@@WIKI_TOOLS_END_OF_FUNCTION_CALL_STDOUT@@@@@@@@@@@@@@'
-        code="import %s;import mantid;out=%s.do_make_wiki('%s',%d,%d);print '%s';print out" % (module_name,module_name,algo_name,version,latest_version,marker)
-        sp_output = subprocess.check_output([python_d_exe,"-c",code])
-        try:
-            fn_prints,fn_retval = sp_output.split(marker)
-            output=fn_retval
-        except ValueError:
-            raise RuntimeError("Error in processing output from subprocess. Most likely a bug in wiki_tools")
-    return output
-    
-#======================================================================
-def do_make_wiki(algo_name, version, latest_version):
-    """ Return wiki text for a given algorithm
-    @param algo_name :: name of the algorithm (bare)
-    @param version :: version requested
-    @param latest_version :: the latest algorithm 
-    """ 
-    
-    external_image = "http://download.mantidproject.org/algorithm_screenshots/ScreenShotImages/%s_dlg.png" % algo_name  
-    out = "<anchor url='%s'><img width=400px src='%s' style='position:relative; z-index:1000; padding-left:5px; float:right;'></anchor>\n\n" % (external_image, external_image)  
-    
-    # Deprecated algorithms: Simply return the deprecation message
-    print "Creating... ", algo_name, version
-    import mantid
-    from mantid.api import AlgorithmManager,DeprecatedAlgorithmChecker
-    # Deprecated algorithms: Simply returnd the deprecation message
-    print "Creating... ", algo_name, version
-    deprec_check = DeprecatedAlgorithmChecker(algo_name,version)
-    deprec = deprec_check.isDeprecated()
-    if len(deprec) != 0:
-        out += "== Deprecated ==\n\n"
-        deprecstr = deprec
-        deprecstr = deprecstr.replace(". Use ", ". Use [[")
-        deprecstr = deprecstr.replace(" instead.", "]] instead.")
-        out += deprecstr 
-        out += "\n\n"
-    
-    alg = AlgorithmManager.createUnmanaged(algo_name, version)
-    alg.initialize()
-    
-    if (latest_version > 1):
-        out += "Note: This page refers to version %d of %s. \n\n"% (version, algo_name)
-            
-    
-    out += "== Summary ==\n\n"
-    out += alg.getWikiSummary().replace("\n", " ") + "\n\n"
-    # Fetch the custom usage wiki section.
-    include_signature, custom_usage = get_wiki_usage(algo_name, version)
-    out += "\n\n== Usage ==\n\n"
-    if include_signature:
-        out += " " + create_function_signature(alg, algo_name) + "\n\n" 
-    out += "<br clear=all>\n\n" 
-    out += custom_usage
-
-    # If there is an alias put it in
-    alias = alg.alias().strip()
-    if len(alias) > 0:
-        out += ("== Alias ==\n\n")
-        out += "This algorithm is also called '%s'\n\n" % alias
-
-    # Table of properties
-    out += "== Properties ==\n\n"
-    
-    out += """{| border="1" cellpadding="5" cellspacing="0" 
-!Order\n!Name\n!Direction\n!Type\n!Default\n!Description
-|-\n"""
-
-    # Do all the properties
-    props = alg.getProperties()
-    propnum = 1
-    last_group = ""
-    for prop in props:
-        group = prop.getGroup
-        if (group != last_group):
-            out += make_group_header_line(group)
-            last_group = group
-        out += make_property_table_line(propnum, prop)
-        propnum += 1
-        
-        
-    # Close the table
-    out += "|}\n\n"
-
-
-    out += "== Description ==\n"
-    out += "\n"
-    desc = ""
-    try:
-        desc = get_wiki_description(algo_name,version)
-    except IndexError:
-        pass
-    if (desc == ""):
-      out +=  missing_description + "\n"
-      print "Warning: missing wiki description for %s! Placeholder inserted instead." % algo_name
-    else:
-      out += desc + "\n"
-    out += "\n"
-    out += "[[Category:Algorithms]]\n"
-    
-    # All other categories
-    categories = alg.categories()
-    for categ in categories:
-        n = categ.find("\\")
-        if (n>0):
-            # Category is "first\second"
-            first = categ[0:n]
-            second = categ[n+1:]
-            out += "[[Category:" + first + "]]\n"
-            out += "[[Category:" + second + "]]\n"
-        else:
-            out += "[[Category:" + categ + "]]\n"
-
-    # Point to the right source ffiles
-    if version > 1:
-        out +=  "{{AlgorithmLinks|%s%d}}\n" % (algo_name, version)
-    else:
-        out +=  "{{AlgorithmLinks|%s}}\n" % (algo_name)
-
-    return out
-
-#======================================================================
-def make_property_table_line(propnum, p):
-    """ Make one line of the property table
-    
-    Args:
-        propnum :: number of the prop
-        p :: Property object
-    Returns:
-        string to add to the wiki
-    """    
-    from mantid.api import IWorkspaceProperty
-    
-    out = ""
-    # The property number
-    out += "|" + str(propnum) + "\n"
-    # Name of the property
-    out += "|" + p.name + "\n"
-
-    out += "|" + direction_string[p.direction] + "\n"
-    # Type (as string) wrap an IWorkspaceProperty in a link.
-    if isinstance(p, IWorkspaceProperty): 
-        out += "|[[" + str(p.type) + "]]\n"
-    else:
-        out += "|" + str(p.type) + "\n"
-       
-    if (direction_string[p.direction] == OutputDirection) and (not isinstance(p, IWorkspaceProperty)):
-      out += "|\n" # Nothing to show under the default section for an output properties that are not workspace properties.
-    elif (p.isValid == ""): #Nothing was set, but it's still valid = NOT  mandatory
-      defaultstr = create_property_default_string(p)
-      out += "| " + defaultstr + "\n"
-    else:
-      out += "|Mandatory\n"
-      
-    # Documentation
-    out += "|" + p.documentation.replace("\n", "<br />") + "\n"
-    # End of table line
-    out += "|-\n"
-    return out
-    
-
-#======================================================================
-def make_group_header_line(group):
-    """ Make a group header line for the property table
-    
-     Args:
-        group :: name of the group
-    Returns:
-        string to add to the wiki
-    """
-    if group=="":
-        return "|colspan=6 align=center|   \n|-\n"
-    else:
-        return "|colspan=6 align=center|'''%s'''\n|-\n" % group
-
-#======================================================================  
-def create_property_default_string(prop):
-    """ Create a default string 
-    
-     Args:
-        default. The property default value.
-    Returns:
-        string to add to the wiki property table default section.
-    """
-    # Convert to int, then float, then any string
-    
-    default = prop.getDefault
-    defaultstr = ""
-    try:
-        val = int(default)
-        if (val >= 2147483647):
-            defaultstr = "Optional"
-        else:
-            defaultstr = str(val)
-    except:
-        try:
-            val = float(default)
-            if (val >= 1e+307):
-                defaultstr = "Optional"
-            else:
-                defaultstr = str(val)
-        except:
-            # Fall-back default for anything
-            defaultstr = str(default)
-            
-    # Replace the ugly default values with "optional"
-    if (defaultstr == "8.9884656743115785e+307") or \
-       (defaultstr == "1.7976931348623157e+308") or \
-       (defaultstr == "2147483647"):
-        defaultstr = "Optional"
-        
-    if str(prop.type) == "boolean":
-        if defaultstr == "1": defaultstr = "True" 
-        else: defaultstr = "False"
-    return defaultstr
diff --git a/Code/Mantid/CMakeLists.txt b/Code/Mantid/CMakeLists.txt
index b0d2dc695ce98ea62e76e2cf2d973b918f6ec964..cd92edadf8c9699f089c3816210694c154e0c5e7 100644
--- a/Code/Mantid/CMakeLists.txt
+++ b/Code/Mantid/CMakeLists.txt
@@ -15,7 +15,7 @@ project ( Mantid )
 set ( CPACK_PACKAGE_SUFFIX "" CACHE STRING "suffix used to determine the deployment type")
 set_property(CACHE CPACK_PACKAGE_SUFFIX PROPERTY STRINGS nightly unstable "") #empty string and release are treated as the same thing
 
-#Set package name here 
+#Set package name here
 set ( CPACK_PACKAGE_NAME "mantid${CPACK_PACKAGE_SUFFIX}" )
 
 ###########################################################################
@@ -31,10 +31,10 @@ include ( ParaViewSetup )
 ###########################################################################
 # Set paths to Third_Party for Windows builds
 ###########################################################################
-IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")	
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 
 	if ( NOT THIRD_PARTY )
-  		set ( THIRD_PARTY "${PROJECT_SOURCE_DIR}/../Third_Party" )  
+  		set ( THIRD_PARTY "${PROJECT_SOURCE_DIR}/../Third_Party" )
 	endif ()
 	# Print out where we think we are looking for 3rd party stuff
 	message (STATUS "Setting THIRD_PARTY to be ${THIRD_PARTY}." )
@@ -43,21 +43,21 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 	if (NOT IS_DIRECTORY "${THIRD_PARTY}")
         message ( WARNING "Specified THIRD_PARTY directory doesn't exist!" )
 	endif()
-	
+
 	include ( WindowsSetup )
-	
+
 	# Settings for generating the windows Nullsoft package via CPack
-	include ( WindowsNSIS )	
-	
+	include ( WindowsNSIS )
+
 ENDIF()
 
 ###########################################################################
 # Set paths to Third_Party for Mac builds
 ###########################################################################
-IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")	
+IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 
   if ( NOT THIRD_PARTY )
-    set ( THIRD_PARTY "${PROJECT_SOURCE_DIR}/../Third_Party" )  
+    set ( THIRD_PARTY "${PROJECT_SOURCE_DIR}/../Third_Party" )
   endif ()
 
   # Print out where we think we are looking for 3rd party stuff
@@ -68,8 +68,8 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     message ( WARNING "Specified THIRD_PARTY directory doesn't exist!" )
   endif()
 
-  include ( DarwinSetup )	
-    
+  include ( DarwinSetup )
+
 ENDIF()
 
 ###########################################################################
@@ -81,10 +81,10 @@ include ( CommonSetup )
 # Find qwt. Needs to be version 5
 ###########################################################################
 find_package ( Qwt REQUIRED )
-if( QWT_VERSION VERSION_LESS 5.0 OR QWT_VERSION VERSION_EQUAL 6.0 OR 
+if( QWT_VERSION VERSION_LESS 5.0 OR QWT_VERSION VERSION_EQUAL 6.0 OR
     QWT_VERSION VERSION_GREATER 6.0 )
   message ( FATAL_ERROR "Qwt version 5 is required, found: ${QWT_VERSION}" )
-endif() 
+endif()
 
 ###########################################################################
 # Find PyQt & sip
@@ -103,6 +103,9 @@ add_subdirectory ( QtPropertyBrowser )
 ###########################################################################
 # Flag that this is a full build, i.e not framework only
 set( FULL_PACKAGE_BUILD 1 )
+# Set the path to the built docs directory here so that it can be used in
+# the Kernel project for populating the properties file
+set( DOCS_BUILDDIR ${CMAKE_BINARY_DIR}/docs )
 
 # Framework Build options
 set ( CXXTEST_SINGLE_LOGFILE CACHE BOOL "Switch to have the tests for each package run together")
@@ -117,10 +120,10 @@ include_directories ( Framework/API/inc )
 set ( CORE_MANTIDLIBS Kernel Geometry API )
 
 # Add a target for all GUI tests
-add_custom_target ( GUITests ) 
+add_custom_target ( GUITests )
 add_dependencies ( check GUITests )
 # Collect all tests together
-add_custom_target ( AllTests ) 
+add_custom_target ( AllTests )
 add_dependencies ( AllTests FrameworkTests GUITests )
 
 add_subdirectory ( MantidQt )
@@ -171,12 +174,12 @@ add_subdirectory( Framework/PostInstall )
 set ( ENABLE_CPACK CACHE BOOL "Switch to enable CPack package generation")
 if ( ENABLE_CPACK )
     include ( CPackCommon )
-    
+
     # Mac package settings
     set ( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/Installers/WinInstaller/License.txt )
 
     IF ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
-      include ( CPackLinuxSetup )    
+      include ( CPackLinuxSetup )
       # let people know what is coming out the other end
       message ( STATUS " CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}" )
 
@@ -193,13 +196,13 @@ if ( ENABLE_CPACK )
       # scipy & matplotlib
       set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scipy,python-matplotlib" )
       set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},mxml,hdf,hdf5" )
-      
+
       if( ${UNIX_CODENAME} STREQUAL "Santiago" )
         # On RHEL6 we have to use an updated qscintilla to fix an auto complete bug
         set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla >= 2.4.6" )
         # On RHEL6 we are using SCL packages for Qt
         set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scl-utils,mantidlibs,mantidlibs-runtime,mantidlibs-qt,mantidlibs-qt-x11" )
-      else()  
+      else()
         set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla" )
       endif()
 
diff --git a/Code/Mantid/Framework/API/CMakeLists.txt b/Code/Mantid/Framework/API/CMakeLists.txt
index ce204b5457f322012f638dbb98ca46499893237c..c3d2cd82be3e567cdf15ca905d1ede3b74b0c0e1 100644
--- a/Code/Mantid/Framework/API/CMakeLists.txt
+++ b/Code/Mantid/Framework/API/CMakeLists.txt
@@ -49,6 +49,7 @@ set ( SRC_FILES
 	src/IFuncMinimizer.cpp
 	src/IFunction.cpp
 	src/IFunction1D.cpp
+	src/IFunction1DSpectrum.cpp
 	src/IFunctionMD.cpp
 	src/IFunctionMW.cpp
 	src/ILiveListener.cpp
@@ -192,6 +193,7 @@ set ( INC_FILES
 	inc/MantidAPI/IFuncMinimizer.h
 	inc/MantidAPI/IFunction.h
 	inc/MantidAPI/IFunction1D.h
+	inc/MantidAPI/IFunction1DSpectrum.h
 	inc/MantidAPI/IFunctionMD.h
 	inc/MantidAPI/IFunctionMW.h
 	inc/MantidAPI/IFunctionWithLocation.h
@@ -309,6 +311,7 @@ set ( TEST_FILES
 	FunctionTest.h
 	FunctionValuesTest.h
 	IEventListTest.h
+	IFunction1DSpectrumTest.h
 	IFunction1DTest.h
 	IFunctionMDTest.h
 	ILiveListenerTest.h
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/DeprecatedAlgorithm.h b/Code/Mantid/Framework/API/inc/MantidAPI/DeprecatedAlgorithm.h
index a6f9268043222ca4655431738ab98295198f1572..af0c452c23f54aaca20655d8da471adeb0a8e40b 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/DeprecatedAlgorithm.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/DeprecatedAlgorithm.h
@@ -44,11 +44,13 @@ public:
   virtual ~DeprecatedAlgorithm();
   const std::string deprecationMsg(const IAlgorithm *);
 public:
-  void useAlgorithm(const std::string &);
+  void useAlgorithm(const std::string &, const int version= -1);
   void deprecatedDate(const std::string &);
 private:
   /// The algorithm to use instead of this one.
   std::string m_replacementAlgorithm;
+  /// Replacement version, -1 indicates latest
+  int m_replacementVersion;
   /// The date that the algorithm was first deprecated.
   std::string m_deprecatdDate;
 };
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IFunction1DSpectrum.h b/Code/Mantid/Framework/API/inc/MantidAPI/IFunction1DSpectrum.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a5c58134d7c0e2cb7db0525a7f3d79d5d1377a3
--- /dev/null
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/IFunction1DSpectrum.h
@@ -0,0 +1,67 @@
+#ifndef MANTID_API_IFUNCTION1DSPECTRUM_H_
+#define MANTID_API_IFUNCTION1DSPECTRUM_H_
+
+#include "MantidAPI/DllConfig.h"
+
+#include "MantidAPI/IFunction.h"
+#include "MantidAPI/FunctionDomain1D.h"
+#include "MantidKernel/Logger.h"
+
+
+namespace Mantid
+{
+namespace API
+{
+
+/** IFunction1DSpectrum :
+
+    IFunction1DSpectrum is very similar to IFunction1D, it just builds on
+    FunctionDomain1DSpectrum, which is more specialized than FunctionDomain1D.
+
+      @author Michael Wedel, Paul Scherrer Institut - SINQ
+      @date 03/06/2014
+
+    Copyright © 2014 PSI-MSS
+
+    This file is part of Mantid.
+
+    Mantid 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.
+
+    Mantid 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.  If not, see <http://www.gnu.org/licenses/>.
+
+    File change history is stored at: <https://github.com/mantidproject/mantid>
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+  */
+class DLLExport IFunction1DSpectrum : public virtual IFunction
+{
+public:
+    virtual ~IFunction1DSpectrum() { }
+
+    virtual void function(const FunctionDomain &domain, FunctionValues &values) const;
+    virtual void functionDeriv(const FunctionDomain &domain, Jacobian &jacobian);
+
+    /// Provide a concrete function in an implementation that operates on a FunctionDomain1DSpectrum.
+    virtual void function1DSpectrum(const FunctionDomain1DSpectrum &domain, FunctionValues &values) const = 0;
+
+    /// Derivatives of the function. The base implementation calculates numerical derivatives.
+    virtual void functionDeriv1DSpectrum(const FunctionDomain1DSpectrum &domain, Jacobian &jacobian);
+
+protected:
+    static Kernel::Logger g_log;
+
+};
+
+
+} // namespace API
+} // namespace Mantid
+
+#endif  /* MANTID_API_IFUNCTION1DSPECTRUM_H_ */
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
index 6cdaf2a833ffbbc0d3126a5473c121ae48f6d4bf..fa7473cd1df5ef5151a9e1c81222f84d2f322d42 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
@@ -256,9 +256,13 @@ namespace Mantid
       typedef std::map<size_t,double> MaskList;
       const MaskList& maskedBins(const size_t& spectrumIndex) const;
 
+      // Methods handling the internal monitor workspace
+      void setMonitorWorkspace(const boost::shared_ptr<MatrixWorkspace>& monitorWS);
+      boost::shared_ptr<MatrixWorkspace> monitorWorkspace() const;
+
       void saveInstrumentNexus(::NeXus::File * file) const;
       void loadInstrumentNexus(::NeXus::File * file);
-       void saveSpectraMapNexus(::NeXus::File * file, const std::vector<int>& spec,
+      void saveSpectraMapNexus(::NeXus::File * file, const std::vector<int>& spec,
           const ::NeXus::NXcompression compression = ::NeXus::LZW) const;
 
       //=====================================================================================
@@ -292,14 +296,13 @@ namespace Mantid
       virtual std::vector<IMDIterator*> createIterators(size_t suggestedNumCores = 1,
           Mantid::Geometry::MDImplicitFunction * function = NULL) const;
 
-       /// Apply masking.
-       void setMDMasking(Mantid::Geometry::MDImplicitFunction* maskingRegion);
-
-       /// Clear exsting masking.
-       void clearMDMasking();
+      /// Apply masking.
+      void setMDMasking(Mantid::Geometry::MDImplicitFunction* maskingRegion);
+      /// Clear exsting masking.
+      void clearMDMasking();
 
-       /// @return the special coordinate system used if any.
-       virtual Mantid::API::SpecialCoordinateSystem getSpecialCoordinateSystem() const;
+      /// @return the special coordinate system used if any.
+      virtual Mantid::API::SpecialCoordinateSystem getSpecialCoordinateSystem() const;
 
       //=====================================================================================
       // End IMDWorkspace methods
@@ -332,6 +335,9 @@ namespace Mantid
       /// The set of masked bins in a map keyed on spectrum index
       std::map< int64_t, MaskList > m_masks;
 
+      /// A workspace holding monitor data relating to the main data in the containing workspace (null if none).
+      boost::shared_ptr<MatrixWorkspace> m_monitorWorkspace;
+
     protected:
       /// Assists conversions to and from 2D histogram indexing to 1D indexing.
       MatrixWSIndexCalculator m_indexCalculator;
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceHistory.h b/Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceHistory.h
index 5ea3b959a05cb82192828be1f20a264fb95ff8a9..22a1b3d254510f25918e2c7533990f0f3f29d4c7 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceHistory.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/WorkspaceHistory.h
@@ -70,6 +70,8 @@ public:
   size_t size() const;
   /// Is the history empty
   bool empty() const;
+  /// remove all algorithm history objects from the workspace history
+  void clearHistory();
   /// Retrieve an algorithm history by index
   AlgorithmHistory_const_sptr getAlgorithmHistory(const size_t index) const;
   /// Add operator[] access
diff --git a/Code/Mantid/Framework/API/src/DeprecatedAlgorithm.cpp b/Code/Mantid/Framework/API/src/DeprecatedAlgorithm.cpp
index d5f98885b552b994818cdff90c809503a2127b24..cd33d9374a3bd0afc49b5fc7c693aea7bf234c7d 100644
--- a/Code/Mantid/Framework/API/src/DeprecatedAlgorithm.cpp
+++ b/Code/Mantid/Framework/API/src/DeprecatedAlgorithm.cpp
@@ -1,15 +1,24 @@
 #include "MantidAPI/DeprecatedAlgorithm.h"
+#include "MantidAPI/AlgorithmFactory.h"
 #include "MantidKernel/DateAndTime.h"
+#include "MantidKernel/Logger.h"
 #include <sstream>
 
 namespace Mantid
 {
 namespace API
 {
+  namespace
+  {
+    /// Static logger
+    Kernel::Logger g_log("DeprecatedAlgorithm");
+  }
+
   /// Does nothing other than make the compiler happy.
-  DeprecatedAlgorithm::DeprecatedAlgorithm()
+  DeprecatedAlgorithm::DeprecatedAlgorithm() :
+    m_replacementAlgorithm(), m_replacementVersion(-1),
+    m_deprecatdDate()
   {
-    this->m_replacementAlgorithm = "";
   }
 
   /// Does nothing other than make the compiler happy.
@@ -17,12 +26,18 @@ namespace API
   {}
 
   /// The algorithm to use instead of this one.
-  void DeprecatedAlgorithm::useAlgorithm(const std::string & replacement)
+  /// @param replacement Name of the algorithm that replaces the deprecated one
+  /// @param version An optional version number for the replacement (default=-1)
+  void DeprecatedAlgorithm::useAlgorithm(const std::string & replacement, const int version)
   {
+    // Replacement is not checked here as we cannot guarantee all algorithms have been
+    // registered when we are called. It is checked when the message is about to be printed
     if (!replacement.empty())
       this->m_replacementAlgorithm = replacement;
     else
       this->m_replacementAlgorithm = "";
+
+    m_replacementVersion = version;
   }
 
   /// The date the algorithm was deprecated on
@@ -58,7 +73,19 @@ namespace API
     }
     else
     {
-      msg << ". Use " << this->m_replacementAlgorithm << " instead.";
+      // sanity check
+      if(!AlgorithmFactory::Instance().exists(this->m_replacementAlgorithm,  this->m_replacementVersion))
+      {
+        std::ostringstream msg;
+        msg << "Invalid replacement algorithm '" + this->m_replacementAlgorithm + "'";
+        if(this->m_replacementVersion > 0) msg << " version " << this->m_replacementVersion << "\n";
+        msg << "Replacement algorithm not registered.";
+        g_log.warning(msg.str());
+      }
+
+      msg << ". Use " << this->m_replacementAlgorithm;
+      if (this->m_replacementVersion > 0) msg << " version " << this->m_replacementVersion;
+      msg << " instead.";
     }
 
     return msg.str();
diff --git a/Code/Mantid/Framework/API/src/FileFinder.cpp b/Code/Mantid/Framework/API/src/FileFinder.cpp
index 5d46edb8ac51d450248c91be7f6865164c823efc..1fecc3a2f209c38d134a6340306b01b8fb8f512a 100644
--- a/Code/Mantid/Framework/API/src/FileFinder.cpp
+++ b/Code/Mantid/Framework/API/src/FileFinder.cpp
@@ -206,6 +206,15 @@ namespace Mantid
         {
           instrName = "PG3";
         }
+        // We're extending this nasty hack to accomodate data archive searching for SANS2D.
+        // While this certainly shouldn't be considered good practice, #7515 exists to
+        // completely redesign FileFinder -- this quick fix will have to do until all this
+        // code gets an overhaul as part of that ticket.  Please think twice before adding
+        // any more instruments to this list.
+        else if ((instrName.find("SANS2D") == 0) || (instrName.find("sans2d") == 0))
+        {
+          instrName = "SANS2D";
+        }
         else
         {
           // go forwards looking for the run number to start
@@ -269,6 +278,12 @@ namespace Mantid
             instrPart = "PG3";
             nChars = instrPart.length();
         }
+        // Another nasty check for SANS2D.  Will do until FileFinder redesign.
+        else if (boost::algorithm::istarts_with(hint, "SANS2D"))
+        {
+            instrPart = "SANS2D";
+            nChars = instrPart.length();
+        }
         else
         {
             instrPart = hint.substr(0, nChars);
diff --git a/Code/Mantid/Framework/API/src/IFunction1DSpectrum.cpp b/Code/Mantid/Framework/API/src/IFunction1DSpectrum.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d35c73147a966f376823831e48552c56dd671a98
--- /dev/null
+++ b/Code/Mantid/Framework/API/src/IFunction1DSpectrum.cpp
@@ -0,0 +1,37 @@
+#include "MantidAPI/IFunction1DSpectrum.h"
+
+namespace Mantid
+{
+namespace API
+{
+
+Kernel::Logger IFunction1DSpectrum::g_log("IFunction1DSpectrum");
+
+void IFunction1DSpectrum::function(const FunctionDomain &domain, FunctionValues &values) const
+{
+    try {
+        const FunctionDomain1DSpectrum &spectrumDomain = dynamic_cast<const FunctionDomain1DSpectrum &>(domain);
+        function1DSpectrum(spectrumDomain, values);
+    } catch(std::bad_cast) {
+        throw std::invalid_argument("Provided domain is not of type FunctionDomain1DSpectrum.");
+    }
+}
+
+void IFunction1DSpectrum::functionDeriv(const FunctionDomain &domain, Jacobian &jacobian)
+{
+    try {
+        const FunctionDomain1DSpectrum &spectrumDomain = dynamic_cast<const FunctionDomain1DSpectrum &>(domain);
+        functionDeriv1DSpectrum(spectrumDomain, jacobian);
+    } catch(std::bad_cast) {
+        throw std::invalid_argument("Provided domain is not of type FunctionDomain1DSpectrum.");
+    }
+}
+
+void IFunction1DSpectrum::functionDeriv1DSpectrum(const FunctionDomain1DSpectrum &domain, Jacobian &jacobian)
+{
+    calNumericalDeriv(domain, jacobian);
+}
+
+
+} // namespace API
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
index bba9de1684e2dd7f614fb6a4e3ea201f1462c763..83e91c844712b3eaabd45878a5f55efc5f760c9e 100644
--- a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
+++ b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
@@ -1060,6 +1060,25 @@ namespace Mantid
       return it->second;
     }
 
+    /** Sets the internal monitor workspace to the provided workspace.
+     *  This method is intended for use by data-loading algorithms.
+     *  Note that no checking is performed as to whether this workspace actually contains data
+     *  pertaining to monitors, or that the spectra point to Detector objects marked as monitors.
+     *  It simply has to be of the correct type to be accepted.
+     *  @param monitorWS The workspace containing the monitor data.
+     */
+    void MatrixWorkspace::setMonitorWorkspace(const boost::shared_ptr<MatrixWorkspace>& monitorWS)
+    {
+      m_monitorWorkspace = monitorWS;
+    }
+
+    /** Returns a pointer to the internal monitor workspace.
+     */
+    boost::shared_ptr<MatrixWorkspace> MatrixWorkspace::monitorWorkspace() const
+    {
+      return m_monitorWorkspace;
+    }
+
     //---------------------------------------------------------------------------------------------
     /** Return memory used by the workspace, in bytes.
      * @return bytes used.
diff --git a/Code/Mantid/Framework/API/src/WorkspaceHistory.cpp b/Code/Mantid/Framework/API/src/WorkspaceHistory.cpp
index 8e44c3acf3e88a5ae1153709a2039601a47b1f17..9268c195dbde7846969d5112ff8e0e78eaba5559 100644
--- a/Code/Mantid/Framework/API/src/WorkspaceHistory.cpp
+++ b/Code/Mantid/Framework/API/src/WorkspaceHistory.cpp
@@ -88,6 +88,14 @@ bool WorkspaceHistory::empty() const
   return m_algorithms.empty();
 }
 
+/**
+ * Empty the list of algorithm history objects.
+ */
+void WorkspaceHistory::clearHistory()
+{
+  m_algorithms.clear();
+}
+
 /**
  * Retrieve an algorithm history by index
  * @param index ::  An index within the workspace history
diff --git a/Code/Mantid/Framework/API/test/FileFinderTest.h b/Code/Mantid/Framework/API/test/FileFinderTest.h
index 773ca334b6304e5056e198598cd21748d7f932ca..728a394221e0cf46f454f88625f67f53a133562b 100644
--- a/Code/Mantid/Framework/API/test/FileFinderTest.h
+++ b/Code/Mantid/Framework/API/test/FileFinderTest.h
@@ -63,6 +63,10 @@ public:
       "      <zeropadding size=\"8\"/>"
       "      <technique>Reflectometer</technique>"
       "    </instrument>"
+      "    <instrument name=\"SANS2D\">"
+      "      <zeropadding size=\"8\"/>"
+      "      <technique>Small Angle Scattering</technique>"
+      "    </instrument>"
       "  </facility>"
       "  <facility name=\"SNS\" delimiter=\"_\" FileExtensions=\"_event.nxs,.nxs,.dat\">"
       "    <archive>"
@@ -175,6 +179,7 @@ public:
     TS_ASSERT_EQUALS(FileFinder::Instance().getInstrument("REF_L_1234.nxs.h5").name(), "REF_L");
     TS_ASSERT_EQUALS(FileFinder::Instance().getInstrument("LOQ16613.n001").name(), "LOQ");
     TS_ASSERT_EQUALS(FileFinder::Instance().getInstrument("LOQ16613.s01").name(), "LOQ");
+    TS_ASSERT_EQUALS(FileFinder::Instance().getInstrument("SANS2D00032676.nxs").name(), "SANS2D");
   }
 
   void testGetExtension()
diff --git a/Code/Mantid/Framework/API/test/IFunction1DSpectrumTest.h b/Code/Mantid/Framework/API/test/IFunction1DSpectrumTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4dc963415aaccdf05d386aa25613526ecd74f85
--- /dev/null
+++ b/Code/Mantid/Framework/API/test/IFunction1DSpectrumTest.h
@@ -0,0 +1,79 @@
+#ifndef MANTID_API_IFUNCTION1DSPECTRUMTEST_H_
+#define MANTID_API_IFUNCTION1DSPECTRUMTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidAPI/IFunction1DSpectrum.h"
+#include "MantidAPI/ParamFunction.h"
+
+using namespace Mantid::API;
+
+class IFunction1DSpectrumTest : public CxxTest::TestSuite
+{
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static IFunction1DSpectrumTest *createSuite() { return new IFunction1DSpectrumTest(); }
+  static void destroySuite( IFunction1DSpectrumTest *suite ) { delete suite; }
+
+
+  void testConstruction()
+  {
+      TS_ASSERT_THROWS_NOTHING(ConcreteFunction1DSpectrum function1DSpectrum);
+  }
+
+  void testFunctionCorrectDomain()
+  {
+      std::vector<double> xValues;
+      xValues.push_back(1.0);
+      xValues.push_back(2.0);
+      xValues.push_back(3.0);
+      xValues.push_back(4.0);
+      xValues.push_back(5.0);
+
+      FunctionDomain1DSpectrum domain(0, xValues);
+      FunctionValues values(domain);
+
+      IFunction_sptr fun(new ConcreteFunction1DSpectrum);
+
+      TS_ASSERT_THROWS_NOTHING(fun->function(domain, values));
+
+      TS_ASSERT_EQUALS(values[0], 1.0);
+      TS_ASSERT_EQUALS(values[1], 2.0);
+  }
+
+  void testFunctionIncorrectDomain()
+  {
+      std::vector<double> xValues;
+      xValues.push_back(1.0);
+      xValues.push_back(2.0);
+      xValues.push_back(3.0);
+      xValues.push_back(4.0);
+      xValues.push_back(5.0);
+
+      FunctionDomain1DVector domain(xValues);
+      FunctionValues values(domain);
+
+      IFunction_sptr fun(new ConcreteFunction1DSpectrum);
+
+      TS_ASSERT_THROWS(fun->function(domain, values), std::invalid_argument);
+  }
+
+private:
+  class ConcreteFunction1DSpectrum : public virtual ParamFunction, public virtual IFunction1DSpectrum
+  {
+      friend class IFunction1DSpectrumTest;
+  public:
+      std::string name() const { return "ConcreteFunction1DSpectrum"; }
+
+      void function1DSpectrum(const FunctionDomain1DSpectrum &domain, FunctionValues &values) const
+      {
+          for(size_t i = 0; i < domain.size(); ++i) {
+              values.addToCalculated(i, domain[i]);
+          }
+      }
+  };
+};
+
+
+#endif /* MANTID_API_IFUNCTION1DSPECTRUMTEST_H_ */
diff --git a/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h b/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h
index 0fee2b67d7aa659ec2b13909a49fc02437126ada..e7bbb7f5a1bd0e09405487249509a4089ddc4626 100644
--- a/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h
+++ b/Code/Mantid/Framework/API/test/MatrixWorkspaceTest.h
@@ -787,6 +787,19 @@ public:
     TS_ASSERT_EQUALS(ws->getXMax(), 1.0);
   }
 
+  void test_monitorWorkspace()
+  {
+    auto ws = boost::make_shared<WorkspaceTester>();
+    TSM_ASSERT( "There should be no monitor workspace by default", ! ws->monitorWorkspace() )
+
+    auto ws2 = boost::make_shared<WorkspaceTester>();
+    ws->setMonitorWorkspace(ws2);
+    TSM_ASSERT_EQUALS( "Monitor workspace not successfully set", ws->monitorWorkspace(), ws2 )
+
+    ws->setMonitorWorkspace(boost::shared_ptr<MatrixWorkspace>());
+    TSM_ASSERT( "Monitor workspace not successfully reset", ! ws->monitorWorkspace() )
+  }
+
 private:
   boost::shared_ptr<MatrixWorkspace> ws;
 
diff --git a/Code/Mantid/Framework/API/test/WorkspaceFactoryTest.h b/Code/Mantid/Framework/API/test/WorkspaceFactoryTest.h
index 67fc8db0583658d9804a80984d5ad6421b32959f..65f905da64bf78a0c9fca3c9405423bb5071f81e 100644
--- a/Code/Mantid/Framework/API/test/WorkspaceFactoryTest.h
+++ b/Code/Mantid/Framework/API/test/WorkspaceFactoryTest.h
@@ -75,6 +75,8 @@ public:
     ws_child->mutableRun().addProperty("Ei", 12.0);
     ws_child->mutableSample().setName("MySample");
 
+    ws_child->setMonitorWorkspace(boost::make_shared<Workspace1DTest>());
+
     MatrixWorkspace_sptr child;
     TS_ASSERT_THROWS_NOTHING( child = WorkspaceFactory::Instance().create(ws_child) );
     TS_ASSERT_EQUALS( child->id(), "Workspace1DTest");
@@ -102,7 +104,9 @@ public:
     TS_ASSERT_EQUALS("MySample", ws_child->sample().getName());
     TS_ASSERT_EQUALS("MySampleChild", child->sample().getName());
    
-                             
+    // Monitor workspace
+    TSM_ASSERT( "The workspace factory should not propagate a monitor workspace", ! child->monitorWorkspace() );
+
     MatrixWorkspace_sptr ws2D(new Workspace2DTest);
     ws2D->initialize(3,1,1);
     MatrixWorkspace_sptr child2;
diff --git a/Code/Mantid/Framework/Algorithms/CMakeLists.txt b/Code/Mantid/Framework/Algorithms/CMakeLists.txt
index b196c7f67f8281634eed8719a7ea30973abb79ad..2feed294c8fcdd69b4df38f49b7a74584fd1998e 100644
--- a/Code/Mantid/Framework/Algorithms/CMakeLists.txt
+++ b/Code/Mantid/Framework/Algorithms/CMakeLists.txt
@@ -35,6 +35,7 @@ set ( SRC_FILES
 	src/CommutativeBinaryOperation.cpp
 	src/ConjoinWorkspaces.cpp
 	src/ConvertAxisByFormula.cpp
+	src/ConvertEmptyToTof.cpp
 	src/ConvertFromDistribution.cpp
 	src/ConvertMDHistoToMatrixWorkspace.cpp
 	src/ConvertSpectrumAxis.cpp
@@ -181,6 +182,7 @@ set ( SRC_FILES
 	src/RemoveExpDecay.cpp
 	src/RemoveLowResTOF.cpp
 	src/RemovePromptPulse.cpp
+	src/RemoveWorkspaceHistory.cpp
 	src/RenameWorkspace.cpp
 	src/RenameWorkspaces.cpp
 	src/ReplaceSpecialValues.cpp
@@ -269,6 +271,7 @@ set ( INC_FILES
 	inc/MantidAlgorithms/CommutativeBinaryOperation.h
 	inc/MantidAlgorithms/ConjoinWorkspaces.h
 	inc/MantidAlgorithms/ConvertAxisByFormula.h
+	inc/MantidAlgorithms/ConvertEmptyToTof.h
 	inc/MantidAlgorithms/ConvertFromDistribution.h
 	inc/MantidAlgorithms/ConvertMDHistoToMatrixWorkspace.h
 	inc/MantidAlgorithms/ConvertSpectrumAxis.h
@@ -416,6 +419,7 @@ set ( INC_FILES
 	inc/MantidAlgorithms/RemoveExpDecay.h
 	inc/MantidAlgorithms/RemoveLowResTOF.h
 	inc/MantidAlgorithms/RemovePromptPulse.h
+	inc/MantidAlgorithms/RemoveWorkspaceHistory.h
 	inc/MantidAlgorithms/RenameWorkspace.h
 	inc/MantidAlgorithms/RenameWorkspaces.h
 	inc/MantidAlgorithms/ReplaceSpecialValues.h
@@ -515,6 +519,7 @@ set ( TEST_FILES
 	CommutativeBinaryOperationTest.h
 	ConjoinWorkspacesTest.h
 	ConvertAxisByFormulaTest.h
+	ConvertEmptyToTofTest.h
 	ConvertFromDistributionTest.h
 	ConvertMDHistoToMatrixWorkspaceTest.h
 	ConvertSpectrumAxis2Test.h
@@ -644,6 +649,7 @@ set ( TEST_FILES
 	RemoveExpDecayTest.h
 	RemoveLowResTOFTest.h
 	RemovePromptPulseTest.h
+	RemoveWorkspaceHistoryTest.h
 	RenameWorkspaceTest.h
 	RenameWorkspacesTest.h
 	ReplaceSpecialValuesTest.h
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ConvertEmptyToTof.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ConvertEmptyToTof.h
new file mode 100644
index 0000000000000000000000000000000000000000..b7cec6620df97cc397027238f3b1c7a8a677378a
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ConvertEmptyToTof.h
@@ -0,0 +1,85 @@
+#ifndef MANTID_ALGORITHMS_CONVERTEMPTYTOTOF_H_
+#define MANTID_ALGORITHMS_CONVERTEMPTYTOTOF_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/Algorithm.h"
+#include "MantidDataObjects/Workspace2D.h"
+#include "MantidAPI/MatrixWorkspace.h"
+
+#include <utility>      // std::pair
+
+namespace Mantid {
+namespace Algorithms {
+
+/** ConvertEmptyToTof :
+
+ At the ILL the data is loaded in raw format : no units used. The X-axis represent the time channel number.
+ This algorithm converts the channel number to time of flight
+
+ Copyright &copy; 2014 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
+
+ This file is part of Mantid.
+
+ Mantid 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.
+
+ Mantid 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.  If not, see <http://www.gnu.org/licenses/>.
+
+ File change history is stored at: <https://github.com/mantidproject/mantid>
+ Code Documentation is available at: <http://doxygen.mantidproject.org>
+ */
+class DLLExport ConvertEmptyToTof: public API::Algorithm {
+public:
+  ConvertEmptyToTof();
+  virtual ~ConvertEmptyToTof();
+
+  virtual const std::string name() const;
+  virtual int version() const;
+  virtual const std::string category() const;
+  ///Summary of algorithms purpose
+  virtual const std::string summary() const {
+    return "Converts the channel number to time of flight.";
+  }
+
+private:
+  void init();
+  void exec();
+
+  void validateSpectraIndices(std::vector<int> &v);
+  void validateChannelIndices(std::vector<int> &v);
+
+  std::map<int, int> findElasticPeakPositions(const std::vector<int> &,
+      const std::vector<int> &);
+
+  void estimateFWHM(const Mantid::MantidVec&, double&, double&, double&,
+      double&, double&);
+
+  bool doFitGaussianPeak(int, double&, double&, double&, double, double);
+  std::pair<int, double> findAverageEppAndEpTof(const std::map<int, int>&);
+
+  double getL1(API::MatrixWorkspace_const_sptr);
+  double getL2(API::MatrixWorkspace_const_sptr, int);
+  double calculateTOF(double, double);
+  bool areEqual(double, double, double);
+  template<typename T> T getPropertyFromRun(API::MatrixWorkspace_const_sptr,
+      const std::string&);
+  int roundUp(double);
+  std::vector<double> makeTofAxis(int, double, size_t, double);
+  void setTofInWS(const std::vector<double> &, API::MatrixWorkspace_sptr);
+
+  DataObjects::Workspace2D_sptr m_inputWS;
+  API::MatrixWorkspace_sptr m_outputWS;
+};
+
+} // namespace Algorithms
+} // namespace Mantid
+
+#endif  /* MANTID_ALGORITHMS_CONVERTEMPTYTOTOF_H_ */
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CorrectFlightPaths.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CorrectFlightPaths.h
index c963aca4dfa623ed2e9061815fa7a95c2c8e0b69..b40c15e3325ec5cfb9d2abfa377837a0a924d504 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CorrectFlightPaths.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CorrectFlightPaths.h
@@ -43,46 +43,49 @@ namespace Algorithms {
  */
 class DLLExport CorrectFlightPaths: public API::Algorithm {
 public:
-	/// Default constructor
-	CorrectFlightPaths();
-	/// Destructor
-	virtual ~CorrectFlightPaths() {
-	}
-	;
-	/// Algorithm's name for identification overriding a virtual method
-	virtual const std::string name() const { return "CorrectFlightPaths";	}
+  /// Default constructor
+  CorrectFlightPaths();
+  /// Destructor
+  virtual ~CorrectFlightPaths() {
+  }
+  ;
+  /// Algorithm's name for identification overriding a virtual method
+  virtual const std::string name() const {
+    return "CorrectFlightPaths";
+  }
   ///Summary of algorithms purpose
-  virtual const std::string summary() const {return "Used to correct flight paths in 2D shaped detectors.";}
-	/// Algorithm's version for identification overriding a virtual method
-	virtual int version() const {
-		return 1;
-	}
-	/// Algorithm's category for identification overriding a virtual method
-	virtual const std::string category() const {
-		return "Inelastic;CorrectionFunctions";
-	}
+  virtual const std::string summary() const {
+    return "Used to correct flight paths in 2D shaped detectors.";
+  }
+  /// Algorithm's version for identification overriding a virtual method
+  virtual int version() const {
+    return 1;
+  }
+  /// Algorithm's category for identification overriding a virtual method
+  virtual const std::string category() const {
+    return "Inelastic;CorrectionFunctions";
+  }
 
 private:
-	
-	// Overridden Algorithm methods
-	void init();
-	void exec();
-	void initWorkspaces();
-	double getRunProperty(std::string);
-	double getInstrumentProperty(std::string);
-	double calculateTOF(double);
-
-	/// The user selected (input) workspace
-	API::MatrixWorkspace_const_sptr m_inputWS;
-	/// The output workspace, maybe the same as the input one
-	API::MatrixWorkspace_sptr m_outputWS;
-
-
-	Geometry::Instrument_const_sptr m_instrument;
-	Geometry::IComponent_const_sptr m_sample;
-
-	double m_l2;
-	double m_wavelength;
+
+  // Overridden Algorithm methods
+  void init();
+  void exec();
+  void initWorkspaces();
+  double getRunProperty(std::string);
+  double getInstrumentProperty(std::string);
+  double calculateTOF(double);
+
+  /// The user selected (input) workspace
+  API::MatrixWorkspace_const_sptr m_inputWS;
+  /// The output workspace, maybe the same as the input one
+  API::MatrixWorkspace_sptr m_outputWS;
+
+  Geometry::Instrument_const_sptr m_instrument;
+  Geometry::IComponent_const_sptr m_sample;
+
+  double m_l2;
+  double m_wavelength;
 
 };
 
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateSingleValuedWorkspace.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateSingleValuedWorkspace.h
index e7b5c662c972b6bd8423bd04ba7ac780b8dd2e11..655fba1668388e87daab4bf0656ce930888fdf35 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateSingleValuedWorkspace.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateSingleValuedWorkspace.h
@@ -54,8 +54,8 @@ public:
   virtual ~CreateSingleValuedWorkspace() {}
   /// Algorithm's name
   virtual const std::string name() const { return "CreateSingleValuedWorkspace"; }
-    ///Summary of algorithms purpose
-    virtual const std::string summary() const {return "Creates a 2D workspace with a single value contained in it.";}
+  ///Summary of algorithms purpose
+  virtual const std::string summary() const {return "Creates a 2D workspace containing a single X, Y & E value.";}
 
   /// Algorithm's version
   virtual int version() const { return (1); }
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h
index 1109b72f90c985f372a81810722cec27031a20a8..e5e236ca55951bab58bff835fa227d8368bb731c 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h
@@ -176,7 +176,6 @@ private:
   bool m_highBackground; ///<flag for find relatively weak peak in high background
   bool m_rawPeaksTable; ///<flag for whether the output is the raw peak parameters or effective (centre, width, height)
   std::size_t m_numTableParams; //<Number of parameters in the output table workspace
-  // bool m_searchPeakPos; ///<flag to search for peak in the window
   std::string m_peakFuncType; //< The name of the peak function to fit
   std::string m_backgroundType; //< The type of background to fit
 
@@ -195,9 +194,6 @@ private:
   bool m_usePeakPositionTolerance;
   double m_peakPositionTolerance;
 
-  bool m_usePeakHeightTolerance;
-  double m_peakHeightTolerance;
-
   std::vector<API::IFunction_sptr> m_fitFunctions;
   std::vector<size_t> m_peakLeftIndexes;
   std::vector<size_t> m_peakRightIndexes;
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/InterpolatingRebin.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/InterpolatingRebin.h
index 48ea50a599b6269ae84e7c59d856621596ade8dc..ea6c64d43ad2f8244c0272d9e797ee92181d3ee1 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/InterpolatingRebin.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/InterpolatingRebin.h
@@ -5,7 +5,6 @@
 // Includes
 //----------------------------------------------------------------------
 #include "MantidAlgorithms/Rebin.h"
-#include "MantidDataObjects/Histogram1D.h"
 
 namespace Mantid
 {
@@ -59,17 +58,17 @@ namespace Algorithms
     File change history is stored at: <https://github.com/mantidproject/mantid>
     Code Documentation is available at: <http://doxygen.mantidproject.org>
  */
-class DLLExport InterpolatingRebin : public Algorithms::Rebin
+class DLLExport InterpolatingRebin : public Rebin
 {
 public:
   /// Default constructor
-  InterpolatingRebin() : Algorithms::Rebin() {};
+  InterpolatingRebin() : Rebin() {}
   /// Destructor
-  virtual ~InterpolatingRebin() {};
+  virtual ~InterpolatingRebin() {}
   /// Algorithm's name for identification overriding a virtual method
   virtual const std::string name() const { return "InterpolatingRebin";}
-    ///Summary of algorithms purpose
-    virtual const std::string summary() const {return "Creates a workspace with different x-value bin boundaries where the new y-values are estimated using cubic splines.";}
+  ///Summary of algorithms purpose
+  virtual const std::string summary() const {return "Creates a workspace with different x-value bin boundaries where the new y-values are estimated using cubic splines.";}
 
   /// Algorithm's version for identification overriding a virtual method
   virtual int version() const { return 1;}
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Rebin.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Rebin.h
index 0cc2cfc4a8b6a33f069378752ebcecf57ea218e5..57386d01a4a274510995a85b1b657c0497d4fe35 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Rebin.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Rebin.h
@@ -66,6 +66,10 @@ public:
   /// Algorithm's aliases
   virtual const std::string alias() const { return "rebin"; }
 
+  static std::vector<double> rebinParamsFromInput(const std::vector<double> & inParams,
+                                                  const API::MatrixWorkspace & inputWS,
+                                                  Kernel::Logger & logger);
+
 protected:
 
   const std::string workspaceMethodName() const { return "rebin"; }
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne.h
index 3e94ce1ece09373bf052c3a5ea940f8bbeb9b4b4..9c3400e6f1046b9c6a1d81019d762a02e7b572c2 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne.h
@@ -52,7 +52,7 @@ namespace Mantid
       virtual const std::string category() const;
 
       /// Convert to an IvsQ workspace. Performs detector positional corrections based on the component name and the theta value.
-      Mantid::API::MatrixWorkspace_sptr toIvsQ(API::MatrixWorkspace_sptr toConvert, const bool correctPosition,
+      Mantid::API::MatrixWorkspace_sptr toIvsQ(API::MatrixWorkspace_sptr& toConvert, const bool correctPosition,
            OptionalDouble& thetaInDeg, const bool isPointDetector);
 
     private:
@@ -71,8 +71,7 @@ namespace Mantid
       Mantid::Geometry::IComponent_const_sptr getDetectorComponent(Mantid::Geometry::Instrument_const_sptr inst, const bool isPointDetector);
 
       /// Correct detector positions.
-      void correctPosition(API::MatrixWorkspace_sptr toCorrect, const double& thetaInDeg,
-          Geometry::IComponent_const_sptr sample, Geometry::IComponent_const_sptr detector);
+      API::MatrixWorkspace_sptr correctPosition(API::MatrixWorkspace_sptr& toCorrect, const double& thetaInDeg, const bool isPointDetector);
 
       /// Sum spectra.
       Mantid::API::MatrixWorkspace_sptr sumSpectraOverRange(API::MatrixWorkspace_sptr inWS, const int startIndex, const int endIndex);
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/RemoveWorkspaceHistory.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/RemoveWorkspaceHistory.h
new file mode 100644
index 0000000000000000000000000000000000000000..18d3af1bca6c2cc4c3203799e126a3a8a3f858e1
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/RemoveWorkspaceHistory.h
@@ -0,0 +1,58 @@
+#ifndef MANTID_ALGORITHMS_REMOVEWORKSPACEHISTORY_H_
+#define MANTID_ALGORITHMS_REMOVEWORKSPACEHISTORY_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/Algorithm.h"
+
+namespace Mantid
+{
+namespace Algorithms
+{
+
+  /** RemoveWorkspaceHistory
+
+    Removes all algorithm history records from the workspace history attached to a workspace.
+    
+    Copyright &copy; 2014 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
+
+    This file is part of Mantid.
+
+    Mantid 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.
+
+    Mantid 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.  If not, see <http://www.gnu.org/licenses/>.
+
+    File change history is stored at: <https://github.com/mantidproject/mantid>
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+  */
+  class DLLExport RemoveWorkspaceHistory  : public API::Algorithm
+  {
+  public:
+    RemoveWorkspaceHistory();
+    virtual ~RemoveWorkspaceHistory();
+    
+    virtual const std::string name() const;
+    virtual const std::string summary() const;
+    virtual int version() const;
+    virtual const std::string category() const;
+
+  private:
+    void init();
+    void exec();
+
+
+  };
+
+
+} // namespace Algorithms
+} // namespace Mantid
+
+#endif  /* MANTID_ALGORITHMS_REMOVEWORKSPACEHISTORY_H_ */
\ No newline at end of file
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
index c64bfb664375565df06034aea9e6112c28f20c23..dd0dafb01debe9aa181282b4a222c9e416029de2 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
@@ -47,82 +47,35 @@ namespace Mantid
       virtual const std::string category() const {return "Reflectometry";}
       ///Summary of algorithm's purpose
       virtual const std::string summary() const {return "Stitches single histogram matrix workspaces together";}
-
+      /// Does the x-axis have non-zero errors
+      bool hasNonzeroErrors(Mantid::API::MatrixWorkspace_sptr ws);
     private:
       /// Overwrites Algorithm method.
       void init();
       /// Overwrites Algorithm method.
       void exec();
-      /**Gets the start of the overlapping region
-      @param intesectionMin :: The minimum possible value for the overlapping region to inhabit
-      @param intesectionMax :: The maximum possible value for the overlapping region to inhabit
-      @return a double contianing the start of the overlapping region
-      */
+      /// Get the start overlap
       double getStartOverlap(const double& intesectionMin, const double& intesectionMax) const;
-      /**Gets the end of the overlapping region
-      @param intesectionMin :: The minimum possible value for the overlapping region to inhabit
-      @param intesectionMax :: The maximum possible value for the overlapping region to inhabit
-      @return a double contianing the end of the overlapping region
-      */
+      /// Get the end overlap
       double getEndOverlap(const double& intesectionMin, const double& intesectionMax) const;
-      /**Determines if a workspace has non zero errors
-      @param ws :: The input workspace
-      @return True if there are any non-zero errors in the workspace
-      */
-      bool hasNonzeroErrors(Mantid::API::MatrixWorkspace_sptr& ws) const;
-      /**Gets the rebinning parameters and calculates any missing values
-      @param lhsWS :: The left hand side input workspace
-      @param rhsWS :: The right hand side input workspace
-      @return a vector<double> contianing the rebinning parameters
-      */
-      Mantid::MantidVec getRebinParams(Mantid::API::MatrixWorkspace_sptr& lhsWS, Mantid::API::MatrixWorkspace_sptr& rhsWS) const;
-      /**Runs the Rebin Algorithm as a child
-      @param input :: The input workspace
-      @param params :: a vector<double> containing rebinning parameters
-      @return A shared pointer to the resulting MatrixWorkspace
-      */
+
+      /// Get the rebin parameters
+      Mantid::MantidVec getRebinParams(Mantid::API::MatrixWorkspace_sptr& lhsWS, Mantid::API::MatrixWorkspace_sptr& rhsWS, const bool scaleRHSWS) const;
+      /// Perform rebin
       Mantid::API::MatrixWorkspace_sptr rebin(Mantid::API::MatrixWorkspace_sptr& input, const Mantid::MantidVec& params);
-      /**Runs the Integration Algorithm as a child
-      @param input :: The input workspace
-      @param start :: a double defining the start of the region to integrate
-      @param stop :: a double defining the end of the region to integrate
-      @return A shared pointer to the resulting MatrixWorkspace
-      */
+      /// Perform integration
       Mantid::API::MatrixWorkspace_sptr integration(Mantid::API::MatrixWorkspace_sptr& input, const double& start, const double& stop);
-      /**Runs the MultiplyRange Algorithm as a child defining an end bin
-      @param input :: The input workspace
-      @param startBin :: The first bin int eh range to multiply
-      @param endBin :: The last bin in the range to multiply
-      @param factor :: The multiplication factor
-      @return A shared pointer to the resulting MatrixWorkspace
-      */
+      /// Perform multiplication over a range
       Mantid::API::MatrixWorkspace_sptr multiplyRange(Mantid::API::MatrixWorkspace_sptr& input, const int& startBin, const int& endBin, const double& factor);
-      /**Runs the MultiplyRange Algorithm as a child
-      @param input :: The input workspace
-      @param startBin :: The first bin int eh range to multiply
-      @param factor :: The multiplication factor
-      @return A shared pointer to the resulting MatrixWorkspace
-      */
+      /// Perform multiplication over a range
       Mantid::API::MatrixWorkspace_sptr multiplyRange(Mantid::API::MatrixWorkspace_sptr& input, const int& startBin, const double& factor);
-      /**Runs the CreateSingleValuedWorkspace Algorithm as a child
-      @param val :: The double to convert to a single value workspace
-      @return A shared pointer to the resulting MatrixWorkspace
-      */
+      /// Create a single valued workspace
       Mantid::API::MatrixWorkspace_sptr singleValueWS(double val);
-      /**Runs the WeightedMean Algorithm as a child
-      @param inOne :: The first input workspace
-      @param inTwo :: The second input workspace
-      @return A shared pointer to the resulting MatrixWorkspace
-      */
+      /// Calclate the weighted mean
       Mantid::API::MatrixWorkspace_sptr weightedMean(Mantid::API::MatrixWorkspace_sptr& inOne, Mantid::API::MatrixWorkspace_sptr& inTwo);
-      /**finds the bins containing the ends of the overlappign region
-      @param startOverlap :: The start of the overlapping region
-      @param endOverlap :: The end of the overlapping region
-      @param workspace :: The workspace to determine the overlaps inside
-      @return a boost::tuple<int,int> containing the bin indexes of the overlaps
-      */
+      /// Find the start and end indexes
       boost::tuple<int,int> findStartEndIndexes(double startOverlap, double endOverlap, Mantid::API::MatrixWorkspace_sptr& workspace);
-      ///the range tollerence constant to apply to overlap values
+      /// Range tolerance
       static const double range_tolerance;
 
     };
diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertAxisByFormula.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertAxisByFormula.cpp
index 5337cfdf546acff60b8b5ff5764b4ee1f5c15b81..8b7c75ea1a8c0044df69c919ebe3189fb7347345 100644
--- a/Code/Mantid/Framework/Algorithms/src/ConvertAxisByFormula.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ConvertAxisByFormula.cpp
@@ -63,7 +63,7 @@ namespace Mantid
       axisOptions.push_back("X");
       axisOptions.push_back("Y");
       declareProperty("Axis","X",boost::make_shared<StringListValidator>(axisOptions),
-        "The axis to modify (default: X)");
+        "The axis to modify");
 
       declareProperty("Formula", "", "The formula to use to convert the values, x or y may be used to refer to the axis values");
       declareProperty("AxisTitle", "", "The label of he new axis. If not set then the title will not change.");
diff --git a/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp b/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9b32d115731c2e65201ae882cc5ca7c855ac9678
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/src/ConvertEmptyToTof.cpp
@@ -0,0 +1,536 @@
+//----------------------------------------------------------------------
+// Includes
+//----------------------------------------------------------------------
+#include "MantidAlgorithms/ConvertEmptyToTof.h"
+
+#include "MantidAPI/WorkspaceValidators.h"
+#include "MantidKernel/ArrayProperty.h"
+#include "MantidAPI/FunctionFactory.h"
+#include "MantidAPI/IPeakFunction.h"
+#include "MantidAPI/ConstraintFactory.h"
+#include "MantidKernel/UnitFactory.h"
+#include "MantidKernel/BoundedValidator.h"
+
+#include <cmath>
+#include <map>
+#include <numeric>      // std::accumulate
+#include <utility>      // std::pair
+
+namespace Mantid {
+namespace Algorithms {
+
+using namespace Kernel;
+using namespace API;
+
+// Register the algorithm into the AlgorithmFactory
+DECLARE_ALGORITHM(ConvertEmptyToTof)
+
+//----------------------------------------------------------------------------------------------
+/** Constructor
+ */
+ConvertEmptyToTof::ConvertEmptyToTof() {
+
+}
+
+//----------------------------------------------------------------------------------------------
+/** Destructor
+ */
+ConvertEmptyToTof::~ConvertEmptyToTof() {
+}
+
+//----------------------------------------------------------------------------------------------
+/// Algorithm's name for identification. @see Algorithm::name
+const std::string ConvertEmptyToTof::name() const {
+  return "ConvertEmptyToTof";
+}
+;
+
+/// Algorithm's version for identification. @see Algorithm::version
+int ConvertEmptyToTof::version() const {
+  return 1;
+}
+;
+
+/// Algorithm's category for identification. @see Algorithm::category
+const std::string ConvertEmptyToTof::category() const {
+  return "Transforms\\Units";
+}
+
+
+//----------------------------------------------------------------------------------------------
+/** Initialize the algorithm's properties.
+ */
+void ConvertEmptyToTof::init() {
+
+  auto wsValidator = boost::make_shared<CompositeValidator>();
+  wsValidator->add<WorkspaceUnitValidator>("Empty");
+  declareProperty(
+      new WorkspaceProperty<DataObjects::Workspace2D>("InputWorkspace", "",
+          Direction::Input, wsValidator), "Name of the input workspace");
+  declareProperty(
+      new WorkspaceProperty<API::MatrixWorkspace>("OutputWorkspace", "",
+          Direction::Output),
+      "Name of the output workspace, can be the same as the input");
+  declareProperty(new Kernel::ArrayProperty<int>("ListOfSpectraIndices"),
+      "A list of spectra indices as a string with ranges; e.g. 5-10,15,20-23. \n"
+          "Optional: if not specified, then the Start/EndIndex fields are used alone. "
+          "If specified, the range and the list are combined (without duplicating indices). For example, a range of 10 to 20 and a list '12,15,26,28' gives '10-20,26,28'.");
+
+  declareProperty(new Kernel::ArrayProperty<int>("ListOfChannelIndices"),
+      "A list of spectra indices as a string with ranges; e.g. 5-10,15,20-23. \n"
+          "Optional: if not specified, then the Start/EndIndex fields are used alone. "
+          "If specified, the range and the list are combined (without duplicating indices). For example, a range of 10 to 20 and a list '12,15,26,28' gives '10-20,26,28'.");
+
+  // OR Specify EPP
+  auto mustBePositive = boost::make_shared<BoundedValidator<int> >();
+  mustBePositive->setLower(0);
+  declareProperty("ElasticPeakPosition", EMPTY_INT(), mustBePositive,
+      "Value of elastic peak position if none of the above are filled in.");
+  declareProperty("ElasticPeakPositionSpectrum", EMPTY_INT(), mustBePositive,
+      "Spectrum index used for elastic peak position above.");
+
+}
+
+//----------------------------------------------------------------------------------------------
+/** Execute the algorithm.
+ */
+void ConvertEmptyToTof::exec() {
+
+  m_inputWS = this->getProperty("InputWorkspace");
+  m_outputWS = this->getProperty("OutputWorkspace");
+  std::vector<int> spectraIndices = getProperty("ListOfSpectraIndices");
+  std::vector<int> channelIndices = getProperty("ListOfChannelIndices");
+  int epp = getProperty("ElasticPeakPosition");
+  int eppSpectrum = getProperty("ElasticPeakPositionSpectrum");
+
+
+  std::vector<double> tofAxis;
+  double channelWidth = getPropertyFromRun<double>(m_inputWS,"channel_width");
+
+  // If the ElasticPeakPosition and the ElasticPeakPositionSpectrum were specified
+  if (epp != EMPTY_INT() && eppSpectrum != EMPTY_INT()) {
+    g_log.information(
+        "Using the specified ElasticPeakPosition and ElasticPeakPositionSpectrum");
+
+    double wavelength = getPropertyFromRun<double>(m_inputWS, "wavelength");
+    double l1 = getL1(m_inputWS);
+    double l2 = getL2(m_inputWS, eppSpectrum);
+    double epTof = (calculateTOF(l1, wavelength) + calculateTOF(l2, wavelength)) * 1e6; //microsecs
+
+    tofAxis = makeTofAxis(epp, epTof,m_inputWS->blocksize() + 1, channelWidth);
+
+  }
+  // If the spectraIndices and channelIndices were specified
+  else {
+
+    //validations
+    validateSpectraIndices(spectraIndices);
+    validateChannelIndices(channelIndices);
+
+    //Map of spectra index, epp
+    std::map<int, int> eppMap = findElasticPeakPositions(spectraIndices,
+        channelIndices);
+
+    for (auto it = eppMap.begin(); it != eppMap.end(); ++it) {
+      g_log.debug() << "Spectra idx =" << it->first << ", epp=" << it->second
+          << std::endl;
+    }
+
+    std::pair<int, double> eppAndEpTof = findAverageEppAndEpTof(eppMap);
+
+    tofAxis = makeTofAxis(eppAndEpTof.first, eppAndEpTof.second,
+        m_inputWS->blocksize() + 1, channelWidth);
+  }
+
+  // If input and output workspaces are not the same, create a new workspace for the output
+  if (m_outputWS != m_inputWS) {
+    m_outputWS = API::WorkspaceFactory::Instance().create(m_inputWS);
+  }
+
+  setTofInWS(tofAxis, m_outputWS);
+
+  setProperty("OutputWorkspace", m_outputWS);
+
+}
+
+/**
+ * Check if spectra indices are in the limits of the number of histograms
+ * in the input workspace. If v is empty, uses all spectra.
+ * @param v :: vector with the spectra indices
+ */
+void ConvertEmptyToTof::validateSpectraIndices(std::vector<int> &v) {
+  auto nHist = m_inputWS->getNumberHistograms();
+  if (v.size() == 0) {
+    g_log.information(
+        "No spectrum index given. Using all spectra to calculate the elastic peak.");
+    // use all spectra indices
+    v.reserve(nHist);
+    for (unsigned int i = 0; i < nHist; ++i)
+      v[i] = i;
+  } else {
+    for (auto it = v.begin(); it != v.end(); ++it) {
+      if (*it < 0 || static_cast<size_t>(*it) >= nHist) {
+        throw std::runtime_error(
+            "Spectra index out of limits: "
+                + boost::lexical_cast<std::string>(*it));
+      }
+    }
+  }
+}
+
+/**
+ * Check if the channel indices are in the limits of the number of the block size
+ * in the input workspace. If v is empty, uses all channels.
+ * @param v :: vector with the channel indices to use
+ */
+void ConvertEmptyToTof::validateChannelIndices(std::vector<int> &v) {
+  auto blockSize = m_inputWS->blocksize() + 1;
+  if (v.size() == 0) {
+    g_log.information(
+        "No channel index given. Using all channels (full spectrum!) to calculate the elastic peak.");
+    // use all channel indices
+    v.reserve(blockSize);
+    for (unsigned int i = 0; i < blockSize; ++i)
+      v[i] = i;
+  } else {
+    for (auto it = v.begin(); it != v.end(); ++it) {
+      if (*it < 0 || static_cast<size_t>(*it) >= blockSize) {
+        throw std::runtime_error(
+            "Channel index out of limits: "
+                + boost::lexical_cast<std::string>(*it));
+      }
+    }
+  }
+}
+
+/**
+ * Looks for the EPP positions in the spectraIndices
+ * @return map with worskpace spectra index, elastic peak position for this spectra
+ */
+std::map<int, int> ConvertEmptyToTof::findElasticPeakPositions(
+    const std::vector<int> &spectraIndices,
+    const std::vector<int> &channelIndices) {
+
+  std::map<int, int> eppMap;
+
+  // make sure we not looking for channel indices outside the bounds
+  assert(
+      static_cast<size_t>(*(channelIndices.end() - 1))
+          < m_inputWS->blocksize() + 1);
+
+  g_log.information() << "Peak detection, search for peak " << std::endl;
+
+  for (auto it = spectraIndices.begin(); it != spectraIndices.end(); ++it) {
+
+    int spectrumIndex = *it;
+    const Mantid::MantidVec& thisSpecY = m_inputWS->dataY(spectrumIndex);
+
+    int minChannelIndex = *(channelIndices.begin());
+    int maxChannelIndex = *(channelIndices.end() - 1);
+
+    double center, sigma, height, minX, maxX;
+    minX = static_cast<double>(minChannelIndex);
+    maxX = static_cast<double>(maxChannelIndex);
+    estimateFWHM(thisSpecY, center, sigma, height, minX, maxX);
+
+    g_log.debug() << "Peak estimate :: center=" << center << "\t sigma="
+        << sigma << "\t height=" << height << "\t minX=" << minX << "\t maxX="
+        << maxX << std::endl;
+
+    bool doFit = doFitGaussianPeak(spectrumIndex, center, sigma, height, minX,
+        maxX);
+    if (!doFit) {
+      g_log.error() << "doFitGaussianPeak failed..." << std::endl;
+      throw std::runtime_error("Gaussin Peak Fit failed....");
+    }
+
+    g_log.debug() << "Peak Fitting :: center=" << center << "\t sigma=" << sigma
+        << "\t height=" << height << "\t minX=" << minX << "\t maxX=" << maxX
+        << std::endl;
+
+    // round up the center to the closest int
+    eppMap[spectrumIndex] = roundUp(center);
+
+  }
+  return eppMap;
+
+}
+
+/**
+ * Estimated the FWHM for Gaussian peak fitting
+ *
+ */
+void ConvertEmptyToTof::estimateFWHM(const Mantid::MantidVec& spec,
+    double& center, double& sigma, double& height, double& minX, double& maxX) {
+
+  auto maxValueIt = std::max_element(spec.begin() + static_cast<size_t>(minX),
+      spec.begin() + static_cast<size_t>(maxX)); // max value
+  double maxValue = *maxValueIt;
+  size_t maxIndex = std::distance(spec.begin(), maxValueIt); // index of max value
+
+  //indices and values for the fwhm detection
+  size_t minFwhmIndex = maxIndex;
+  size_t maxFwhmIndex = maxIndex;
+  double minFwhmValue = maxValue;
+  double maxFwhmValue = maxValue;
+  // fwhm detection
+  for (; minFwhmValue > 0.5 * maxValue; minFwhmIndex--, minFwhmValue =
+      spec[minFwhmIndex]) {
+  }
+  for (; maxFwhmValue > 0.5 * maxValue; maxFwhmIndex++, maxFwhmValue =
+      spec[maxFwhmIndex]) {
+  }
+  //double fwhm = thisSpecX[maxFwhmIndex] - thisSpecX[minFwhmIndex + 1];
+  double fwhm = static_cast<double>(maxFwhmIndex - minFwhmIndex + 1);
+
+  //parameters for the gaussian peak fit
+  center = static_cast<double>(maxIndex);
+  sigma = fwhm;
+  height = maxValue;
+
+  g_log.debug() << "Peak estimate  : center=" << center << "\t sigma=" << sigma
+      << "\t h=" << height << std::endl;
+
+  //determination of the range used for the peak definition
+  size_t ipeak_min = std::max(static_cast<size_t>(0),
+      maxIndex
+          - static_cast<size_t>(2.5
+              * static_cast<double>(maxIndex - maxFwhmIndex)));
+  size_t ipeak_max = std::min(spec.size(),
+      maxIndex
+          + static_cast<size_t>(2.5
+              * static_cast<double>(maxFwhmIndex - maxIndex)));
+  size_t i_delta_peak = ipeak_max - ipeak_min;
+
+  g_log.debug() << "Peak estimate xmin/max: " << ipeak_min - 1 << "\t"
+      << ipeak_max + 1 << std::endl;
+
+  minX = static_cast<double>(ipeak_min - 2 * i_delta_peak);
+  maxX = static_cast<double>(ipeak_max + 2 * i_delta_peak);
+
+}
+
+/**
+ * Fit peak without background i.e, with background removed
+ *  inspired from FitPowderDiffPeaks.cpp
+ *  copied from PoldiPeakDetection2.cpp
+ *
+ @param workspaceindex :: indice of the row to use
+ @param center :: gaussian parameter - center
+ @param sigma :: gaussian parameter - width
+ @param height :: gaussian parameter - height
+ @param startX :: fit range - start X value
+ @param endX :: fit range - end X value
+ @returns A boolean status flag, true for fit success, false else
+ */
+bool ConvertEmptyToTof::doFitGaussianPeak(int workspaceindex, double& center,
+    double& sigma, double& height, double startX, double endX) {
+
+  g_log.debug("Calling doFitGaussianPeak...");
+
+  // 1. Estimate
+  sigma = sigma * 0.5;
+
+  // 2. Use factory to generate Gaussian
+  auto temppeak = API::FunctionFactory::Instance().createFunction("Gaussian");
+  auto gaussianpeak = boost::dynamic_pointer_cast<API::IPeakFunction>(temppeak);
+  gaussianpeak->setHeight(height);
+  gaussianpeak->setCentre(center);
+  gaussianpeak->setFwhm(sigma);
+
+  // 3. Constraint
+  double centerleftend = center - sigma * 0.5;
+  double centerrightend = center + sigma * 0.5;
+  std::ostringstream os;
+  os << centerleftend << " < PeakCentre < " << centerrightend;
+  auto * centerbound = API::ConstraintFactory::Instance().createInitialized(
+      gaussianpeak.get(), os.str(), false);
+  gaussianpeak->addConstraint(centerbound);
+
+  g_log.debug("Calling createChildAlgorithm : Fit...");
+  // 4. Fit
+  API::IAlgorithm_sptr fitalg = createChildAlgorithm("Fit", -1, -1, true);
+  fitalg->initialize();
+
+  fitalg->setProperty("Function",
+      boost::dynamic_pointer_cast<API::IFunction>(gaussianpeak));
+  fitalg->setProperty("InputWorkspace", m_inputWS);
+  fitalg->setProperty("WorkspaceIndex", workspaceindex);
+  fitalg->setProperty("Minimizer", "Levenberg-MarquardtMD");
+  fitalg->setProperty("CostFunction", "Least squares");
+  fitalg->setProperty("MaxIterations", 1000);
+  fitalg->setProperty("Output", "FitGaussianPeak");
+  fitalg->setProperty("StartX", startX);
+  fitalg->setProperty("EndX", endX);
+
+  // 5.  Result
+  bool successfulfit = fitalg->execute();
+  if (!fitalg->isExecuted() || !successfulfit) {
+    // Early return due to bad fit
+    g_log.warning() << "Fitting Gaussian peak for peak around "
+        << gaussianpeak->centre() << std::endl;
+    return false;
+  }
+
+  // 6. Get result
+  center = gaussianpeak->centre();
+  height = gaussianpeak->height();
+  double fwhm = gaussianpeak->fwhm();
+  if (fwhm <= 0.0) {
+    return false;
+  }
+//    sigma = fwhm*2;
+  //  sigma = fwhm/2.35;
+
+  return true;
+}
+
+/**
+ * Finds the TOF for a given epp
+ * @param eppMap : pair workspace spec index - epp
+ * @return the average EPP and the corresponding average EP in TOF
+ */
+
+std::pair<int, double> ConvertEmptyToTof::findAverageEppAndEpTof(
+    const std::map<int, int>& eppMap) {
+
+  double l1 = getL1(m_inputWS);
+  double wavelength = getPropertyFromRun<double>(m_inputWS, "wavelength");
+
+  std::vector<double> epTofList;
+  std::vector<int> eppList;
+
+  double firstL2 = getL2(m_inputWS, eppMap.begin()->first);
+  for (auto it = eppMap.begin(); it != eppMap.end(); ++it) {
+
+    double l2 = getL2(m_inputWS, it->first);
+    if (!areEqual(l2, firstL2, 0.0001)) {
+      g_log.error() << "firstL2=" << firstL2 << " , " << "l2=" << l2
+          << std::endl;
+      throw std::runtime_error(
+          "All the pixels for selected spectra must have the same distance from the sample!");
+    } else {
+      firstL2 = l2;
+    }
+
+    epTofList.push_back(
+        (calculateTOF(l1, wavelength) + calculateTOF(l2, wavelength)) * 1e6); //microsecs
+    eppList.push_back(it->first);
+
+    g_log.debug() << "WS index = " << it->first << ", l1 = " << l1 << ", l2 = "
+        << l2 << ", TOF(l1+l2) = " << *(epTofList.end() - 1) << std::endl;
+  }
+
+  double averageEpTof = std::accumulate(epTofList.begin(), epTofList.end(), 0.0)
+      / static_cast<double>(epTofList.size());
+  int averageEpp = roundUp(
+      static_cast<double>(std::accumulate(eppList.begin(), eppList.end(), 0))
+          / static_cast<double>(eppList.size()));
+
+  g_log.debug() << "Average epp=" << averageEpp << " , Average epTof="
+      << averageEpTof << std::endl;
+  return std::make_pair(averageEpp, averageEpTof);
+}
+
+double ConvertEmptyToTof::getL1(API::MatrixWorkspace_const_sptr workspace) {
+  Geometry::Instrument_const_sptr instrument = workspace->getInstrument();
+  Geometry::IComponent_const_sptr sample = instrument->getSample();
+  double l1 = instrument->getSource()->getDistance(*sample);
+  return l1;
+}
+
+double ConvertEmptyToTof::getL2(API::MatrixWorkspace_const_sptr workspace,
+    int detId) {
+  // Get a pointer to the instrument contained in the workspace
+  Geometry::Instrument_const_sptr instrument = workspace->getInstrument();
+  // Get the distance between the source and the sample (assume in metres)
+  Geometry::IComponent_const_sptr sample = instrument->getSample();
+  // Get the sample-detector distance for this detector (in metres)
+  double l2 = workspace->getDetector(detId)->getPos().distance(
+      sample->getPos());
+  return l2;
+}
+
+double ConvertEmptyToTof::calculateTOF(double distance, double wavelength) {
+  if (wavelength <= 0) {
+    throw std::runtime_error("Wavelenght is <= 0");
+  }
+
+  double velocity = PhysicalConstants::h
+      / (PhysicalConstants::NeutronMass * wavelength * 1e-10); //m/s
+
+  return distance / velocity;
+}
+
+/**
+ * Compare two double with a precision epsilon
+ */
+bool ConvertEmptyToTof::areEqual(double a, double b, double epsilon) {
+  return fabs(a - b) < epsilon;
+}
+
+template<typename T>
+T ConvertEmptyToTof::getPropertyFromRun(API::MatrixWorkspace_const_sptr inputWS,
+    const std::string& propertyName) {
+  if (inputWS->run().hasProperty(propertyName)) {
+    Kernel::Property* prop = inputWS->run().getProperty(propertyName);
+    return boost::lexical_cast<T>(prop->value());
+  } else {
+    std::string mesg = "No '" + propertyName
+        + "' property found in the input workspace....";
+    throw std::runtime_error(mesg);
+  }
+}
+
+int ConvertEmptyToTof::roundUp(double value) {
+  return static_cast<int>(std::floor(value + 0.5));
+}
+
+/**
+ * Builds the X time axis
+ */
+std::vector<double> ConvertEmptyToTof::makeTofAxis(int epp, double epTof,
+    size_t size, double channelWidth) {
+  std::vector<double> axis(size);
+
+  g_log.debug() << "Building the TOF X Axis: epp=" << epp << ", epTof=" << epTof
+      << ", Channel Width=" << channelWidth << std::endl;
+  for (size_t i = 0; i < size; ++i) {
+    axis[i] = epTof
+        + channelWidth * static_cast<double>(static_cast<int>(i) - epp)
+        - channelWidth / 2; // to make sure the bin is in the middle of the elastic peak
+  }
+  g_log.debug() << "TOF X Axis: [start,end] = [" << *axis.begin() << ","
+      << *(axis.end() - 1) << "]" << std::endl;
+  return axis;
+}
+
+void ConvertEmptyToTof::setTofInWS(const std::vector<double> &tofAxis,
+    API::MatrixWorkspace_sptr outputWS) {
+
+  const size_t numberOfSpectra = m_inputWS->getNumberHistograms();
+  int64_t numberOfSpectraInt64 = static_cast<int64_t>(numberOfSpectra); // cast to make openmp happy
+
+  g_log.debug() << "Setting the TOF X Axis for numberOfSpectra="
+      << numberOfSpectra << std::endl;
+
+  Progress prog(this, 0.0, 0.2, numberOfSpectra);
+  PARALLEL_FOR2(m_inputWS,outputWS)
+  for (int64_t i = 0; i < numberOfSpectraInt64; ++i) {
+    PARALLEL_START_INTERUPT_REGION
+    // Just copy over
+    outputWS->dataY(i) = m_inputWS->readY(i);
+    outputWS->dataE(i) = m_inputWS->readE(i);
+    // copy
+    outputWS->setX(i, tofAxis);
+
+    prog.report();
+  PARALLEL_END_INTERUPT_REGION
+}        //end for i
+PARALLEL_CHECK_INTERUPT_REGION
+outputWS->getAxis(0)->unit() = UnitFactory::Instance().create("TOF");
+
+}
+
+} // namespace Algorithms
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/Algorithms/src/CorrectFlightPaths.cpp b/Code/Mantid/Framework/Algorithms/src/CorrectFlightPaths.cpp
index f21ed5e1eca4c4476a3131475235a64c527aaedc..f8c656a88c95ffa997637c0a7704437153afa9f0 100644
--- a/Code/Mantid/Framework/Algorithms/src/CorrectFlightPaths.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CorrectFlightPaths.cpp
@@ -25,7 +25,7 @@ DECLARE_ALGORITHM(CorrectFlightPaths)
 
 // Constructor
 CorrectFlightPaths::CorrectFlightPaths() :
-		API::Algorithm() {
+    API::Algorithm() {
 }
 
 /** Initialisation method. Declares properties to be used in algorithm.
@@ -35,17 +35,16 @@ void CorrectFlightPaths::init() {
 
 //todo: add validator for TOF
 
-	auto wsValidator = boost::make_shared<CompositeValidator>();
-	wsValidator->add<WorkspaceUnitValidator>("TOF");
-	wsValidator->add<HistogramValidator>();
-	declareProperty(
-			new WorkspaceProperty<API::MatrixWorkspace>("InputWorkspace", "",
-					Direction::Input, wsValidator),
-			"Name of the input workspace");
-	declareProperty(
-			new WorkspaceProperty<API::MatrixWorkspace>("OutputWorkspace", "",
-					Direction::Output),
-			"Name of the output workspace, can be the same as the input");
+  auto wsValidator = boost::make_shared<CompositeValidator>();
+  wsValidator->add<WorkspaceUnitValidator>("TOF");
+  wsValidator->add<HistogramValidator>();
+  declareProperty(
+      new WorkspaceProperty<API::MatrixWorkspace>("InputWorkspace", "",
+          Direction::Input, wsValidator), "Name of the input workspace");
+  declareProperty(
+      new WorkspaceProperty<API::MatrixWorkspace>("OutputWorkspace", "",
+          Direction::Output),
+      "Name of the output workspace, can be the same as the input");
 
 }
 
@@ -54,21 +53,20 @@ void CorrectFlightPaths::init() {
  *
  */
 void CorrectFlightPaths::initWorkspaces() {
-	// Get the workspaces
-	m_inputWS = this->getProperty("InputWorkspace");
-	m_outputWS = this->getProperty("OutputWorkspace");
-	m_instrument = m_inputWS->getInstrument();
-	m_sample = m_instrument->getSample();
-	// If input and output workspaces are not the same, create a new workspace for the output
-	if (m_outputWS != this->m_inputWS) {
-		m_outputWS = API::WorkspaceFactory::Instance().create(m_inputWS);
-	}
-
-
-	m_wavelength = getRunProperty("wavelength");
-	g_log.debug() << "Wavelength = " << m_wavelength;
-	m_l2 = getInstrumentProperty("l2");
-	g_log.debug() << " L2 = " << m_l2 << std::endl;
+  // Get the workspaces
+  m_inputWS = this->getProperty("InputWorkspace");
+  m_outputWS = this->getProperty("OutputWorkspace");
+  m_instrument = m_inputWS->getInstrument();
+  m_sample = m_instrument->getSample();
+  // If input and output workspaces are not the same, create a new workspace for the output
+  if (m_outputWS != this->m_inputWS) {
+    m_outputWS = API::WorkspaceFactory::Instance().create(m_inputWS);
+  }
+
+  m_wavelength = getRunProperty("wavelength");
+  g_log.debug() << "Wavelength = " << m_wavelength;
+  m_l2 = getInstrumentProperty("l2");
+  g_log.debug() << " L2 = " << m_l2 << std::endl;
 
 }
 
@@ -78,69 +76,70 @@ void CorrectFlightPaths::initWorkspaces() {
  */
 void CorrectFlightPaths::exec() {
 
-	initWorkspaces();
+  initWorkspaces();
 
-	Geometry::ParameterMap& pmap = m_outputWS->instrumentParameters();
+  Geometry::ParameterMap& pmap = m_outputWS->instrumentParameters();
 
-	const size_t numberOfChannels = this->m_inputWS->blocksize();
+  const size_t numberOfChannels = this->m_inputWS->blocksize();
 // Calculate the number of spectra in this workspace
-	const int numberOfSpectra = static_cast<int>(this->m_inputWS->size()
-			/ numberOfChannels);
-	API::Progress prog(this, 0.0, 1.0, numberOfSpectra);
-
-	int64_t numberOfSpectra_i = static_cast<int64_t>(numberOfSpectra); // cast to make openmp happy
-
-	// Loop over the histograms (detector spectra)
-
-	PARALLEL_FOR2(m_inputWS,m_outputWS)
-	for (int64_t i = 0; i < numberOfSpectra_i; ++i) {
-	//for (int64_t i = 32000; i < 32256; ++i) {
-		PARALLEL_START_INTERUPT_REGION
-
-		MantidVec& xOut = m_outputWS->dataX(i);
-		MantidVec& yOut = m_outputWS->dataY(i);
-		MantidVec& eOut = m_outputWS->dataE(i);
-		const MantidVec& xIn = m_inputWS->readX(i);
-		const MantidVec& yIn = m_inputWS->readY(i);
-		const MantidVec& eIn = m_inputWS->readE(i);
-		//Copy the energy transfer axis
-		// TOF
+  const int numberOfSpectra = static_cast<int>(this->m_inputWS->size()
+      / numberOfChannels);
+  API::Progress prog(this, 0.0, 1.0, numberOfSpectra);
+
+  int64_t numberOfSpectra_i = static_cast<int64_t>(numberOfSpectra); // cast to make openmp happy
+
+  // Loop over the histograms (detector spectra)
+
+  PARALLEL_FOR2(m_inputWS,m_outputWS)
+  for (int64_t i = 0; i < numberOfSpectra_i; ++i) {
+    //for (int64_t i = 32000; i < 32256; ++i) {
+    PARALLEL_START_INTERUPT_REGION
+
+    MantidVec& xOut = m_outputWS->dataX(i);
+    MantidVec& yOut = m_outputWS->dataY(i);
+    MantidVec& eOut = m_outputWS->dataE(i);
+    const MantidVec& xIn = m_inputWS->readX(i);
+    const MantidVec& yIn = m_inputWS->readY(i);
+    const MantidVec& eIn = m_inputWS->readE(i);
+    //Copy the energy transfer axis
+    // TOF
 //		MantidVec& xOut = m_outputWS->dataX(i);
 //		const MantidVec& xIn = m_inputWS->readX(i);
 
-		// subract the diference in l2
-		IDetector_const_sptr det = m_inputWS->getDetector(i);
-		double thisDetL2 = det->getDistance(*m_sample);
-		//if (!det->isMonitor() && thisDetL2 != m_l2) {
-		double deltaL2 = std::abs(thisDetL2 - m_l2);
-		double deltaTOF = calculateTOF(deltaL2);
-		deltaTOF *= 1e6; //micro sec
-
-		// position - set all detector distance to constant l2
-		double r, theta, phi;
-		V3D oldPos = det->getPos();
-		oldPos.getSpherical(r, theta, phi);
-		V3D newPos;
-	    newPos.spherical(m_l2, theta, phi);
-	    ComponentHelper::moveComponent(*det, pmap, newPos, ComponentHelper::Absolute);
-
-		unsigned int j = 0;
-		for (; j < numberOfChannels; ++j) {
-			xOut[j] = xIn[j] - deltaTOF;
-			// there's probably a better way of copying this....
-			yOut[j] = yIn[j];
-			eOut[j] = eIn[j];
-
-		}
-		// last bin
-		xOut[numberOfChannels] = xIn[numberOfChannels] + deltaTOF;
-		//}
-		prog.report("Aligning elastic line...");
-		PARALLEL_END_INTERUPT_REGION
-	} //end for i
-	PARALLEL_CHECK_INTERUPT_REGION
-
-	this->setProperty("OutputWorkspace", this->m_outputWS);
+    // subract the diference in l2
+    IDetector_const_sptr det = m_inputWS->getDetector(i);
+    double thisDetL2 = det->getDistance(*m_sample);
+    //if (!det->isMonitor() && thisDetL2 != m_l2) {
+    double deltaL2 = std::abs(thisDetL2 - m_l2);
+    double deltaTOF = calculateTOF(deltaL2);
+    deltaTOF *= 1e6; //micro sec
+
+    // position - set all detector distance to constant l2
+    double r, theta, phi;
+    V3D oldPos = det->getPos();
+    oldPos.getSpherical(r, theta, phi);
+    V3D newPos;
+    newPos.spherical(m_l2, theta, phi);
+    ComponentHelper::moveComponent(*det, pmap, newPos,
+        ComponentHelper::Absolute);
+
+    unsigned int j = 0;
+    for (; j < numberOfChannels; ++j) {
+      xOut[j] = xIn[j] - deltaTOF;
+      // there's probably a better way of copying this....
+      yOut[j] = yIn[j];
+      eOut[j] = eIn[j];
+
+    }
+    // last bin
+    xOut[numberOfChannels] = xIn[numberOfChannels] + deltaTOF;
+    //}
+    prog.report("Aligning elastic line...");
+  PARALLEL_END_INTERUPT_REGION
+} //end for i
+PARALLEL_CHECK_INTERUPT_REGION
+
+this->setProperty("OutputWorkspace", this->m_outputWS);
 
 }
 
@@ -150,14 +149,14 @@ void CorrectFlightPaths::exec() {
  *
  */
 double CorrectFlightPaths::getRunProperty(std::string s) {
-	Mantid::Kernel::Property* prop = m_inputWS->run().getProperty(s);
-	double val;
-	if (!prop || !Strings::convert(prop->value(), val)) {
-		std::string mesg = "Run property " + s + "doesn't exist!";
-		g_log.error(mesg);
-		throw std::runtime_error(mesg);
-	}
-	return val;
+Mantid::Kernel::Property* prop = m_inputWS->run().getProperty(s);
+double val;
+if (!prop || !Strings::convert(prop->value(), val)) {
+  std::string mesg = "Run property " + s + "doesn't exist!";
+  g_log.error(mesg);
+  throw std::runtime_error(mesg);
+}
+return val;
 }
 /*
  * Get instrument property as double
@@ -165,14 +164,14 @@ double CorrectFlightPaths::getRunProperty(std::string s) {
  *
  */
 double CorrectFlightPaths::getInstrumentProperty(std::string s) {
-	std::vector<std::string> prop = m_instrument->getStringParameter(s);
-	if (prop.empty()) {
-		std::string mesg = "Property <" + s + "> doesn't exist!";
-		g_log.error(mesg);
-		throw std::runtime_error(mesg);
-	}
-	g_log.debug() << "prop[0] = " << prop[0] << std::endl;
-	return boost::lexical_cast<double>(prop[0]);
+std::vector<std::string> prop = m_instrument->getStringParameter(s);
+if (prop.empty()) {
+  std::string mesg = "Property <" + s + "> doesn't exist!";
+  g_log.error(mesg);
+  throw std::runtime_error(mesg);
+}
+g_log.debug() << "prop[0] = " << prop[0] << std::endl;
+return boost::lexical_cast<double>(prop[0]);
 }
 
 /*
@@ -180,10 +179,10 @@ double CorrectFlightPaths::getInstrumentProperty(std::string s) {
  * @distance - Distance in meters
  */
 double CorrectFlightPaths::calculateTOF(double distance) {
-	double velocity = PhysicalConstants::h
-			/ (PhysicalConstants::NeutronMass * m_wavelength * 1e-10); //m/s
+double velocity = PhysicalConstants::h
+    / (PhysicalConstants::NeutronMass * m_wavelength * 1e-10); //m/s
 
-	return distance / velocity;
+return distance / velocity;
 }
 
 } // namespace Algorithm
diff --git a/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
index f50c01a52ab294eab7a44760c209fa44e9f7e3e2..2c298c4ad27626dff3e005f90a70c7975e90197d 100644
--- a/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
@@ -306,7 +306,7 @@ namespace Algorithms
     {
       //get the rough peak centre value
       int index = static_cast<int>((xSize/10)*x);
-      if (x==10) --index;
+      if ((x==10) && (index > 0)) --index;
       double replace_val = xVal[index];
       std::ostringstream tokenStream;
       tokenStream << "$PC" << x << "$";
diff --git a/Code/Mantid/Framework/Algorithms/src/DiffractionFocussing.cpp b/Code/Mantid/Framework/Algorithms/src/DiffractionFocussing.cpp
index c9d3985ac7c7bb7a55e87504a652d8d644592096..34cc3bbc7421a1a4af16b24c797bd6cce97a9f90 100644
--- a/Code/Mantid/Framework/Algorithms/src/DiffractionFocussing.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/DiffractionFocussing.cpp
@@ -19,7 +19,7 @@ DECLARE_ALGORITHM(DiffractionFocussing)
 /// Constructor
 DiffractionFocussing::DiffractionFocussing() : API::Algorithm(), API::DeprecatedAlgorithm()
 {
-  this->useAlgorithm("DiffractionFocussing version 2");
+  this->useAlgorithm("DiffractionFocussing", 2);
 }
 
 
diff --git a/Code/Mantid/Framework/Algorithms/src/FindPeaks.cpp b/Code/Mantid/Framework/Algorithms/src/FindPeaks.cpp
index 3546df4bf6717d9b1084a045dc1057aa7cdc3d8e..41116f300d992d983ea8cc7a32073460cbeb0703 100644
--- a/Code/Mantid/Framework/Algorithms/src/FindPeaks.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/FindPeaks.cpp
@@ -103,9 +103,6 @@ namespace Algorithms
     declareProperty("PeakPositionTolerance", EMPTY_DBL(), mustBePositiveDBL,
                     "Tolerance on the found peaks' positions against the input peak positions.  Non-positive value indicates that this option is turned off.");
 
-    declareProperty("PeakHeightTolerance", EMPTY_DBL(),
-                    "Tolerance of the ratio on the found peak's height against the local maximum.  Non-positive value turns this option off. ");
-
     // The found peaks in a table
     declareProperty(new WorkspaceProperty<API::ITableWorkspace>("PeaksList", "", Direction::Output),
                     "The name of the TableWorkspace in which to store the list of peaks found");
@@ -168,7 +165,6 @@ namespace Algorithms
     {
       //Use Mariscotti's method to find the peak centers
       m_usePeakPositionTolerance = false;
-      m_usePeakHeightTolerance = false;
       this->findPeaksUsingMariscotti();
     }
 
@@ -223,11 +219,6 @@ namespace Algorithms
     if (isEmpty(m_peakPositionTolerance))
       m_usePeakPositionTolerance = false;
 
-    m_peakHeightTolerance = getProperty("PeakHeightTolerance");
-    m_usePeakHeightTolerance = true;
-    if (isEmpty(m_peakHeightTolerance))
-      m_usePeakHeightTolerance = false;
-
     // Specified peak positions, which is optional
     m_vecPeakCentre = getProperty("PeakPositions");
     if (m_vecPeakCentre.size() > 0)
diff --git a/Code/Mantid/Framework/Algorithms/src/InterpolatingRebin.cpp b/Code/Mantid/Framework/Algorithms/src/InterpolatingRebin.cpp
index 21675dc1b3817a414e1592d6f564298765f4c8f0..84edb02ad97b231f426c2d0e88b781c4629933f1 100644
--- a/Code/Mantid/Framework/Algorithms/src/InterpolatingRebin.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/InterpolatingRebin.cpp
@@ -2,6 +2,8 @@
 // Includes
 //----------------------------------------------------------------------
 #include "MantidAlgorithms/InterpolatingRebin.h"
+#include "MantidKernel/ArrayProperty.h"
+#include "MantidKernel/RebinParamsValidator.h"
 #include "MantidKernel/VectorHelper.h"
 #include <gsl/gsl_errno.h>
 #include <gsl/gsl_interp.h>
@@ -24,7 +26,21 @@ namespace Mantid
     */
     void InterpolatingRebin::init()
     {
-      Rebin::init();
+      declareProperty(
+        new WorkspaceProperty<>("InputWorkspace", "", Direction::Input),
+        "Workspace containing the input data");
+      declareProperty(
+        new WorkspaceProperty<>("OutputWorkspace","",Direction::Output),
+        "The name to give the output workspace");
+
+      declareProperty(
+        new ArrayProperty<double>("Params", boost::make_shared<RebinParamsValidator>()),
+        "A comma separated list of first bin boundary, width, last bin boundary. Optionally "
+        "this can be followed by a comma and more widths and last boundary pairs. "
+        "Optionally this can also be a single number, which is the bin width. "
+        "In this case, the boundary of binning will be determined by minimum and maximum TOF "
+        "values among all events, or previous binning boundary, in case of event Workspace, or "
+        "non-event Workspace, respectively. Negative width values indicate logarithmic binning. ");
     }
 
     /** Executes the rebin algorithm
@@ -33,16 +49,16 @@ namespace Mantid
     */
     void InterpolatingRebin::exec()
     {
-      // retrieve the properties
-      std::vector<double> rb_params=getProperty("Params");
+      // Get the input workspace
+      MatrixWorkspace_sptr inputW = getProperty("InputWorkspace");
 
+      // retrieve the properties
+      std::vector<double> rb_params = Rebin::rebinParamsFromInput(getProperty("Params"), *inputW, g_log);
       MantidVecPtr XValues_new;
       // create new output X axis
       const int ntcnew =
         VectorHelper::createAxisFromRebinParams(rb_params,XValues_new.access());
 
-      // Get the input workspace
-      MatrixWorkspace_sptr inputW = getProperty("InputWorkspace");
       const int nHists = static_cast<int>(inputW->getNumberHistograms());
       // make output Workspace the same type as the input but with the new axes
       MatrixWorkspace_sptr outputW =
diff --git a/Code/Mantid/Framework/Algorithms/src/Rebin.cpp b/Code/Mantid/Framework/Algorithms/src/Rebin.cpp
index fc7a94340404b9996b6527919cbbc4240d2fb325..742f884ba8142868cd3e236bdb1dae86b38fd4ad 100644
--- a/Code/Mantid/Framework/Algorithms/src/Rebin.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/Rebin.cpp
@@ -18,7 +18,6 @@ namespace Mantid
     // Register the class into the algorithm factory
     DECLARE_ALGORITHM(Rebin)
     
-
     using namespace Kernel;
     using namespace API;
     using DataObjects::EventList;
@@ -26,6 +25,47 @@ namespace Mantid
     using DataObjects::EventWorkspace_sptr;
     using DataObjects::EventWorkspace_const_sptr;
 
+    //---------------------------------------------------------------------------------------------
+    // Public static methods
+    //---------------------------------------------------------------------------------------------
+
+    /**
+     * Return the rebin parameters from a user input
+     * @param inParams Input vector from user
+     * @param inputWS Input workspace from user
+     * @param logger A reference to a logger
+     * @returns A new vector containing the rebin parameters
+     */
+    std::vector<double> Rebin::rebinParamsFromInput(const std::vector<double> & inParams,
+                                                    const API::MatrixWorkspace & inputWS,
+                                                    Kernel::Logger & logger)
+    {
+      std::vector<double> rbParams;
+      // The validator only passes parameters with size 1, or 3xn.  No need to check again here
+      if (inParams.size() >= 3)
+      {
+        // Input are min, delta, max
+        rbParams = inParams;
+      }
+      else if (inParams.size() == 1)
+      {
+        double xmin = 0.;
+        double xmax = 0.;
+        inputWS.getXMinMax(xmin, xmax);
+
+        logger.information() << "Using the current min and max as default " << xmin << ", " << xmax << std::endl;
+        rbParams.resize(3);
+        rbParams[0] = xmin;
+        rbParams[1] = inParams[0];
+        rbParams[2] = xmax;
+      }
+      return rbParams;
+    }
+
+    //---------------------------------------------------------------------------------------------
+    // Public methods
+    //---------------------------------------------------------------------------------------------
+
     /** Initialisation method. Declares properties to be used in algorithm.
     *
     */
@@ -72,30 +112,9 @@ namespace Mantid
       // Rebinning in-place
       bool inPlace = (inputWS == outputWS);
 
-      // retrieve the properties
-      const std::vector<double> in_params=getProperty("Params");
-      std::vector<double> rb_params;
-
-      // The validator only passes parameters with size 1, or 3xn.  No need to check again here
-      if (in_params.size() >= 3){
-        // Input are min, delta, max
-        rb_params = in_params;
-
-      } else if (in_params.size() == 1){
-        double xmin = 0.;
-        double xmax = 0.;
-        inputWS->getXMinMax(xmin, xmax);
-
-        g_log.information() << "Using the current min and max as default " << xmin << ", " << xmax << std::endl;
-
-        rb_params.push_back(xmin);
-        rb_params.push_back(in_params[0]);
-        rb_params.push_back(xmax);
-
-      }
+      std::vector<double> rbParams = rebinParamsFromInput(getProperty("Params"), *inputWS, g_log);
 
       const bool dist = inputWS->isDistribution();
-
       const bool isHist = inputWS->isHistogramData();
 
       // workspace independent determination of length
@@ -105,7 +124,7 @@ namespace Mantid
 
       MantidVecPtr XValues_new;
       // create new output X axis
-      const int ntcnew = VectorHelper::createAxisFromRebinParams(rb_params, XValues_new.access(),
+      const int ntcnew = VectorHelper::createAxisFromRebinParams(rbParams, XValues_new.access(),
                                                                  true, fullBinsOnly);
 
       //---------------------------------------------------------------------------------
diff --git a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp
index 56fecd6c8b53ab1d48667c28a864f2a554daae6e..ba37382e10d366e79f2186bb9ce1bc5082b6eefd 100644
--- a/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp
@@ -53,6 +53,25 @@ namespace Mantid
       const std::string pointDetectorAnalysis = "PointDetectorAnalysis";
       const std::string tofUnitId = "TOF";
       const std::string wavelengthUnitId = "Wavelength";
+
+      /**
+       * Helper free function to get the ordered spectrum numbers from a workspace.
+       * @param ws
+       * @return
+       */
+      std::vector<int> getSpectrumNumbers(MatrixWorkspace_sptr& ws)
+      {
+        auto specToWSIndexMap = ws->getSpectrumToWorkspaceIndexMap();
+        std::vector<int> keys(specToWSIndexMap.size());
+        size_t i = 0;
+        for (auto it = specToWSIndexMap.begin(); it != specToWSIndexMap.end(); ++it, ++i)
+        {
+          keys[i] = static_cast<int>(it->first);
+        }
+        std::sort(keys.begin(), keys.end()); // Sort the keys, as the order is not guaranteed in the map.
+
+        return keys;
+      }
     }
     /* End of ananomous namespace */
 
@@ -149,7 +168,7 @@ namespace Mantid
       declareProperty(
           new WorkspaceProperty<MatrixWorkspace>("FirstTransmissionRun", "", Direction::Input,
               PropertyMode::Optional),
-          "First transmission run, or the low wavelength transmision run if SecondTransmissionRun is also provided.");
+          "First transmission run, or the low wavelength transmission run if SecondTransmissionRun is also provided.");
       declareProperty(
           new WorkspaceProperty<MatrixWorkspace>("SecondTransmissionRun", "", Direction::Input,
               PropertyMode::Optional, inputValidator->clone()),
@@ -157,9 +176,8 @@ namespace Mantid
 
       this->initStitchingInputs();
 
-      declareProperty(
-        new PropertyWithValue<bool>("StrictSpectrumChecking", true, Direction::Input),
-        "Enforces spectrum number checking prior to normalisation");
+      declareProperty(new PropertyWithValue<bool>("StrictSpectrumChecking", true, Direction::Input),
+          "Enforces spectrum number checking prior to normalisation");
 
       setPropertyGroup("FirstTransmissionRun", "Transmission");
       setPropertyGroup("SecondTransmissionRun", "Transmission");
@@ -186,48 +204,47 @@ namespace Mantid
 
     /**
      * Correct the position of the detectors based on the input theta value.
-     * @param toCorrect : Workspace to correct detector posisitions on.
+     * @param toCorrect : Workspace to correct detector positions on.
      * @param thetaInDeg : Theta in degrees to use in correction calculations.
-     * @param sample : Pointer to the sample
-     * @param detector : Pointer to a given detector
+     * @param isPointDetector : True if using point detector analysis
+     * @return Copy with positions corrected.
      */
-    void ReflectometryReductionOne::correctPosition(API::MatrixWorkspace_sptr toCorrect,
-        const double& thetaInDeg, IComponent_const_sptr sample, IComponent_const_sptr detector)
+    MatrixWorkspace_sptr ReflectometryReductionOne::correctPosition(API::MatrixWorkspace_sptr& toCorrect,
+        const double& thetaInDeg, const bool isPointDetector)
     {
+      g_log.debug("Correcting position using theta.");
 
-      auto instrument = toCorrect->getInstrument();
-
-      const V3D detectorPosition = detector->getPos();
+      auto correctPosAlg = this->createChildAlgorithm("SpecularReflectionPositionCorrect");
+      correctPosAlg->initialize();
+      correctPosAlg->setProperty("InputWorkspace", toCorrect);
 
-      const V3D samplePosition = sample->getPos();
-
-      const V3D sampleToDetector = detectorPosition - samplePosition;
-
-      auto referenceFrame = instrument->getReferenceFrame();
-
-      const double sampleToDetectorAlongBeam = sampleToDetector.scalar_prod(
-          referenceFrame->vecPointingAlongBeam());
-
-      const double thetaInRad = thetaInDeg * (M_PI / 180.0);
-
-      double acrossOffset = 0;
-
-      double beamOffset = detectorPosition.scalar_prod(referenceFrame->vecPointingAlongBeam());
-
-      double upOffset = sampleToDetectorAlongBeam * std::sin(2.0 * thetaInRad);
+      const std::string analysisMode = this->getProperty("AnalysisMode");
+      correctPosAlg->setProperty("AnalysisMode", analysisMode);
+      auto instrument = toCorrect->getInstrument();
+      IComponent_const_sptr sample = this->getSurfaceSampleComponent(instrument);
+      correctPosAlg->setProperty("SampleComponentName", sample->getName());
+      correctPosAlg->setProperty("TwoThetaIn", thetaInDeg * 2);
 
-      auto moveComponentAlg = this->createChildAlgorithm("MoveInstrumentComponent");
-      moveComponentAlg->initialize();
-      moveComponentAlg->setProperty("Workspace", toCorrect);
-      moveComponentAlg->setProperty("ComponentName", detector->getName());
-      moveComponentAlg->setProperty("RelativePosition", false);
-      // Movements
-      moveComponentAlg->setProperty(referenceFrame->pointingAlongBeamAxis(), beamOffset);
-      moveComponentAlg->setProperty(referenceFrame->pointingHorizontalAxis(), acrossOffset);
-      moveComponentAlg->setProperty(referenceFrame->pointingUpAxis(), upOffset);
-      // Execute the movement.
-      moveComponentAlg->execute();
+      if (isPointDetector)
+      {
+        IComponent_const_sptr detector = this->getDetectorComponent(instrument, isPointDetector);
+        correctPosAlg->setProperty("DetectorComponentName", detector->getName());
+      }
+      else
+      {
+        auto specNumbers = getSpectrumNumbers(toCorrect);
+        correctPosAlg->setProperty("SpectrumNumbersOfDetectors", specNumbers);
+        for(size_t t = 0; t < specNumbers.size(); ++t)
+        {
+         std::stringstream buffer;
+         buffer << "Writing out: " << specNumbers[t];
+         g_log.notice(buffer.str());
+        }
+      }
+      correctPosAlg->execute();
+      MatrixWorkspace_sptr corrected = correctPosAlg->getProperty("OutputWorkspace");
 
+      return corrected;
     }
 
     /**
@@ -240,7 +257,8 @@ namespace Mantid
      * @return
      */
     Mantid::API::MatrixWorkspace_sptr ReflectometryReductionOne::toIvsQ(
-        API::MatrixWorkspace_sptr toConvert, const bool bCorrectPosition, OptionalDouble& thetaInDeg, const bool isPointDetector)
+        API::MatrixWorkspace_sptr& toConvert, const bool bCorrectPosition, OptionalDouble& thetaInDeg,
+        const bool isPointDetector)
     {
       /*
        * Can either calculate a missing theta value for the purposes of reporting, or correct positions based on a theta value,
@@ -253,27 +271,29 @@ namespace Mantid
         auto correctThetaAlg = this->createChildAlgorithm("SpecularReflectionCalculateTheta");
         correctThetaAlg->initialize();
         correctThetaAlg->setProperty("InputWorkspace", toConvert);
-        const std::string detectorComponentName = this->getPropertyValue("DetectorComponentName");
-        const std::string sampleComponentName = this->getProperty("SampleComponentName");
         const std::string analysisMode = this->getProperty("AnalysisMode");
-        correctThetaAlg->setProperty("DetectorComponentName", detectorComponentName);
-        correctThetaAlg->setProperty("SampleComponentName", sampleComponentName);
         correctThetaAlg->setProperty("AnalysisMode", analysisMode);
+        const std::string sampleComponentName = this->getProperty("SampleComponentName");
+        correctThetaAlg->setProperty("SampleComponentName", sampleComponentName);
+        if (isPointDetector)
+        {
+          const std::string detectorComponentName = this->getPropertyValue("DetectorComponentName");
+          correctThetaAlg->setProperty("DetectorComponentName", detectorComponentName);
+        }
+        else
+        {
+          std::vector<int> spectrumNumbers = getSpectrumNumbers(toConvert);
+          correctThetaAlg->setProperty("SpectrumNumbersOfDetectors", spectrumNumbers);
+        }
         correctThetaAlg->execute();
         const double twoTheta = correctThetaAlg->getProperty("TwoTheta");
 
-        thetaInDeg = twoTheta/2;
+        thetaInDeg = twoTheta / 2;
 
       }
-      else if (bCorrectPosition) // This probably ought to be an automatic decision. How about making a guess about sample position holder and detector names. But also allowing the two component names (sample and detector) to be passed in.
+      else if (bCorrectPosition)
       {
-        g_log.debug("Correcting detector position");
-
-        auto instrument = toConvert->getInstrument();
-        IComponent_const_sptr detector = this->getDetectorComponent(instrument, isPointDetector);
-        IComponent_const_sptr sample = this->getSurfaceSampleComponent(instrument);
-
-        correctPosition(toConvert, thetaInDeg.get(), sample, detector);
+        toConvert = correctPosition(toConvert, thetaInDeg.get(), isPointDetector);
       }
 
       // Always convert units.
@@ -445,7 +465,8 @@ namespace Mantid
         IvsLam = this->transmissonCorrection(IvsLam, wavelengthInterval,
             monitorBackgroundWavelengthInterval, monitorIntegrationWavelengthInterval, i0MonitorIndex,
             firstTransmissionRun.get(), secondTransmissionRun, stitchingStart, stitchingDelta,
-            stitchingEnd, stitchingStartOverlap, stitchingEndOverlap, wavelengthStep, processingCommands);
+            stitchingEnd, stitchingStartOverlap, stitchingEndOverlap, wavelengthStep,
+            processingCommands);
       }
       else
       {
@@ -484,25 +505,26 @@ namespace Mantid
         MatrixWorkspace_sptr firstTransmissionRun, OptionalMatrixWorkspace_sptr secondTransmissionRun,
         const OptionalDouble& stitchingStart, const OptionalDouble& stitchingDelta,
         const OptionalDouble& stitchingEnd, const OptionalDouble& stitchingStartOverlap,
-        const OptionalDouble& stitchingEndOverlap, const double& wavelengthStep, const std::string& numeratorProcessingCommands)
+        const OptionalDouble& stitchingEndOverlap, const double& wavelengthStep,
+        const std::string& numeratorProcessingCommands)
     {
       g_log.debug("Extracting first transmission run workspace indexes from spectra");
 
       const bool strictSpectrumChecking = getProperty("StrictSpectrumChecking");
-    
+
       MatrixWorkspace_sptr denominator = firstTransmissionRun;
       Unit_const_sptr xUnit = firstTransmissionRun->getAxis(0)->unit();
       if (xUnit->unitID() == tofUnitId)
       {
         std::string spectrumProcessingCommands = numeratorProcessingCommands;
         /*
-        If we have strict spectrum checking, the processing commands need to be made from the 
-        numerator workspace AND the transmission workspace based on matching spectrum numbers.
-        */
-        if(strictSpectrumChecking)
+         If we have strict spectrum checking, the processing commands need to be made from the
+         numerator workspace AND the transmission workspace based on matching spectrum numbers.
+         */
+        if (strictSpectrumChecking)
         {
           spectrumProcessingCommands = createWorkspaceIndexListFromDetectorWorkspace(IvsLam,
-          firstTransmissionRun);
+              firstTransmissionRun);
         }
 
         // Make the transmission run.
@@ -549,11 +571,12 @@ namespace Mantid
     }
 
     /**
-    @param ws1 : First workspace to compare
-    @param ws2 : Second workspace to compare against
-    @param severe: True to indicate that failure to verify should result in an exception. Otherwise a warning is generated.
-    */
-    void ReflectometryReductionOne::verifySpectrumMaps(MatrixWorkspace_const_sptr ws1, MatrixWorkspace_const_sptr ws2, const bool severe)
+     @param ws1 : First workspace to compare
+     @param ws2 : Second workspace to compare against
+     @param severe: True to indicate that failure to verify should result in an exception. Otherwise a warning is generated.
+     */
+    void ReflectometryReductionOne::verifySpectrumMaps(MatrixWorkspace_const_sptr ws1,
+        MatrixWorkspace_const_sptr ws2, const bool severe)
     {
       auto map1 = ws1->getSpectrumToWorkspaceIndexMap();
       auto map2 = ws2->getSpectrumToWorkspaceIndexMap();
diff --git a/Code/Mantid/Framework/Algorithms/src/RemoveExpDecay.cpp b/Code/Mantid/Framework/Algorithms/src/RemoveExpDecay.cpp
index fed9f4e43d067627bd00bf696c3bc60fe2e41fa2..b1fd93b0ac90289289b69d1a45b55091dab151da 100644
--- a/Code/Mantid/Framework/Algorithms/src/RemoveExpDecay.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/RemoveExpDecay.cpp
@@ -33,7 +33,7 @@ void MuonRemoveExpDecay::init()
   declareProperty(new API::WorkspaceProperty<API::MatrixWorkspace>("OutputWorkspace", "",
       Direction::Output), "The name of the output 2D workspace.");
   std::vector<int> empty;
-  declareProperty(new Kernel::ArrayProperty<int>("Spectra", empty), "The workspace indeces to remove the exponential decay from.");
+  declareProperty(new Kernel::ArrayProperty<int>("Spectra", empty), "The workspace indices to remove the exponential decay from.");
 }
 
 /** Executes the algorithm
diff --git a/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp b/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..69a888c1cde584b2dac188d59ab501bc70fdc67f
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/src/RemoveWorkspaceHistory.cpp
@@ -0,0 +1,68 @@
+/*WIKI*
+Removes all algorithm history records from a given workspace. This includes all workflow and child algorithm history records. After this algorithm has been run, the workspace will not be reproducable
+from its history. Note that this algorithm will not remove the environment history associated with a workspace.  
+*WIKI*/
+
+#include "MantidAPI/WorkspaceHistory.h"
+#include "MantidAlgorithms/RemoveWorkspaceHistory.h"
+
+using namespace Mantid::Kernel;
+using namespace Mantid::API;
+
+namespace Mantid
+{
+namespace Algorithms
+{
+
+  // Register the algorithm into the AlgorithmFactory
+  DECLARE_ALGORITHM(RemoveWorkspaceHistory)
+  
+
+
+  //----------------------------------------------------------------------------------------------
+  /** Constructor
+   */
+  RemoveWorkspaceHistory::RemoveWorkspaceHistory()
+  {
+  }
+    
+  //----------------------------------------------------------------------------------------------
+  /** Destructor
+   */
+  RemoveWorkspaceHistory::~RemoveWorkspaceHistory()
+  {
+  }
+  
+
+  //----------------------------------------------------------------------------------------------
+  /// Algorithm's name for identification. @see Algorithm::name
+  const std::string RemoveWorkspaceHistory::name() const { return "RemoveWorkspaceHistory";};
+  
+  /// Algorithm's version for identification. @see Algorithm::version
+  int RemoveWorkspaceHistory::version() const { return 1;};
+  
+  /// Algorithm's category for identification. @see Algorithm::category
+  const std::string RemoveWorkspaceHistory::category() const { return "Utility";}
+
+  /// Algorithm's summary for identification. @see Algorithm::summary
+  const std::string RemoveWorkspaceHistory::summary() const { return "Removes all algorithm history records from a given workspace."; };
+
+  //----------------------------------------------------------------------------------------------
+  /** Initialize the algorithm's properties.
+   */
+  void RemoveWorkspaceHistory::init()
+  {
+    declareProperty(new WorkspaceProperty<Workspace>("Workspace", "", Direction::InOut), "Workspace to remove the algorithm history from.");
+  }
+
+  //----------------------------------------------------------------------------------------------
+  /** Execute the algorithm.
+   */
+  void RemoveWorkspaceHistory::exec()
+  {
+    Workspace_sptr ws = getProperty("Workspace");
+    ws->history().clearHistory();
+  }
+
+} // namespace Algorithms
+} // namespace Mantid
\ No newline at end of file
diff --git a/Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp b/Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
index b53fa2d2b6c938228718ed5072f0abd3bf58bc2d..9f37a193913a30f69ab0652e32189e3c745ae8e5 100644
--- a/Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/Stitch1D.cpp
@@ -1,10 +1,10 @@
 /*WIKI*
-Stitches single histogram [[MatrixWorkspace|Matrix Workspaces]] together outputting a stitched Matrix Workspace. Either the right-hand-side or left-hand-side workspace can be chosen to be scaled. Users
-must provide a Param step (single value), but the binning start and end are calculated from the input workspaces if not provided. Likewise, StartOverlap and EndOverlap are optional. If the StartOverlap or EndOverlap
-are not provided, then these are taken to be the region of x-axis intersection.
+ Stitches single histogram [[MatrixWorkspace|Matrix Workspaces]] together outputting a stitched Matrix Workspace. Either the right-hand-side or left-hand-side workspace can be chosen to be scaled. Users
+ must provide a Param step (single value), but the binning start and end are calculated from the input workspaces if not provided. Likewise, StartOverlap and EndOverlap are optional. If the StartOverlap or EndOverlap
+ are not provided, then these are taken to be the region of x-axis intersection.
 
-The workspaces must be histogrammed. Use [[ConvertToHistogram]] on workspaces prior to passing them to this algorithm. 
-*WIKI*/
+ The workspaces must be histogrammed. Use [[ConvertToHistogram]] on workspaces prior to passing them to this algorithm.
+ *WIKI*/
 
 #include "MantidAlgorithms/Stitch1D.h"
 #include "MantidAPI/WorkspaceProperty.h"
@@ -13,14 +13,18 @@ The workspaces must be histogrammed. Use [[ConvertToHistogram]] on workspaces pr
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/PropertyWithValue.h"
 #include "MantidKernel/RebinParamsValidator.h"
+#include "MantidKernel/MultiThreaded.h"
+#include "MantidKernel/BoundedValidator.h"
 
 #include <boost/make_shared.hpp>
 #include <boost/tuple/tuple.hpp>
 #include <boost/format.hpp>
 #include <boost/algorithm/string.hpp>
+#include <boost/math/special_functions.hpp>
 #include <vector>
 #include <algorithm>
 
+
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
 using Mantid::MantidVec;
@@ -36,7 +40,7 @@ namespace
     return MinMaxTuple(rhs_x.front(), lhs_x.back());
   }
 
-  bool isNonzero (double i)
+  bool isNonzero(double i)
   {
     return (0 != i);
   }
@@ -47,65 +51,73 @@ namespace Mantid
   namespace Algorithms
   {
 
+    /**
+     * Range tolerance
+     *
+     * This is required for machine precision reasons. Used to adjust StartOverlap and EndOverlap so that they are
+     * inclusive of bin boundaries if they are sitting ontop of the bin boundaries.
+     */
     const double Stitch1D::range_tolerance = 1e-9;
     // Register the algorithm into the AlgorithmFactory
     DECLARE_ALGORITHM(Stitch1D)
 
     //----------------------------------------------------------------------------------------------
     /** Initialize the algorithm's properties.
-    */
+     */
     void Stitch1D::init()
     {
       Kernel::IValidator_sptr histogramValidator = boost::make_shared<HistogramValidator>();
 
       declareProperty(
-        new WorkspaceProperty<MatrixWorkspace>("LHSWorkspace", "", Direction::Input,
-        histogramValidator->clone()), "LHS input workspace.");
+          new WorkspaceProperty<MatrixWorkspace>("LHSWorkspace", "", Direction::Input,
+              histogramValidator->clone()), "LHS input workspace.");
       declareProperty(
-        new WorkspaceProperty<MatrixWorkspace>("RHSWorkspace", "", Direction::Input,
-        histogramValidator->clone()), "RHS input workspace.");
+          new WorkspaceProperty<MatrixWorkspace>("RHSWorkspace", "", Direction::Input,
+              histogramValidator->clone()), "RHS input workspace.");
       declareProperty(new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "", Direction::Output),
-        "Output stitched workspace.");
+          "Output stitched workspace.");
       declareProperty(
-        new PropertyWithValue<double>("StartOverlap", Mantid::EMPTY_DBL(), Direction::Input),
-        "Start overlap x-value in units of x-axis. Optional.");
+          new PropertyWithValue<double>("StartOverlap", Mantid::EMPTY_DBL(), Direction::Input),
+          "Start overlap x-value in units of x-axis. Optional.");
       declareProperty(new PropertyWithValue<double>("EndOverlap", Mantid::EMPTY_DBL(), Direction::Input),
-        "End overlap x-value in units of x-axis. Optional.");
+          "End overlap x-value in units of x-axis. Optional.");
       declareProperty(
-        new ArrayProperty<double>("Params", boost::make_shared<RebinParamsValidator>(true)),
-        "Rebinning Parameters. See Rebin for format. If only a single value is provided, start and end are taken from input workspaces.");
+          new ArrayProperty<double>("Params", boost::make_shared<RebinParamsValidator>(true)),
+          "Rebinning Parameters. See Rebin for format. If only a single value is provided, start and end are taken from input workspaces.");
       declareProperty(new PropertyWithValue<bool>("ScaleRHSWorkspace", true, Direction::Input),
-        "Scaling either with respect to workspace 1 or workspace 2");
+          "Scaling either with respect to workspace 1 or workspace 2");
       declareProperty(new PropertyWithValue<bool>("UseManualScaleFactor", false, Direction::Input),
-        "True to use a provided value for the scale factor.");
-      declareProperty(
-        new PropertyWithValue<double>("ManualScaleFactor", 1.0, Direction::Input),
-        "Provided value for the scale factor. Optional.");
+          "True to use a provided value for the scale factor.");
+      auto manualScaleFactorValidator = boost::make_shared<BoundedValidator<double> >();
+      manualScaleFactorValidator->setLower(0);
+      manualScaleFactorValidator->setExclusive(true);
+      declareProperty(new PropertyWithValue<double>("ManualScaleFactor", 1.0, manualScaleFactorValidator, Direction::Input),
+          "Provided value for the scale factor. Optional.");
       declareProperty(
-        new PropertyWithValue<double>("OutScaleFactor", Mantid::EMPTY_DBL(), Direction::Output),
-        "The actual used value for the scaling factor.");
+          new PropertyWithValue<double>("OutScaleFactor", Mantid::EMPTY_DBL(), Direction::Output),
+          "The actual used value for the scaling factor.");
     }
 
     /**Gets the start of the overlapping region
-    @param intesectionMin :: The minimum possible value for the overlapping region to inhabit
-    @param intesectionMax :: The maximum possible value for the overlapping region to inhabit
-    @return a double contianing the start of the overlapping region
-    */
+     @param intesectionMin :: The minimum possible value for the overlapping region to inhabit
+     @param intesectionMax :: The maximum possible value for the overlapping region to inhabit
+     @return a double contianing the start of the overlapping region
+     */
     double Stitch1D::getStartOverlap(const double& intesectionMin, const double& intesectionMax) const
     {
       Property* startOverlapProp = this->getProperty("StartOverlap");
       double startOverlapVal = this->getProperty("StartOverlap");
       startOverlapVal -= this->range_tolerance;
       const bool startOverlapBeyondRange = (startOverlapVal < intesectionMin)
-        || (startOverlapVal > intesectionMax);
+          || (startOverlapVal > intesectionMax);
       if (startOverlapProp->isDefault() || startOverlapBeyondRange)
       {
         if (!startOverlapProp->isDefault() && startOverlapBeyondRange)
         {
           char message[200];
           std::sprintf(message,
-            "StartOverlap is outside range at %0.4f, Min is %0.4f, Max is %0.4f . Forced to be: %0.4f",
-            startOverlapVal, intesectionMin, intesectionMax, intesectionMin);
+              "StartOverlap is outside range at %0.4f, Min is %0.4f, Max is %0.4f . Forced to be: %0.4f",
+              startOverlapVal, intesectionMin, intesectionMax, intesectionMin);
           g_log.warning(std::string(message));
         }
         startOverlapVal = intesectionMin;
@@ -117,25 +129,25 @@ namespace Mantid
     }
 
     /**Gets the end of the overlapping region
-    @param intesectionMin :: The minimum possible value for the overlapping region to inhabit
-    @param intesectionMax :: The maximum possible value for the overlapping region to inhabit
-    @return a double contianing the end of the overlapping region
-    */
+     @param intesectionMin :: The minimum possible value for the overlapping region to inhabit
+     @param intesectionMax :: The maximum possible value for the overlapping region to inhabit
+     @return a double contianing the end of the overlapping region
+     */
     double Stitch1D::getEndOverlap(const double& intesectionMin, const double& intesectionMax) const
     {
       Property* endOverlapProp = this->getProperty("EndOverlap");
       double endOverlapVal = this->getProperty("EndOverlap");
       endOverlapVal += this->range_tolerance;
       const bool endOverlapBeyondRange = (endOverlapVal < intesectionMin)
-        || (endOverlapVal > intesectionMax);
+          || (endOverlapVal > intesectionMax);
       if (endOverlapProp->isDefault() || endOverlapBeyondRange)
       {
         if (!endOverlapProp->isDefault() && endOverlapBeyondRange)
         {
           char message[200];
           std::sprintf(message,
-            "EndOverlap is outside range at %0.4f, Min is %0.4f, Max is %0.4f . Forced to be: %0.4f",
-            endOverlapVal, intesectionMin, intesectionMax, intesectionMax);
+              "EndOverlap is outside range at %0.4f, Min is %0.4f, Max is %0.4f . Forced to be: %0.4f",
+              endOverlapVal, intesectionMin, intesectionMax, intesectionMax);
           g_log.warning(std::string(message));
         }
         endOverlapVal = intesectionMax;
@@ -147,11 +159,12 @@ namespace Mantid
     }
 
     /**Gets the rebinning parameters and calculates any missing values
-    @param lhsWS :: The left hand side input workspace
-    @param rhsWS :: The right hand side input workspace
-    @return a vector<double> contianing the rebinning parameters
-    */
-    MantidVec Stitch1D::getRebinParams(MatrixWorkspace_sptr& lhsWS, MatrixWorkspace_sptr& rhsWS) const
+     @param lhsWS :: The left hand side input workspace
+     @param rhsWS :: The right hand side input workspace
+     @param scaleRHS :: Scale the right hand side workspace
+     @return a vector<double> contianing the rebinning parameters
+     */
+    MantidVec Stitch1D::getRebinParams(MatrixWorkspace_sptr& lhsWS, MatrixWorkspace_sptr& rhsWS, const bool scaleRHS) const
     {
       MantidVec inputParams = this->getProperty("Params");
       Property* prop = this->getProperty("Params");
@@ -170,7 +183,19 @@ namespace Mantid
       {
         MantidVec calculatedParams;
 
-        const double calculatedStep = (maxRHSX - minLHSX) / 100;
+        // Calculate the step size based on the existing step size of the LHS workspace. That way scale factors should be reasonably maintained.
+        double calculatedStep =0;
+        if(scaleRHS)
+        {
+          // Calculate the step from the workspace that will not be scaled. The LHS workspace.
+          calculatedStep = lhsX[1] - lhsX[0];
+        }
+        else
+        {
+          // Calculate the step from the workspace that will not be scaled. The RHS workspace.
+          calculatedStep = rhsX[1] - rhsX[0];
+        }
+
         calculatedParams.push_back(minLHSX);
         calculatedParams.push_back(calculatedStep);
         calculatedParams.push_back(maxRHSX);
@@ -195,10 +220,10 @@ namespace Mantid
     }
 
     /**Runs the Rebin Algorithm as a child
-    @param input :: The input workspace
-    @param params :: a vector<double> containing rebinning parameters
-    @return A shared pointer to the resulting MatrixWorkspace
-    */
+     @param input :: The input workspace
+     @param params :: a vector<double> containing rebinning parameters
+     @return A shared pointer to the resulting MatrixWorkspace
+     */
     MatrixWorkspace_sptr Stitch1D::rebin(MatrixWorkspace_sptr& input, const MantidVec& params)
     {
       auto rebin = this->createChildAlgorithm("Rebin");
@@ -210,12 +235,13 @@ namespace Mantid
     }
 
     /**Runs the Integration Algorithm as a child
-    @param input :: The input workspace
-    @param start :: a double defining the start of the region to integrate
-    @param stop :: a double defining the end of the region to integrate
-    @return A shared pointer to the resulting MatrixWorkspace
-    */
-    MatrixWorkspace_sptr Stitch1D::integration(MatrixWorkspace_sptr& input, const double& start, const double& stop)
+     @param input :: The input workspace
+     @param start :: a double defining the start of the region to integrate
+     @param stop :: a double defining the end of the region to integrate
+     @return A shared pointer to the resulting MatrixWorkspace
+     */
+    MatrixWorkspace_sptr Stitch1D::integration(MatrixWorkspace_sptr& input, const double& start,
+        const double& stop)
     {
       auto integration = this->createChildAlgorithm("Integration");
       integration->setProperty("InputWorkspace", input);
@@ -227,13 +253,14 @@ namespace Mantid
     }
 
     /**Runs the MultiplyRange Algorithm as a child defining an end bin
-    @param input :: The input workspace
-    @param startBin :: The first bin int eh range to multiply
-    @param endBin :: The last bin in the range to multiply
-    @param factor :: The multiplication factor
-    @return A shared pointer to the resulting MatrixWorkspace
-    */
-    MatrixWorkspace_sptr Stitch1D::multiplyRange(MatrixWorkspace_sptr& input, const int& startBin, const int& endBin, const double& factor)
+     @param input :: The input workspace
+     @param startBin :: The first bin int eh range to multiply
+     @param endBin :: The last bin in the range to multiply
+     @param factor :: The multiplication factor
+     @return A shared pointer to the resulting MatrixWorkspace
+     */
+    MatrixWorkspace_sptr Stitch1D::multiplyRange(MatrixWorkspace_sptr& input, const int& startBin,
+        const int& endBin, const double& factor)
     {
       auto multiplyRange = this->createChildAlgorithm("MultiplyRange");
       multiplyRange->setProperty("InputWorkspace", input);
@@ -246,12 +273,13 @@ namespace Mantid
     }
 
     /**Runs the MultiplyRange Algorithm as a child
-    @param input :: The input workspace
-    @param startBin :: The first bin int eh range to multiply
-    @param factor :: The multiplication factor
-    @return A shared pointer to the resulting MatrixWorkspace
-    */
-    MatrixWorkspace_sptr Stitch1D::multiplyRange(MatrixWorkspace_sptr& input, const int& startBin, const double& factor)
+     @param input :: The input workspace
+     @param startBin :: The first bin int eh range to multiply
+     @param factor :: The multiplication factor
+     @return A shared pointer to the resulting MatrixWorkspace
+     */
+    MatrixWorkspace_sptr Stitch1D::multiplyRange(MatrixWorkspace_sptr& input, const int& startBin,
+        const double& factor)
     {
       auto multiplyRange = this->createChildAlgorithm("MultiplyRange");
       multiplyRange->setProperty("InputWorkspace", input);
@@ -263,10 +291,10 @@ namespace Mantid
     }
 
     /**Runs the WeightedMean Algorithm as a child
-    @param inOne :: The first input workspace
-    @param inTwo :: The second input workspace
-    @return A shared pointer to the resulting MatrixWorkspace
-    */
+     @param inOne :: The first input workspace
+     @param inTwo :: The second input workspace
+     @return A shared pointer to the resulting MatrixWorkspace
+     */
     MatrixWorkspace_sptr Stitch1D::weightedMean(MatrixWorkspace_sptr& inOne, MatrixWorkspace_sptr& inTwo)
     {
       auto weightedMean = this->createChildAlgorithm("WeightedMean");
@@ -278,9 +306,9 @@ namespace Mantid
     }
 
     /**Runs the CreateSingleValuedWorkspace Algorithm as a child
-    @param val :: The double to convert to a single value workspace
-    @return A shared pointer to the resulting MatrixWorkspace
-    */
+     @param val :: The double to convert to a single value workspace
+     @return A shared pointer to the resulting MatrixWorkspace
+     */
     MatrixWorkspace_sptr Stitch1D::singleValueWS(double val)
     {
       auto singleValueWS = this->createChildAlgorithm("CreateSingleValuedWorkspace");
@@ -291,178 +319,202 @@ namespace Mantid
     }
 
     /**finds the bins containing the ends of the overlappign region
-    @param startOverlap :: The start of the overlapping region
-    @param endOverlap :: The end of the overlapping region
-    @param workspace :: The workspace to determine the overlaps inside
-    @return a boost::tuple<int,int> containing the bin indexes of the overlaps
-    */
-    boost::tuple<int, int> Stitch1D::findStartEndIndexes(double startOverlap, double endOverlap, MatrixWorkspace_sptr& workspace)
+     @param startOverlap :: The start of the overlapping region
+     @param endOverlap :: The end of the overlapping region
+     @param workspace :: The workspace to determine the overlaps inside
+     @return a boost::tuple<int,int> containing the bin indexes of the overlaps
+     */
+    boost::tuple<int, int> Stitch1D::findStartEndIndexes(double startOverlap, double endOverlap,
+        MatrixWorkspace_sptr& workspace)
     {
       int a1 = static_cast<int>(workspace->binIndexOf(startOverlap));
       int a2 = static_cast<int>(workspace->binIndexOf(endOverlap));
       if (a1 == a2)
       {
-        throw std::runtime_error("The Params you have provided for binning yield a workspace in which start and end overlap appear in the same bin. Make binning finer via input Params.");
+        throw std::runtime_error(
+            "The Params you have provided for binning yield a workspace in which start and end overlap appear in the same bin. Make binning finer via input Params.");
       }
-      return boost::tuple<int,int>(a1,a2);
+      return boost::tuple<int, int>(a1, a2);
 
     }
 
     /**Determines if a workspace has non zero errors
-    @param ws :: The input workspace
-    @return True if there are any non-zero errors in the workspace
-    */
-    bool Stitch1D::hasNonzeroErrors(MatrixWorkspace_sptr& ws) const
+     @param ws :: The input workspace
+     @return True if there are any non-zero errors in the workspace
+     */
+    bool Stitch1D::hasNonzeroErrors(MatrixWorkspace_sptr ws)
     {
-      size_t ws_size = ws->getNumberHistograms();
-      for (size_t i = 0; i < ws_size; ++i)
+      int64_t ws_size = static_cast<int64_t>(ws->getNumberHistograms());
+      bool hasNonZeroErrors = false;
+      PARALLEL_FOR1(ws)
+      for (int i = 0; i < ws_size; ++i)
       {
-        auto e = ws->readE(i);
-        std::vector<double, std::allocator<double> >::iterator error = std::find_if(e.begin(), e.end(), isNonzero);
-        if (error != e.end())
+        PARALLEL_START_INTERUPT_REGION
+        if (!hasNonZeroErrors) // Keep checking
         {
-          return true;
+          auto e = ws->readE(i);
+          auto it = std::find_if(e.begin(), e.end(),isNonzero);
+          if (it != e.end())
+          {
+            PARALLEL_CRITICAL(has_non_zero)
+            {
+              hasNonZeroErrors = true; // Set flag. Should not need to check any more spectra.
+            }
+          }
         }
-      }
-      return false;
+      PARALLEL_END_INTERUPT_REGION
     }
+    PARALLEL_CHECK_INTERUPT_REGION
 
-    //----------------------------------------------------------------------------------------------
-    /** Execute the algorithm.
-    */
-    void Stitch1D::exec()
-    {
-      MatrixWorkspace_sptr rhsWS = this->getProperty("RHSWorkspace");
-      MatrixWorkspace_sptr lhsWS = this->getProperty("LHSWorkspace");
-      const MinMaxTuple intesectionXRegion = calculateXIntersection(lhsWS, rhsWS);
+    return hasNonZeroErrors;
+  }
 
-      const double intersectionMin = intesectionXRegion.get<0>();
-      const double intersectionMax = intesectionXRegion.get<1>();
+  //----------------------------------------------------------------------------------------------
+  /** Execute the algorithm.
+   */
+  void Stitch1D::exec()
+  {
+    MatrixWorkspace_sptr rhsWS = this->getProperty("RHSWorkspace");
+    MatrixWorkspace_sptr lhsWS = this->getProperty("LHSWorkspace");
+    const MinMaxTuple intesectionXRegion = calculateXIntersection(lhsWS, rhsWS);
 
-      const double startOverlap = getStartOverlap(intersectionMin, intersectionMax);
-      const double endOverlap = getEndOverlap(intersectionMin, intersectionMax);
+    const double intersectionMin = intesectionXRegion.get<0>();
+    const double intersectionMax = intesectionXRegion.get<1>();
 
-      if (startOverlap > endOverlap)
-      {
-        std::string message =
-          boost::str(
+    const double startOverlap = getStartOverlap(intersectionMin, intersectionMax);
+    const double endOverlap = getEndOverlap(intersectionMin, intersectionMax);
+
+    if (startOverlap > endOverlap)
+    {
+      std::string message = boost::str(
           boost::format(
-          "Stitch1D cannot have a StartOverlap > EndOverlap. StartOverlap: %0.9f, EndOverlap: %0.9f")
-          % startOverlap % endOverlap);
-        throw std::runtime_error(message);
-      }
+              "Stitch1D cannot have a StartOverlap > EndOverlap. StartOverlap: %0.9f, EndOverlap: %0.9f")
+              % startOverlap % endOverlap);
+      throw std::runtime_error(message);
+    }
 
-      MantidVec params = getRebinParams(lhsWS, rhsWS);
+    const bool scaleRHS = this->getProperty("ScaleRHSWorkspace");
+    MantidVec params = getRebinParams(lhsWS, rhsWS, scaleRHS);
 
-      const double& xMin = params.front();
-      const double& xMax = params.back();
+    const double& xMin = params.front();
+    const double& xMax = params.back();
 
-      if (startOverlap < xMin)
-      {
-        std::string message =
+    if (startOverlap < xMin)
+    {
+      std::string message =
           boost::str(
-          boost::format(
-          "Stitch1D StartOverlap is outside the available X range after rebinning. StartOverlap: %10.9f, X min: %10.9f")
-          % startOverlap % xMin);
+              boost::format(
+                  "Stitch1D StartOverlap is outside the available X range after rebinning. StartOverlap: %10.9f, X min: %10.9f")
+                  % startOverlap % xMin);
 
-        throw std::runtime_error(message);
-      }
-      if (endOverlap > xMax)
-      {
-        std::string message =
+      throw std::runtime_error(message);
+    }
+    if (endOverlap > xMax)
+    {
+      std::string message =
           boost::str(
-          boost::format(
-          "Stitch1D EndOverlap is outside the available X range after rebinning. EndOverlap: %10.9f, X max: %10.9f")
-          % endOverlap % xMax);
+              boost::format(
+                  "Stitch1D EndOverlap is outside the available X range after rebinning. EndOverlap: %10.9f, X max: %10.9f")
+                  % endOverlap % xMax);
 
-        throw std::runtime_error(message);
-      }
+      throw std::runtime_error(message);
+    }
 
-      auto rebinnedLHS = rebin(lhsWS, params);
-      auto rebinnedRHS = rebin(rhsWS, params);
+    auto rebinnedLHS = rebin(lhsWS, params);
+    auto rebinnedRHS = rebin(rhsWS, params);
 
-      boost::tuple<int,int> startEnd = findStartEndIndexes(startOverlap, endOverlap, rebinnedLHS);
+    boost::tuple<int, int> startEnd = findStartEndIndexes(startOverlap, endOverlap, rebinnedLHS);
 
-      bool scaleRHS = this->getProperty("ScaleRHSWorkspace");
-      //manualscalefactor if
-      bool manualScaleFactor = this->getProperty("UseManualScaleFactor");
-      double scaleFactor = 0;
+    const bool useManualScaleFactor = this->getProperty("UseManualScaleFactor");
+    double scaleFactor = 0;
+    double errorScaleFactor = 0;
 
-      if (manualScaleFactor)
-      {
-        double manualScaleFactor = this->getProperty("ManualScaleFactor");
-        MatrixWorkspace_sptr manualScaleFactorWS = singleValueWS(manualScaleFactor);
+    if (useManualScaleFactor)
+    {
+      double manualScaleFactor = this->getProperty("ManualScaleFactor");
+      MatrixWorkspace_sptr manualScaleFactorWS = singleValueWS(manualScaleFactor);
 
-        if(scaleRHS)
-        {
-          rebinnedRHS = rebinnedRHS * manualScaleFactorWS;
-        }
-        else
-        {
-          rebinnedLHS = rebinnedLHS * manualScaleFactorWS;
-        }
-        scaleFactor = manualScaleFactor;
+      if (scaleRHS)
+      {
+        rebinnedRHS = rebinnedRHS * manualScaleFactorWS;
       }
       else
       {
-        auto rhsOverlapIntegrated = integration(rebinnedRHS, startOverlap, endOverlap);
-        auto lhsOverlapIntegrated = integration(rebinnedLHS, startOverlap, endOverlap);
+        rebinnedLHS = rebinnedLHS * manualScaleFactorWS;
+      }
+      scaleFactor = manualScaleFactor;
+      errorScaleFactor = manualScaleFactor;
+    }
+    else
+    {
+      auto rhsOverlapIntegrated = integration(rebinnedRHS, startOverlap, endOverlap);
+      auto lhsOverlapIntegrated = integration(rebinnedLHS, startOverlap, endOverlap);
 
-        auto y1 = lhsOverlapIntegrated->readY(0);
-        auto y2 = rhsOverlapIntegrated->readY(0);
-        if(scaleRHS)
-        {
-          MatrixWorkspace_sptr ratio = lhsOverlapIntegrated/rhsOverlapIntegrated;
-          rebinnedRHS = rebinnedRHS * ratio;
-          scaleFactor = y1[0]/y2[0];
-        }
-        else
-        {
-          MatrixWorkspace_sptr ratio = rhsOverlapIntegrated/lhsOverlapIntegrated;
-          rebinnedLHS = rebinnedLHS * ratio;
-          scaleFactor = y2[0]/y1[0];
-        }
+      MatrixWorkspace_sptr ratio;
+      if (scaleRHS)
+      {
+        ratio = lhsOverlapIntegrated / rhsOverlapIntegrated;
+        rebinnedRHS = rebinnedRHS * ratio;
+      }
+      else
+      {
+        ratio = rhsOverlapIntegrated / lhsOverlapIntegrated;
+        rebinnedLHS = rebinnedLHS * ratio;
+      }
+      scaleFactor = ratio->readY(0).front();
+      errorScaleFactor = ratio->readE(0).front();
+      if(scaleFactor < 1e-2 || scaleFactor > 1e2  || boost::math::isnan(scaleFactor))
+      {
+        std::stringstream messageBuffer;
+        messageBuffer << "Stitch1D calculated scale factor is: " << scaleFactor << ". Check that in both input workspaces the integrated overlap region is non-zero.";
+        g_log.warning(messageBuffer.str());
       }
-      //manualscalefactor end if
 
-      int a1 = boost::tuples::get<0>(startEnd);
-      int a2 = boost::tuples::get<1>(startEnd);
+    }
 
-      // Mask out everything BUT the overlap region as a new workspace.
-      MatrixWorkspace_sptr overlap1 = multiplyRange(rebinnedLHS,0,a1,0);
-      overlap1 = multiplyRange(overlap1,a2,0);
+    int a1 = boost::tuples::get<0>(startEnd);
+    int a2 = boost::tuples::get<1>(startEnd);
 
-      // Mask out everything BUT the overlap region as a new workspace.
-      MatrixWorkspace_sptr overlap2 = multiplyRange(rebinnedRHS,0,a1,0);
-      overlap2 = multiplyRange(overlap2,a2,0);
+    // Mask out everything BUT the overlap region as a new workspace.
+    MatrixWorkspace_sptr overlap1 = multiplyRange(rebinnedLHS, 0, a1, 0);
+    overlap1 = multiplyRange(overlap1, a2, 0);
 
-      // Mask out everything AFTER the start of the overlap region
-      rebinnedLHS = multiplyRange(rebinnedLHS,a1 + 1,0);
+    // Mask out everything BUT the overlap region as a new workspace.
+    MatrixWorkspace_sptr overlap2 = multiplyRange(rebinnedRHS, 0, a1, 0);
+    overlap2 = multiplyRange(overlap2, a2, 0);
 
-      // Mask out everything BEFORE the end of the overlap region
-      rebinnedRHS = multiplyRange(rebinnedRHS,0,a2-1,0);
+    // Mask out everything AFTER the start of the overlap region
+    rebinnedLHS = multiplyRange(rebinnedLHS, a1 + 1, 0);
 
-      // Calculate a weighted mean for the overlap region
+    // Mask out everything BEFORE the end of the overlap region
+    rebinnedRHS = multiplyRange(rebinnedRHS, 0, a2 - 1, 0);
 
-      MatrixWorkspace_sptr overlapave;
-      if (hasNonzeroErrors(overlap1) && hasNonzeroErrors(overlap2))
-      {
-        overlapave = weightedMean(overlap1, overlap2);
-      }
-      else
-      {
-        g_log.information("Using un-weighted mean for Stitch1D overlap mean");
-        MatrixWorkspace_sptr sum = overlap1 + overlap2;
-        MatrixWorkspace_sptr denominator = singleValueWS(2.0);
-        overlapave = sum / denominator;
-      }
+    // Calculate a weighted mean for the overlap region
 
-      MatrixWorkspace_sptr result = rebinnedLHS + overlapave + rebinnedRHS;
+    MatrixWorkspace_sptr overlapave;
+    if (hasNonzeroErrors(overlap1) && hasNonzeroErrors(overlap2))
+    {
+      overlapave = weightedMean(overlap1, overlap2);
+    }
+    else
+    {
+      g_log.information("Using un-weighted mean for Stitch1D overlap mean");
+      MatrixWorkspace_sptr sum = overlap1 + overlap2;
+      MatrixWorkspace_sptr denominator = singleValueWS(2.0);
+      overlapave = sum / denominator;
+    }
 
-      setProperty("OutputWorkspace", result);
-      setProperty("OutScaleFactor", scaleFactor);
+    MatrixWorkspace_sptr result = rebinnedLHS + overlapave + rebinnedRHS;
 
-    }
+    // Provide log information about the scale factors used in the calculations.
+    std::stringstream messageBuffer;
+    messageBuffer << "Scale Factor Y is: " << scaleFactor << " Scale Factor E is: " << errorScaleFactor;
+    g_log.notice(messageBuffer.str());
+
+    setProperty("OutputWorkspace", result);
+    setProperty("OutScaleFactor", scaleFactor);
+
+  }
 
-  } // namespace Algorithms
+} // namespace Algorithms
 } // namespace Mantid
diff --git a/Code/Mantid/Framework/Algorithms/test/ConvertEmptyToTofTest.h b/Code/Mantid/Framework/Algorithms/test/ConvertEmptyToTofTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..940a7b6d8e7fb2b1426b25cbf5eafadcdbaee5e1
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/test/ConvertEmptyToTofTest.h
@@ -0,0 +1,198 @@
+#ifndef MANTID_ALGORITHMS_CONVERTEMPTYTOTOFTEST_H_
+#define MANTID_ALGORITHMS_CONVERTEMPTYTOTOFTEST_H_
+
+#include <cxxtest/TestSuite.h>
+#include <cmath>
+
+#include "MantidAlgorithms/ConvertEmptyToTof.h"
+#include "MantidAPI/AnalysisDataService.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+#include "MantidDataObjects/Workspace2D.h"
+#include "MantidGeometry/Instrument/ComponentHelper.h"
+
+using Mantid::Algorithms::ConvertEmptyToTof;
+using namespace Mantid;
+using namespace API;
+
+class ConvertEmptyToTofTest: public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static ConvertEmptyToTofTest *createSuite() {
+    return new ConvertEmptyToTofTest();
+  }
+  static void destroySuite(ConvertEmptyToTofTest *suite) {
+    delete suite;
+  }
+
+  void test_Init() {
+    ConvertEmptyToTof alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize())
+    TS_ASSERT(alg.isInitialized())
+  }
+
+  void test_find_ep_from_1_spectra() {
+    // Name of the output workspace.
+    std::string outWSName("ConvertEmptyToTofTest_OutputWS1");
+    std::string inWSName("ConvertEmptyToTofTest_InputWS1");
+
+    DataObjects::Workspace2D_sptr testWS = createTestWorkspace();
+    WorkspaceCreationHelper::storeWS(inWSName, testWS);
+
+    ConvertEmptyToTof alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize())
+    TS_ASSERT(alg.isInitialized())
+    TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("InputWorkspace", inWSName));
+    TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", outWSName));
+    TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("ListOfSpectraIndices", "5"));
+    TS_ASSERT_THROWS_NOTHING(
+        alg.setPropertyValue("ListOfChannelIndices", "40-60"));
+    TS_ASSERT_THROWS_NOTHING(alg.execute(); );
+    TS_ASSERT(alg.isExecuted());
+
+    auto outWS =
+        AnalysisDataService::Instance().retrieveWS<API::MatrixWorkspace>(
+            outWSName);
+
+    TS_ASSERT(outWS);
+    if (!outWS)
+      return;
+
+    // Check the results
+    TS_ASSERT_DELTA(*(outWS->dataX(1).begin()), 31463.8, 0.1);
+    TS_ASSERT_DELTA(*(outWS->dataX(1).end() - 1), 34493.8, 0.1);
+
+    // Remove workspace from the data service.
+    AnalysisDataService::Instance().remove(outWSName);
+  }
+
+  void test_find_ep_from_2_spectra() {
+    // Name of the output workspace.
+    std::string outWSName("ConvertEmptyToTofTest_OutputWS2");
+    std::string inWSName("ConvertEmptyToTofTest_InputWS2");
+
+    DataObjects::Workspace2D_sptr testWS = createTestWorkspace();
+    WorkspaceCreationHelper::storeWS(inWSName, testWS);
+
+    // move
+    placeDetectorAtSamePosition(testWS, "pixel-5)", "pixel-6)");
+
+    ConvertEmptyToTof alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize())
+    TS_ASSERT(alg.isInitialized())
+    TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("InputWorkspace", inWSName));
+    TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", outWSName));
+    TS_ASSERT_THROWS_NOTHING(
+        alg.setPropertyValue("ListOfSpectraIndices", "5,6"));
+    TS_ASSERT_THROWS_NOTHING(
+        alg.setPropertyValue("ListOfChannelIndices", "40-60"));
+    TS_ASSERT_THROWS_NOTHING(alg.execute(); );
+    TS_ASSERT(alg.isExecuted());
+
+    auto outWS =
+        AnalysisDataService::Instance().retrieveWS<API::MatrixWorkspace>(
+            outWSName);
+
+    TS_ASSERT(outWS);
+    if (!outWS)
+      return;
+
+    // Check the results
+    TS_ASSERT_DELTA(*(outWS->dataX(1).begin()), 31433.8, 0.1);
+    TS_ASSERT_DELTA(*(outWS->dataX(1).end() - 1), 34463.8, 0.1);
+
+    // Remove workspace from the data service.
+    AnalysisDataService::Instance().remove(outWSName);
+  }
+
+  void test_set_tof_from_EPP_and_EP_Spectrum_idx() {
+      // Name of the output workspace.
+      std::string outWSName("ConvertEmptyToTofTest_OutputWS3");
+      std::string inWSName("ConvertEmptyToTofTest_InputWS3");
+
+      DataObjects::Workspace2D_sptr testWS = createTestWorkspace();
+      WorkspaceCreationHelper::storeWS(inWSName, testWS);
+
+      ConvertEmptyToTof alg;
+      TS_ASSERT_THROWS_NOTHING(alg.initialize())
+      TS_ASSERT(alg.isInitialized())
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("InputWorkspace", inWSName));
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", outWSName));
+
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("ElasticPeakPositionSpectrum", "5"));
+      TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("ElasticPeakPosition", "50"));
+      TS_ASSERT_THROWS_NOTHING(alg.execute(); );
+      TS_ASSERT(alg.isExecuted());
+
+      auto outWS =
+          AnalysisDataService::Instance().retrieveWS<API::MatrixWorkspace>(
+              outWSName);
+
+      TS_ASSERT(outWS);
+      if (!outWS)
+        return;
+
+      // Check the results
+      TS_ASSERT_DELTA(*(outWS->dataX(1).begin()), 30113.8, 0.1);
+      TS_ASSERT_DELTA(*(outWS->dataX(1).end() - 1), 33143.8, 0.1);
+
+      // Remove workspace from the data service.
+      AnalysisDataService::Instance().remove(outWSName);
+    }
+
+private:
+
+  /**
+   * Create a test workspace with full instrument
+   * Spectra follow a Gaussian distribution
+   */
+  DataObjects::Workspace2D_sptr createTestWorkspace() {
+
+    // create test ws
+    const size_t nHist = 10; //or testWS->getNumberHistograms();
+    const size_t nBins = 101; //or testWS->blocksize();
+    DataObjects::Workspace2D_sptr testWS =
+        WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(nHist,
+            nBins, false, false, true, std::string("testInstEmpty"));
+    testWS->getAxis(0)->setUnit("Empty");
+    API::Run & run = testWS->mutableRun();
+    run.addProperty<double>("wavelength", 5.0, true); //overwrite
+    run.addProperty<double>("channel_width", 30.0, true); //overwrite
+
+    for (size_t i = 0; i < nHist; ++i) {
+      for (size_t j = 0; j < nBins - 1; ++j) {
+        // gaussian peak centred at 50,and h=10
+        testWS->dataY(i)[j] = 10
+            * exp(-pow((static_cast<double>(j) - 50), 2) / (2 * pow(1.5, 2)));
+      }
+    }
+    return testWS;
+  }
+  /**
+   * Place componentName1 and componentName2 at the same distance!
+   */
+  void placeDetectorAtSamePosition(API::MatrixWorkspace_sptr ws,
+      const std::string& componentName1, const std::string& componentName2) {
+
+    Geometry::Instrument_const_sptr instrument = ws->getInstrument();
+    Geometry::IComponent_const_sptr component1 = instrument->getComponentByName(
+        componentName1);
+    Geometry::IComponent_const_sptr component2 = instrument->getComponentByName(
+        componentName2);
+
+    if (component1 == 0 || component2 == 0)
+      throw std::runtime_error(
+          "component1 = 0 || component2 == 0 : Not found!");
+
+    Kernel::V3D component1Pos = component1->getPos();
+    Kernel::V3D component2NewPos(component1Pos);
+
+    Geometry::ParameterMap& pmap = ws->instrumentParameters();
+    Geometry::ComponentHelper::moveComponent(*component2, pmap,
+        component2NewPos, Geometry::ComponentHelper::Absolute);
+
+  }
+
+};
+
+#endif /* MANTID_ALGORITHMS_CONVERTEMPTYTOTOFTEST_H_ */
diff --git a/Code/Mantid/Framework/Algorithms/test/RemoveWorkspaceHistoryTest.h b/Code/Mantid/Framework/Algorithms/test/RemoveWorkspaceHistoryTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..32fe3c7030e99e84ef53dad1cbbbffce96601242
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/test/RemoveWorkspaceHistoryTest.h
@@ -0,0 +1,135 @@
+#ifndef MANTID_ALGORITHMS_REMOVEWORKSPACEHISTORYTEST_H_
+#define MANTID_ALGORITHMS_REMOVEWORKSPACEHISTORYTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidAlgorithms/RemoveWorkspaceHistory.h"
+#include "MantidTestHelpers/FakeObjects.h"
+
+using Mantid::Algorithms::RemoveWorkspaceHistory;
+
+class RemoveWorkspaceHistoryTest : public CxxTest::TestSuite
+{
+private:
+  /// Use a fake algorithm object instead of a dependency on a real one.
+  class SimpleSum : public Algorithm
+  {
+  public:
+    SimpleSum() : Algorithm() {}
+    virtual ~SimpleSum() {}
+    const std::string name() const { return "SimpleSum";} 
+    const std::string summary() const { return "SimpleSum";} 
+    int version() const  { return 1;}                        
+    const std::string category() const { return "Dummy";}        
+
+    void init()
+    { 
+      declareProperty(new WorkspaceProperty<>("Workspace","",Direction::InOut), "");
+      declareProperty("Input1",2);
+      declareProperty("Input2",1);   
+      declareProperty("Output1",-1,Direction::Output);
+    }
+    void exec() 
+    {
+      const int lhs = getProperty("Input1");
+      const int rhs = getProperty("Input2");
+      const int sum = lhs+rhs;
+
+      setProperty("Output1", sum);
+    }
+  };
+
+  class SimpleSum2 : public SimpleSum
+  {
+  public:
+    const std::string name() const { return "SimpleSum2";} 
+    const std::string summary() const { return "SimpleSum2";} 
+    int version() const  { return 1;}                        
+    const std::string category() const { return "Dummy";}        
+
+    void init()
+    { 
+      SimpleSum::init();
+      declareProperty("Input3",4);
+      declareProperty("Output2",-1,Direction::Output);
+    }
+    void exec() 
+    {
+      SimpleSum::exec();
+      int sum = this->getProperty("Output1");
+      setProperty("Output2", sum+1);
+    }
+  };
+  
+  void createWorkspace(std::string wsName)
+  {
+    //create a fake workspace for testing
+    boost::shared_ptr<WorkspaceTester> input(new WorkspaceTester());
+    AnalysisDataService::Instance().addOrReplace(wsName, input);
+
+    Mantid::API::AlgorithmFactory::Instance().subscribe<SimpleSum>();
+    Mantid::API::AlgorithmFactory::Instance().subscribe<SimpleSum2>();
+
+    //run some dummy algorithms
+    SimpleSum simplesum;
+    simplesum.initialize();
+    simplesum.setPropertyValue("Workspace", wsName);
+    simplesum.setPropertyValue("Input1", "5");
+    simplesum.execute();
+
+    SimpleSum2 simplesum2;
+    simplesum2.initialize();
+    simplesum2.setPropertyValue("Workspace", wsName);
+    simplesum2.setPropertyValue("Input3", "10");
+    simplesum2.execute();
+
+    Mantid::API::AlgorithmFactory::Instance().unsubscribe("SimpleSum",1);
+    Mantid::API::AlgorithmFactory::Instance().unsubscribe("SimpleSum2",1);
+  }
+
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static RemoveWorkspaceHistoryTest *createSuite() { return new RemoveWorkspaceHistoryTest(); }
+  static void destroySuite( RemoveWorkspaceHistoryTest *suite ) { delete suite; }
+
+  void test_Init()
+  {
+    RemoveWorkspaceHistory alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT( alg.isInitialized() )
+  }
+  
+  void test_exec()
+  {
+    std::string wsName = "__remove_history_test_workspace";
+    createWorkspace(wsName);
+
+    Workspace_sptr ws;
+    TS_ASSERT_THROWS_NOTHING( ws = AnalysisDataService::Instance().retrieveWS<Workspace>(wsName) );
+    TS_ASSERT(!ws->history().empty());
+    TS_ASSERT_EQUALS(ws->history().size(), 2);    
+    
+    RemoveWorkspaceHistory alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT( alg.isInitialized() )
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("Workspace", wsName) );
+    TS_ASSERT_THROWS_NOTHING( alg.execute(); );
+    TS_ASSERT( alg.isExecuted() );
+    
+    // Retrieve the workspace from data service. TODO: Change to your desired type
+    TS_ASSERT_THROWS_NOTHING( ws = AnalysisDataService::Instance().retrieveWS<Workspace>(wsName) );
+    TS_ASSERT(ws);
+    if (!ws) return;
+    
+    //Check the results
+    TS_ASSERT_EQUALS(ws->history().size(), 1);
+    TS_ASSERT_EQUALS(ws->history().getAlgorithmHistory(0)->name(), "RemoveWorkspaceHistory");
+    
+    // Remove workspace from the data service.
+    AnalysisDataService::Instance().remove(wsName);
+  }
+};
+
+
+#endif /* MANTID_ALGORITHMS_REMOVEWORKSPACEHISTORYTEST_H_ */
\ No newline at end of file
diff --git a/Code/Mantid/Framework/Algorithms/test/Stitch1DTest.h b/Code/Mantid/Framework/Algorithms/test/Stitch1DTest.h
index 8f60489eb65d7bd4615bbe472be1afb3a51ca84f..0e2ea97a43d463038176c32c29b6c36e102122de 100644
--- a/Code/Mantid/Framework/Algorithms/test/Stitch1DTest.h
+++ b/Code/Mantid/Framework/Algorithms/test/Stitch1DTest.h
@@ -16,7 +16,7 @@ using namespace boost::assign;
 using Mantid::Algorithms::Stitch1D;
 using Mantid::MantidVec;
 
-double roundSix (double i)
+double roundSix(double i)
 {
   return floor(i * 1000000 + 0.5) / 1000000;
 }
@@ -34,7 +34,7 @@ private:
     T m_stepNumber;
   public:
     LinearSequence(const T& start, const T& step) :
-      m_start(start), m_step(step), m_stepNumber(T(0))
+        m_start(start), m_step(step), m_stepNumber(T(0))
     {
     }
 
@@ -47,7 +47,8 @@ private:
 
   };
 
-  MatrixWorkspace_sptr create1DWorkspace(MantidVec& xData, MantidVec& yData, MantidVec& eData)
+  MatrixWorkspace_sptr createWorkspace(MantidVec& xData, MantidVec& yData, MantidVec& eData,
+      const int nSpec = 1)
   {
     auto createWorkspace = AlgorithmManager::Instance().create("CreateWorkspace");
     createWorkspace->setChild(true);
@@ -55,7 +56,7 @@ private:
     createWorkspace->setProperty("UnitX", "1/q");
     createWorkspace->setProperty("DataX", xData);
     createWorkspace->setProperty("DataY", yData);
-    createWorkspace->setProperty("NSpec", 1);
+    createWorkspace->setProperty("NSpec", nSpec);
     createWorkspace->setProperty("DataE", eData);
     createWorkspace->setPropertyValue("OutputWorkspace", "dummy");
     createWorkspace->execute();
@@ -100,7 +101,7 @@ private:
 
     auto e = MantidVec(3, 1);
 
-    return create1DWorkspace(x, y, e);
+    return createWorkspace(x, y, e);
   }
 
   MatrixWorkspace_sptr make_arbitrary_histogram_ws()
@@ -119,7 +120,33 @@ private:
 
     auto e = MantidVec(2, 1);
 
-    return create1DWorkspace(x, y, e);
+    return createWorkspace(x, y, e);
+  }
+
+  MatrixWorkspace_sptr createCosWaveWorkspace(const double startX, const double endX)
+  {
+
+    MantidVec xValues;
+    MantidVec yValues;
+    for (double x = startX; x <= endX; x += 1.0)
+    {
+      xValues.push_back(x);
+      yValues.push_back(std::cos(x));
+    }
+    yValues.pop_back();
+
+    auto createWorkspace = AlgorithmManager::Instance().create("CreateWorkspace");
+    createWorkspace->setChild(true);
+    createWorkspace->initialize();
+    createWorkspace->setProperty("UnitX", "x");
+    createWorkspace->setProperty("DataX", xValues);
+    createWorkspace->setProperty("DataY", yValues);
+    createWorkspace->setProperty("NSpec", 1);
+    createWorkspace->setPropertyValue("OutputWorkspace", "dummy");
+    createWorkspace->execute();
+    MatrixWorkspace_sptr outWS = createWorkspace->getProperty("OutputWorkspace");
+
+    return outWS;
   }
 
 public:
@@ -148,15 +175,29 @@ public:
     MantidVec y = boost::assign::list_of(0)(0)(0)(3)(3)(3)(3)(3)(3)(3).convert_to_container<MantidVec>();
 
     // Pre-canned workspace to stitch
-    a = create1DWorkspace(x, y, e);
+    a = createWorkspace(x, y, e);
 
     y = boost::assign::list_of(2)(2)(2)(2)(2)(2)(2)(0)(0)(0).convert_to_container<MantidVec>();
     // Another pre-canned workspace to stitch
-    b = create1DWorkspace(x, y, e);
+    b = createWorkspace(x, y, e);
   }
 
-  ResultType do_stitch1D(MatrixWorkspace_sptr& lhs, MatrixWorkspace_sptr& rhs,
-    const MantidVec& params)
+  ResultType do_stitch1D(MatrixWorkspace_sptr& lhs, MatrixWorkspace_sptr& rhs)
+  {
+    Stitch1D alg;
+    alg.setChild(true);
+    alg.setRethrows(true);
+    alg.initialize();
+    alg.setProperty("LHSWorkspace", lhs);
+    alg.setProperty("RHSWorkspace", rhs);
+    alg.setPropertyValue("OutputWorkspace", "dummy_value");
+    alg.execute();
+    MatrixWorkspace_sptr stitched = alg.getProperty("OutputWorkspace");
+    double scaleFactor = alg.getProperty("OutScaleFactor");
+    return ResultType(stitched, scaleFactor);
+  }
+
+  ResultType do_stitch1D(MatrixWorkspace_sptr& lhs, MatrixWorkspace_sptr& rhs, const MantidVec& params)
   {
     Stitch1D alg;
     alg.setChild(true);
@@ -172,8 +213,9 @@ public:
     return ResultType(stitched, scaleFactor);
   }
 
-  ResultType do_stitch1D(MatrixWorkspace_sptr& lhs, MatrixWorkspace_sptr& rhs, bool scaleRHS, bool useManualScaleFactor,
-    const double& startOverlap, const double& endOverlap, const MantidVec& params, const double& manualScaleFactor)
+  ResultType do_stitch1D(MatrixWorkspace_sptr& lhs, MatrixWorkspace_sptr& rhs, bool scaleRHS,
+      bool useManualScaleFactor, const double& startOverlap, const double& endOverlap,
+      const MantidVec& params, const double& manualScaleFactor)
   {
     Stitch1D alg;
     alg.setChild(true);
@@ -195,7 +237,8 @@ public:
   }
 
   ResultType do_stitch1D(MatrixWorkspace_sptr& lhs, MatrixWorkspace_sptr& rhs,
-    const double& startOverlap, const double& endOverlap, const MantidVec& params, bool scaleRHS = true)
+      const double& startOverlap, const double& endOverlap, const MantidVec& params,
+      bool scaleRHS = true)
   {
     Stitch1D alg;
     alg.setChild(true);
@@ -214,8 +257,8 @@ public:
     return ResultType(stitched, scaleFactor);
   }
 
-  ResultType do_stitch1D(MatrixWorkspace_sptr& lhs, MatrixWorkspace_sptr& rhs,
-    const double& overlap, const MantidVec& params, const bool startoverlap)
+  ResultType do_stitch1D(MatrixWorkspace_sptr& lhs, MatrixWorkspace_sptr& rhs, const double& overlap,
+      const MantidVec& params, const bool startoverlap)
   {
     Stitch1D alg;
     alg.setChild(true);
@@ -249,8 +292,8 @@ public:
   void test_startoverlap_greater_than_end_overlap_throws()
   {
     TSM_ASSERT_THROWS("Should have thrown with StartOverlap < x max",
-      do_stitch1D(this->a, this->b, this->x.back(), this->x.front(), MantidVec(1, 0.2)),
-      std::runtime_error&);
+        do_stitch1D(this->a, this->b, this->x.back(), this->x.front(), MantidVec(1, 0.2)),
+        std::runtime_error&);
   }
 
   void test_lhsworkspace_must_be_histogram()
@@ -258,7 +301,7 @@ public:
     auto lhs_ws = make_arbitrary_point_ws();
     auto rhs_ws = make_arbitrary_histogram_ws();
     TSM_ASSERT_THROWS("LHS WS must be histogram", do_stitch1D(lhs_ws, rhs_ws, -1, 1, MantidVec(1, 0.2)),
-      std::invalid_argument&);
+        std::invalid_argument&);
   }
 
   void test_rhsworkspace_must_be_histogram()
@@ -266,7 +309,7 @@ public:
     auto lhs_ws = make_arbitrary_histogram_ws();
     auto rhs_ws = make_arbitrary_point_ws();
     TSM_ASSERT_THROWS("RHS WS must be histogram", do_stitch1D(lhs_ws, rhs_ws, -1, 1, MantidVec(1, 0.2)),
-      std::invalid_argument&);
+        std::invalid_argument&);
   }
 
   void test_stitching_uses_suppiled_params()
@@ -285,15 +328,19 @@ public:
 
   void test_stitching_determines_params()
   {
-    MantidVec x1 = boost::assign::list_of(-1.0)(-0.8)(-0.6)(-0.4)(-0.2)(0.0)(0.2)(0.4)(0.6)(0.8).convert_to_container<MantidVec>();
-    MantidVec x2 = boost::assign::list_of(0.4)(0.6)(0.8)(1.0)(1.2)(1.4)(1.6).convert_to_container<MantidVec>();
+    MantidVec x1 =
+        boost::assign::list_of(-1.0)(-0.8)(-0.6)(-0.4)(-0.2)(0.0)(0.2)(0.4)(0.6)(0.8).convert_to_container<
+            MantidVec>();
+    MantidVec x2 = boost::assign::list_of(0.4)(0.6)(0.8)(1.0)(1.2)(1.4)(1.6).convert_to_container<
+        MantidVec>();
     MantidVec y1 = boost::assign::list_of(1)(1)(1)(1)(1)(1)(1)(1)(1).convert_to_container<MantidVec>();
     MantidVec y2 = boost::assign::list_of(1)(1)(1)(1)(1)(1).convert_to_container<MantidVec>();
 
     MatrixWorkspace_sptr ws1 = create1DWorkspace(x1, y1);
     MatrixWorkspace_sptr ws2 = create1DWorkspace(x2, y2);
     double demanded_step_size = 0.2;
-    auto ret = do_stitch1D(ws1,ws2,0.4,1.0,boost::assign::list_of(demanded_step_size).convert_to_container<MantidVec>());
+    auto ret = do_stitch1D(ws1, ws2, 0.4, 1.0,
+        boost::assign::list_of(demanded_step_size).convert_to_container<MantidVec>());
 
     //Check the ranges on the output workspace against the param inputs.
     MantidVec out_x_values = ret.get<0>()->readX(0);
@@ -308,16 +355,19 @@ public:
 
   void test_stitching_determines_start_and_end_overlap()
   {
-    MantidVec x1 = boost::assign::list_of(-1.0)(-0.8)(-0.6)(-0.4)(-0.2)(0.0)(0.2)(0.4).convert_to_container<MantidVec>();
-    MantidVec x2 = boost::assign::list_of(-0.4)(-0.2)(0.0)(0.2)(0.4)(0.6)(0.8)(1.0).convert_to_container<MantidVec>();
-    
+    MantidVec x1 =
+        boost::assign::list_of(-1.0)(-0.8)(-0.6)(-0.4)(-0.2)(0.0)(0.2)(0.4).convert_to_container<
+            MantidVec>();
+    MantidVec x2 = boost::assign::list_of(-0.4)(-0.2)(0.0)(0.2)(0.4)(0.6)(0.8)(1.0).convert_to_container<
+        MantidVec>();
+
     MantidVec y1 = boost::assign::list_of(1)(1)(1)(3)(3)(3)(3).convert_to_container<MantidVec>();
     MantidVec y2 = boost::assign::list_of(1)(1)(1)(1)(3)(3)(3).convert_to_container<MantidVec>();
 
     MatrixWorkspace_sptr ws1 = create1DWorkspace(x1, y1);
     MatrixWorkspace_sptr ws2 = create1DWorkspace(x2, y2);
     MantidVec params = boost::assign::list_of(-1.0)(0.2)(1.0).convert_to_container<MantidVec>();
-    auto ret = do_stitch1D(ws1,ws2,params);
+    auto ret = do_stitch1D(ws1, ws2, params);
 
     MantidVec stitched_y = ret.get<0>()->readY(0);
     MantidVec stitched_x = ret.get<0>()->readX(0);
@@ -332,23 +382,26 @@ public:
     }
 
     double start_overlap_determined = stitched_x[overlap_indexes[0]];
-    double end_overlap_determined = stitched_x[overlap_indexes[overlap_indexes.size()-1]];
+    double end_overlap_determined = stitched_x[overlap_indexes[overlap_indexes.size() - 1]];
     TS_ASSERT_DELTA(start_overlap_determined, -0.4, 0.000000001);
     TS_ASSERT_DELTA(end_overlap_determined, 0.2, 0.000000001);
   }
 
   void test_stitching_forces_start_overlap()
   {
-    MantidVec x1 = boost::assign::list_of(-1.0)(-0.8)(-0.6)(-0.4)(-0.2)(0.0)(0.2)(0.4).convert_to_container<MantidVec>();
-    MantidVec x2 = boost::assign::list_of(-0.4)(-0.2)(0.0)(0.2)(0.4)(0.6)(0.8)(1.0).convert_to_container<MantidVec>();
-    
+    MantidVec x1 =
+        boost::assign::list_of(-1.0)(-0.8)(-0.6)(-0.4)(-0.2)(0.0)(0.2)(0.4).convert_to_container<
+            MantidVec>();
+    MantidVec x2 = boost::assign::list_of(-0.4)(-0.2)(0.0)(0.2)(0.4)(0.6)(0.8)(1.0).convert_to_container<
+        MantidVec>();
+
     MantidVec y1 = boost::assign::list_of(1)(1)(1)(3)(3)(3)(3).convert_to_container<MantidVec>();
     MantidVec y2 = boost::assign::list_of(1)(1)(1)(1)(3)(3)(3).convert_to_container<MantidVec>();
 
     MatrixWorkspace_sptr ws1 = create1DWorkspace(x1, y1);
     MatrixWorkspace_sptr ws2 = create1DWorkspace(x2, y2);
     MantidVec params = boost::assign::list_of(-1.0)(0.2)(1.0).convert_to_container<MantidVec>();
-    auto ret = do_stitch1D(ws1,ws2,-0.5,params,true);
+    auto ret = do_stitch1D(ws1, ws2, -0.5, params, true);
 
     MantidVec stitched_y = ret.get<0>()->readY(0);
     MantidVec stitched_x = ret.get<0>()->readX(0);
@@ -363,23 +416,26 @@ public:
     }
 
     double start_overlap_determined = stitched_x[overlap_indexes[0]];
-    double end_overlap_determined = stitched_x[overlap_indexes[overlap_indexes.size()-1]];
+    double end_overlap_determined = stitched_x[overlap_indexes[overlap_indexes.size() - 1]];
     TS_ASSERT_DELTA(start_overlap_determined, -0.4, 0.000000001);
     TS_ASSERT_DELTA(end_overlap_determined, 0.2, 0.000000001);
   }
 
   void test_stitching_forces_end_overlap()
   {
-    MantidVec x1 = boost::assign::list_of(-1.0)(-0.8)(-0.6)(-0.4)(-0.2)(0.0)(0.2)(0.4).convert_to_container<MantidVec>();
-    MantidVec x2 = boost::assign::list_of(-0.4)(-0.2)(0.0)(0.2)(0.4)(0.6)(0.8)(1.0).convert_to_container<MantidVec>();
-    
+    MantidVec x1 =
+        boost::assign::list_of(-1.0)(-0.8)(-0.6)(-0.4)(-0.2)(0.0)(0.2)(0.4).convert_to_container<
+            MantidVec>();
+    MantidVec x2 = boost::assign::list_of(-0.4)(-0.2)(0.0)(0.2)(0.4)(0.6)(0.8)(1.0).convert_to_container<
+        MantidVec>();
+
     MantidVec y1 = boost::assign::list_of(1)(1)(1)(3)(3)(3)(3).convert_to_container<MantidVec>();
     MantidVec y2 = boost::assign::list_of(1)(1)(1)(1)(3)(3)(3).convert_to_container<MantidVec>();
 
     MatrixWorkspace_sptr ws1 = create1DWorkspace(x1, y1);
     MatrixWorkspace_sptr ws2 = create1DWorkspace(x2, y2);
     MantidVec params = boost::assign::list_of(-1.0)(0.2)(1.0).convert_to_container<MantidVec>();
-    auto ret = do_stitch1D(ws1,ws2,0.5,params,false);
+    auto ret = do_stitch1D(ws1, ws2, 0.5, params, false);
 
     MantidVec stitched_y = ret.get<0>()->readY(0);
     MantidVec stitched_x = ret.get<0>()->readX(0);
@@ -394,7 +450,7 @@ public:
     }
 
     double start_overlap_determined = stitched_x[overlap_indexes[0]];
-    double end_overlap_determined = stitched_x[overlap_indexes[overlap_indexes.size()-1]];
+    double end_overlap_determined = stitched_x[overlap_indexes[overlap_indexes.size() - 1]];
     TS_ASSERT_DELTA(start_overlap_determined, -0.4, 0.000000001);
     TS_ASSERT_DELTA(end_overlap_determined, 0.2, 0.000000001);
   }
@@ -420,20 +476,20 @@ public:
     for (auto itr = stitched_e.begin(); itr != stitched_e.end(); ++itr)
     {
       double temp = *itr;
-      TS_ASSERT_EQUALS(temp,0);
+      TS_ASSERT_EQUALS(temp, 0);
     }
     // Check that the output X-Values are correct.
     //truncate the input and oputput x values to 6 decimal places to eliminate insignificant error
     MantidVec xCopy = this->x;
-    std::transform(stitched_x.begin(),stitched_x.end(),stitched_x.begin(),roundSix);
-    std::transform(xCopy.begin(),xCopy.end(),xCopy.begin(),roundSix);
+    std::transform(stitched_x.begin(), stitched_x.end(), stitched_x.begin(), roundSix);
+    std::transform(xCopy.begin(), xCopy.end(), xCopy.begin(), roundSix);
     TS_ASSERT(xCopy == stitched_x);
   }
 
   void test_stitching_scale_left()
   {
     MantidVec params = boost::assign::list_of<double>(0.2).convert_to_container<MantidVec>();
-    auto ret = do_stitch1D(this->b, this->a, -0.4, 0.4, params,false);
+    auto ret = do_stitch1D(this->b, this->a, -0.4, 0.4, params, false);
 
     double scale = ret.get<1>();
     // Check the scale factor
@@ -451,20 +507,20 @@ public:
     for (auto itr = stitched_e.begin(); itr != stitched_e.end(); ++itr)
     {
       double temp = *itr;
-      TS_ASSERT_EQUALS(temp,0);
+      TS_ASSERT_EQUALS(temp, 0);
     }
     // Check that the output X-Values are correct.
     //truncate the input and oputput x values to 6 decimal places to eliminate insignificant error
     MantidVec xCopy = this->x;
-    std::transform(stitched_x.begin(),stitched_x.end(),stitched_x.begin(),roundSix);
-    std::transform(xCopy.begin(),xCopy.end(),xCopy.begin(),roundSix);
+    std::transform(stitched_x.begin(), stitched_x.end(), stitched_x.begin(), roundSix);
+    std::transform(xCopy.begin(), xCopy.end(), xCopy.begin(), roundSix);
     TS_ASSERT(xCopy == stitched_x);
   }
 
   void test_stitching_manual_scale_factor_scale_right()
   {
     MantidVec params = boost::assign::list_of<double>(0.2).convert_to_container<MantidVec>();
-    auto ret = do_stitch1D(this->b, this->a, true, true, -0.4, 0.4, params, 2.0/3.0);
+    auto ret = do_stitch1D(this->b, this->a, true, true, -0.4, 0.4, params, 2.0 / 3.0);
 
     double scale = ret.get<1>();
     // Check the scale factor
@@ -482,20 +538,20 @@ public:
     for (auto itr = stitched_e.begin(); itr != stitched_e.end(); ++itr)
     {
       double temp = *itr;
-      TS_ASSERT_EQUALS(temp,0);
+      TS_ASSERT_EQUALS(temp, 0);
     }
     // Check that the output X-Values are correct.
     //truncate the input and oputput x values to 6 decimal places to eliminate insignificant error
     MantidVec xCopy = this->x;
-    std::transform(stitched_x.begin(),stitched_x.end(),stitched_x.begin(),roundSix);
-    std::transform(xCopy.begin(),xCopy.end(),xCopy.begin(),roundSix);
+    std::transform(stitched_x.begin(), stitched_x.end(), stitched_x.begin(), roundSix);
+    std::transform(xCopy.begin(), xCopy.end(), xCopy.begin(), roundSix);
     TS_ASSERT(xCopy == stitched_x);
   }
 
   void test_stitching_manual_scale_factor_scale_left()
   {
     MantidVec params = boost::assign::list_of<double>(0.2).convert_to_container<MantidVec>();
-    auto ret = do_stitch1D(this->b, this->a, false, true, -0.4, 0.4, params, 3.0/2.0);
+    auto ret = do_stitch1D(this->b, this->a, false, true, -0.4, 0.4, params, 3.0 / 2.0);
 
     double scale = ret.get<1>();
     // Check the scale factor
@@ -513,15 +569,90 @@ public:
     for (auto itr = stitched_e.begin(); itr != stitched_e.end(); ++itr)
     {
       double temp = *itr;
-      TS_ASSERT_EQUALS(temp,0);
+      TS_ASSERT_EQUALS(temp, 0);
     }
     // Check that the output X-Values are correct.
     //truncate the input and oputput x values to 6 decimal places to eliminate insignificant error
     MantidVec xCopy = this->x;
-    std::transform(stitched_x.begin(),stitched_x.end(),stitched_x.begin(),roundSix);
-    std::transform(xCopy.begin(),xCopy.end(),xCopy.begin(),roundSix);
+    std::transform(stitched_x.begin(), stitched_x.end(), stitched_x.begin(), roundSix);
+    std::transform(xCopy.begin(), xCopy.end(), xCopy.begin(), roundSix);
     TS_ASSERT(xCopy == stitched_x);
   }
+
+  void test_params_causing_scaling_regression_test()
+  {
+    auto lhs = createCosWaveWorkspace(0, 10);
+    auto rhs = createCosWaveWorkspace(6, 20);
+
+    auto ret = do_stitch1D(lhs, rhs);
+
+    MatrixWorkspace_sptr outWS = ret.get<0>();
+    const double scaleFactor = ret.get<1>();
+
+    TSM_ASSERT_EQUALS("Two cosine waves in phase scale factor should be unity", 1.0, scaleFactor);
+    const double stitchedWSFirstYValue = outWS->readY(0)[0]; // Should be 1.0 at cos(0)
+    const double lhsWSFirstYValue = lhs->readY(0)[0]; // Should be 1.0 at cos(0)
+
+    TSM_ASSERT_EQUALS("No scaling of the output workspace should have occurred", stitchedWSFirstYValue,
+        lhsWSFirstYValue);
+  }
+
+  void test_has_non_zero_errors_single_spectrum()
+  {
+    auto x = MantidVec(10);
+    const double xstart = -1;
+    const double xstep = 0.2;
+    LinearSequence<MantidVec::value_type> sequenceX(xstart, xstep);
+    std::generate(x.begin(), x.end(), sequenceX);
+
+    auto y = MantidVec(x.size() - 1, 1);
+
+    auto e = MantidVec(x.size() - 1, 1); // All Non zero errors
+
+    MatrixWorkspace_sptr ws = createWorkspace(x, y, e, 1);
+    Stitch1D alg;
+    TSM_ASSERT("All error values are non-zero", alg.hasNonzeroErrors(ws));
+
+    // Run it again with all zeros
+    e = MantidVec(x.size() - 1, 0); // All zero errors
+    ws = createWorkspace(x, y, e, 1);
+    TSM_ASSERT("All error values are non-zero", !alg.hasNonzeroErrors(ws));
+
+    // Run it again with some zeros
+    e[e.size() - 1] = 1;
+    ws = createWorkspace(x, y, e, 1);
+    TSM_ASSERT("NOT all error values are non-zero", alg.hasNonzeroErrors(ws));
+  }
+
+  void test_has_non_zero_errors_multiple_spectrum()
+  {
+    const size_t nspectrum = 10;
+
+    auto x = MantidVec(10);
+    const double xstart = -1;
+    const double xstep = 0.2;
+    LinearSequence<MantidVec::value_type> sequenceX(xstart, xstep);
+    std::generate(x.begin(), x.end(), sequenceX);
+
+    auto y = MantidVec(nspectrum * (x.size() - 1), 1);
+    auto e = MantidVec(nspectrum * (x.size() - 1), 1); // Non zero errors
+
+    MatrixWorkspace_sptr ws = createWorkspace(x, y, e, static_cast<int>(nspectrum));
+    Stitch1D alg;
+    TSM_ASSERT("All error values are non-zero", alg.hasNonzeroErrors(ws));
+
+    // Run it again with all zeros
+    e = MantidVec(nspectrum * (x.size() - 1), 0); // All zero errors
+    ws = createWorkspace(x, y, e, nspectrum);
+    TSM_ASSERT("All error values are non-zero", !alg.hasNonzeroErrors(ws));
+
+    // Run it again with some zeros
+    e[e.size() - 1] = 1;
+    ws = createWorkspace(x, y, e, nspectrum);
+    TSM_ASSERT("NOT all error values are non-zero", alg.hasNonzeroErrors(ws));
+
+  }
+
 };
 
 #endif /* MANTID_ALGORITHMS_STITCH1DTEST_H_ */
diff --git a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt
index 06036ba4258144634d43a651b3655acae0453038..739905c09c96d30925d5fd0b031273a757b43c21 100644
--- a/Code/Mantid/Framework/CurveFitting/CMakeLists.txt
+++ b/Code/Mantid/Framework/CurveFitting/CMakeLists.txt
@@ -39,6 +39,7 @@ set ( SRC_FILES
 	src/FitPowderDiffPeaks.cpp
 	src/FlatBackground.cpp
 	src/FullprofPolynomial.cpp
+	src/FunctionDomain1DSpectrumCreator.cpp
 	src/GSLFunctions.cpp
 	src/GSLMatrix.cpp
 	src/GausDecay.cpp
@@ -73,6 +74,7 @@ set ( SRC_FILES
 	src/ReflectivityMulf.cpp
 	src/Resolution.cpp
 	src/SeqDomain.cpp
+	src/SeqDomainSpectrumCreator.cpp
 	src/SimplexMinimizer.cpp
 	src/SpecialFunctionHelper.cpp
 	src/SplineBackground.cpp
@@ -139,6 +141,7 @@ set ( INC_FILES
 	inc/MantidCurveFitting/FitPowderDiffPeaks.h
 	inc/MantidCurveFitting/FlatBackground.h
 	inc/MantidCurveFitting/FullprofPolynomial.h
+	inc/MantidCurveFitting/FunctionDomain1DSpectrumCreator.h
 	inc/MantidCurveFitting/GSLFunctions.h
 	inc/MantidCurveFitting/GSLJacobian.h
 	inc/MantidCurveFitting/GSLMatrix.h
@@ -176,6 +179,7 @@ set ( INC_FILES
 	inc/MantidCurveFitting/ReflectivityMulf.h
 	inc/MantidCurveFitting/Resolution.h
 	inc/MantidCurveFitting/SeqDomain.h
+	inc/MantidCurveFitting/SeqDomainSpectrumCreator.h
 	inc/MantidCurveFitting/SimplexMinimizer.h
 	inc/MantidCurveFitting/SpecialFunctionSupport.h
 	inc/MantidCurveFitting/SplineBackground.h
@@ -233,6 +237,7 @@ set ( TEST_FILES
 	FitPowderDiffPeaksTest.h
 	FlatBackgroundTest.h
 	FullprofPolynomialTest.h
+	FunctionDomain1DSpectrumCreatorTest.h
 	FunctionFactoryConstraintTest.h
 	GSLMatrixTest.h
 	GausDecayTest.h
@@ -266,6 +271,7 @@ set ( TEST_FILES
 	RefinePowderInstrumentParameters3Test.h
 	ReflectivityMulfTest.h
 	ResolutionTest.h
+	SeqDomainSpectrumCreatorTest.h
 	SimplexTest.h
 	SpecialFunctionSupportTest.h
 	SplineBackgroundTest.h
diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/CostFuncLeastSquares.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/CostFuncLeastSquares.h
index 7f3a948d636cd5bebcf238ce9be63c60fbcde703..a2e93210846dd557ab4c3ec04f19d271234d4804 100644
--- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/CostFuncLeastSquares.h
+++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/CostFuncLeastSquares.h
@@ -75,7 +75,6 @@ public:
 
   void setParameters(const GSLVector& params);
   void getParameters(GSLVector& params) const;
-
 protected:
 
   virtual void calActiveCovarianceMatrix(GSLMatrix& covar, double epsrel = 1e-8);
@@ -90,11 +89,8 @@ protected:
     API::FunctionValues_sptr values,
     bool evalFunction = true, bool evalDeriv = true, bool evalHessian = true) const;
 
-  /// Get weight (1/sigma)
-  virtual double getWeight(API::FunctionValues_sptr values, size_t i, double sqrtW=1.0) const;
-
-  /// Calcualte sqrt(W). Final cost function = sum_i [ (obs_i - cal_i) / (sigma * sqrt(W))]**2
-  virtual double calSqrtW(API::FunctionValues_sptr values) const;
+  /// Get mapped weights from FunctionValues
+  virtual std::vector<double> getFitWeights(API::FunctionValues_sptr values) const;
 
   /// Flag to include constraint in cost function value
   bool m_includePenalty;
diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/CostFuncRwp.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/CostFuncRwp.h
index 6df2e860cbd1f3f88ccb2bb5458f6a3ee5fac1af..e9399c15ec8627ce5e5342f4ac71fa7ca22cf113 100644
--- a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/CostFuncRwp.h
+++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/CostFuncRwp.h
@@ -60,11 +60,13 @@ public:
 
 private:
 
+  virtual std::vector<double> getFitWeights(API::FunctionValues_sptr values) const;
+
   /// Get weight (1/sigma)
-  virtual double getWeight(API::FunctionValues_sptr values, size_t i, double sqrtW=1.0) const;
+  double getWeight(API::FunctionValues_sptr values, size_t i, double sqrtW=1.0) const;
 
   /// Calcualte sqrt(W). Final cost function = sum_i [ (obs_i - cal_i) / (sigma * sqrt(W))]**2
-  virtual double calSqrtW(API::FunctionValues_sptr values) const;
+  double calSqrtW(API::FunctionValues_sptr values) const;
 
 };
 
diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/FunctionDomain1DSpectrumCreator.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/FunctionDomain1DSpectrumCreator.h
new file mode 100644
index 0000000000000000000000000000000000000000..4ef25335ffac116f18cf242a028b31fb2b88a608
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/FunctionDomain1DSpectrumCreator.h
@@ -0,0 +1,78 @@
+#ifndef MANTID_CURVEFITTING_FUNCTIONDOMAIN1DSPECTRUMCREATOR_H_
+#define MANTID_CURVEFITTING_FUNCTIONDOMAIN1DSPECTRUMCREATOR_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/IDomainCreator.h"
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/FunctionDomain1D.h"
+
+
+namespace Mantid
+{
+namespace CurveFitting
+{
+
+/** FunctionDomain1DSpectrumCreator :
+
+    FunctionDomain1DSpectrumCreator creates an FunctionDomain1DSpectrum using a given
+    MatrixWorkspace and workspace index. Currently it does not create an output workspace,
+    since it is exclusively used in a context where it's not required.
+
+      @author Michael Wedel, Paul Scherrer Institut - SINQ
+      @date 30/05/2014
+
+    Copyright © 2014 PSI-MSS
+
+    This file is part of Mantid.
+
+    Mantid 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.
+
+    Mantid 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.  If not, see <http://www.gnu.org/licenses/>.
+
+    File change history is stored at: <https://github.com/mantidproject/mantid>
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+
+  */
+using namespace API;
+
+class DLLExport FunctionDomain1DSpectrumCreator : public IDomainCreator
+{
+public:
+    FunctionDomain1DSpectrumCreator();
+    virtual ~FunctionDomain1DSpectrumCreator() { }
+
+    void setMatrixWorkspace(MatrixWorkspace_sptr matrixWorkspace);
+    void setWorkspaceIndex(size_t workspaceIndex);
+
+    virtual void createDomain(boost::shared_ptr<FunctionDomain> &domain,
+                         boost::shared_ptr<FunctionValues> &values,
+                         size_t i0 = 0);
+
+    virtual size_t getDomainSize() const;
+
+protected:
+    void throwIfWorkspaceInvalid() const;
+
+    MantidVec getVectorHistogram() const;
+    MantidVec getVectorNonHistogram() const;
+
+    MatrixWorkspace_sptr m_matrixWorkspace;
+    size_t m_workspaceIndex;
+    bool m_workspaceIndexIsSet;
+    
+};
+
+
+} // namespace CurveFitting
+} // namespace Mantid
+
+#endif  /* MANTID_CURVEFITTING_FUNCTIONDOMAIN1DSPECTRUMCREATOR_H_ */
diff --git a/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomainSpectrumCreator.h b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomainSpectrumCreator.h
new file mode 100644
index 0000000000000000000000000000000000000000..8454aa1f530a146d5180dac747bc7ea3e4a9ce59
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomainSpectrumCreator.h
@@ -0,0 +1,78 @@
+#ifndef MANTID_CURVEFITTING_SEQDOMAINSPECTRUMCREATOR_H_
+#define MANTID_CURVEFITTING_SEQDOMAINSPECTRUMCREATOR_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/IDomainCreator.h"
+#include "MantidAPI/FunctionDomain1D.h"
+#include "MantidAPI/MatrixWorkspace.h"
+
+namespace Mantid
+{
+namespace CurveFitting
+{
+
+/** SeqDomainSpectrumCreator :
+
+    SeqDomainSpectrumCreator creates a special type of SeqDomain, which contains
+    one FunctionDomain1DSpectrum for each histogram of the Workspace2D this
+    domain refers to. It can be used for functions that involve several histograms
+    at once.
+    
+      @author Michael Wedel, Paul Scherrer Institut - SINQ
+      @date 28/05/2014
+
+    Copyright © 2014 PSI-MSS
+
+    This file is part of Mantid.
+
+    Mantid 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.
+
+    Mantid 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.  If not, see <http://www.gnu.org/licenses/>.
+
+    File change history is stored at: <https://github.com/mantidproject/mantid>
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+  */
+
+using namespace API;
+
+class DLLExport SeqDomainSpectrumCreator : public IDomainCreator
+{
+public:
+    SeqDomainSpectrumCreator(Kernel::IPropertyManager* manager,
+                             const std::string& workspacePropertyName);
+
+    virtual ~SeqDomainSpectrumCreator() { }
+
+    virtual void createDomain(boost::shared_ptr<FunctionDomain> &domain,
+                              boost::shared_ptr<FunctionValues> &values,
+                              size_t i0 = 0);
+
+    virtual Workspace_sptr createOutputWorkspace(const std::string &baseName,
+                                       IFunction_sptr function,
+                                       boost::shared_ptr<FunctionDomain> domain,
+                                       boost::shared_ptr<FunctionValues> values,
+                                       const std::string &outputWorkspacePropertyName = "OutputWorkspace");
+    virtual size_t getDomainSize() const;
+
+protected:
+    void setParametersFromPropertyManager();
+    void setMatrixWorkspace(MatrixWorkspace_sptr matrixWorkspace);
+
+    std::string m_workspacePropertyName;
+    MatrixWorkspace_sptr m_matrixWorkspace;
+};
+
+
+} // namespace CurveFitting
+} // namespace Mantid
+
+#endif  /* MANTID_CURVEFITTING_SEQDOMAINSPECTRUMCREATOR_H_ */
diff --git a/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp b/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp
index 3724b8cd5bf5664dda28957991aada4f028b35a8..aab2583f9caa974de5c7544fe77d0770f9be6523 100644
--- a/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/CalculateGammaBackground.cpp
@@ -97,8 +97,10 @@ namespace Mantid
         "Indices of the spectra to include in the correction. If provided, the output only include these spectra\n"
         "(Default: all spectra from input)");
 
-      declareProperty(new WorkspaceProperty<>("BackgroundWorkspace", "", Direction::Output));
-      declareProperty(new WorkspaceProperty<>("CorrectedWorkspace", "", Direction::Output));
+      declareProperty(new WorkspaceProperty<>("BackgroundWorkspace", "", Direction::Output),
+                      "A new workspace containing the calculated background.");
+      declareProperty(new WorkspaceProperty<>("CorrectedWorkspace", "", Direction::Output),
+                      "A new workspace containing the calculated background subtracted from the input.");
     }
 
     void CalculateGammaBackground::exec()
diff --git a/Code/Mantid/Framework/CurveFitting/src/CostFuncLeastSquares.cpp b/Code/Mantid/Framework/CurveFitting/src/CostFuncLeastSquares.cpp
index e007636e43e2211249f7d7f2403361f7cf322e34..4d81c050d593c7609c56d93ecd607eab5118efec 100644
--- a/Code/Mantid/Framework/CurveFitting/src/CostFuncLeastSquares.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/CostFuncLeastSquares.cpp
@@ -92,12 +92,12 @@ void CostFuncLeastSquares::addVal(API::FunctionDomain_sptr domain, API::Function
 
   double retVal = 0.0;
 
-  double sqrtw = calSqrtW(values);
+  std::vector<double> weights = getFitWeights(values);
 
   for (size_t i = 0; i < ny; i++)
   {
     // double val = ( values->getCalculated(i) - values->getFitData(i) ) * values->getFitWeight(i);
-    double val = ( values->getCalculated(i) - values->getFitData(i) ) * getWeight(values, i, sqrtw);
+      double val = ( values->getCalculated(i) - values->getFitData(i) ) * weights[i];
     retVal += val * val;
   }
 
@@ -295,7 +295,9 @@ void CostFuncLeastSquares::addValDerivHessian(
       g_log.debug() << "\n";
     }
   }
-  double sqrtw = calSqrtW(values);
+
+  std::vector<double> weights = getFitWeights(values);
+
   for(size_t ip = 0; ip < np; ++ip)
   {
     if ( !function->isActive(ip) ) continue;
@@ -304,8 +306,7 @@ void CostFuncLeastSquares::addValDerivHessian(
     {
       double calc = values->getCalculated(i);
       double obs = values->getFitData(i);
-      // double w = values->getFitWeight(i);
-      double w =  getWeight(values, i, sqrtw);
+      double w =  weights[i];
       double y = ( calc - obs ) * w;
       d += y * jacobian.get(i,ip) * w;
       if (iActiveP == 0 && evalFunction)
@@ -344,7 +345,7 @@ void CostFuncLeastSquares::addValDerivHessian(
       for(size_t k = 0; k < ny; ++k) // over fitting data
       {
         // double w = values->getFitWeight(k);
-        double w = getWeight(values, k, sqrtw);
+        double w = weights[k];
         d += jacobian.get(k,i) * jacobian.get(k,j) * w * w;
       }
       PARALLEL_CRITICAL(hessian_set)
@@ -363,6 +364,16 @@ void CostFuncLeastSquares::addValDerivHessian(
   }
 }
 
+std::vector<double> CostFuncLeastSquares::getFitWeights(API::FunctionValues_sptr values) const
+{
+    std::vector<double> weights(values->size());
+    for(size_t i = 0; i < weights.size(); ++i) {
+        weights[i] = values->getFitWeight(i);
+    }
+
+    return weights;
+}
+
 /**
  * Return cached or calculate the drivatives.
  */
@@ -522,24 +533,5 @@ void CostFuncLeastSquares::calActiveCovarianceMatrix(GSLMatrix& covar, double ep
 
 }
 
-//----------------------------------------------------------------------------------------------
-/** Get weight of data point i(1/sigma)
-  */
-double CostFuncLeastSquares::getWeight(API::FunctionValues_sptr values, size_t i, double sqrtW) const
-{
-  UNUSED_ARG(sqrtW);
-  return (values->getFitWeight(i));
-}
-
-//----------------------------------------------------------------------------------------------
-/** Get square root of normalization weight (W)
-  */
-double CostFuncLeastSquares::calSqrtW(API::FunctionValues_sptr values) const
-{
-  UNUSED_ARG(values);
-
-  return 1.0;
-}
-
 } // namespace CurveFitting
 } // namespace Mantid
diff --git a/Code/Mantid/Framework/CurveFitting/src/CostFuncRwp.cpp b/Code/Mantid/Framework/CurveFitting/src/CostFuncRwp.cpp
index f4ca0da37f585ca5c5a94380c7c157d78beeb576..897caf2f56f3ec81933e5791466ebfe16d2afba9 100644
--- a/Code/Mantid/Framework/CurveFitting/src/CostFuncRwp.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/CostFuncRwp.cpp
@@ -30,6 +30,18 @@ CostFuncRwp::CostFuncRwp() : CostFuncLeastSquares()
   m_factor = 1.;
 }
 
+std::vector<double> CostFuncRwp::getFitWeights(API::FunctionValues_sptr values) const
+{
+    double sqrtW = calSqrtW(values);
+
+    std::vector<double> weights(values->size());
+    for(size_t i = 0; i < weights.size(); ++i) {
+        weights[i] = getWeight(values, i, sqrtW);
+    }
+
+    return weights;
+}
+
 //----------------------------------------------------------------------------------------------
 /** Get weight of data point i(1/sigma)
   */
diff --git a/Code/Mantid/Framework/CurveFitting/src/Fit.cpp b/Code/Mantid/Framework/CurveFitting/src/Fit.cpp
index 8fff51ac021647d95cea94e9f6ad5f764778255f..55e111db73505e8cf6a9f992edc4986e4a71141b 100644
--- a/Code/Mantid/Framework/CurveFitting/src/Fit.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/Fit.cpp
@@ -7,6 +7,7 @@
 #include "MantidCurveFitting/FitMW.h"
 #include "MantidCurveFitting/MultiDomainCreator.h"
 #include "MantidCurveFitting/Convolution.h"
+#include "MantidCurveFitting/SeqDomainSpectrumCreator.h"
 
 #include "MantidAPI/FuncMinimizerFactory.h"
 #include "MantidAPI/IFuncMinimizer.h"
@@ -20,6 +21,7 @@
 #include "MantidAPI/FunctionValues.h"
 #include "MantidAPI/IFunctionMW.h"
 #include "MantidAPI/IFunctionMD.h"
+#include "MantidAPI/IFunction1DSpectrum.h"
 #include "MantidAPI/MultiDomainFunction.h"
 #include "MantidAPI/ITableWorkspace.h"
 
@@ -159,7 +161,15 @@ namespace CurveFitting
     if ( boost::dynamic_pointer_cast<const API::MatrixWorkspace>(ws) &&
         !boost::dynamic_pointer_cast<API::IFunctionMD>(fun) )
     {
-      creator = new FitMW(this, workspacePropertyName, m_domainType);
+      /* IFunction1DSpectrum needs a different domain creator. If a function
+       * implements that type, we need to react appropriately at this point.
+       * Otherwise, the default creator FitMW is used.
+       */
+      if(boost::dynamic_pointer_cast<API::IFunction1DSpectrum>(fun)) {
+        creator = new SeqDomainSpectrumCreator(this, workspacePropertyName);
+      } else {
+        creator = new FitMW(this, workspacePropertyName, m_domainType);
+      }
     }
     else
     {
@@ -232,7 +242,15 @@ namespace CurveFitting
         if ( boost::dynamic_pointer_cast<const API::MatrixWorkspace>(ws) &&
             !boost::dynamic_pointer_cast<API::IFunctionMD>(m_function) )
         {
-          creator = new FitMW(this, workspacePropertyName, m_domainType);
+          /* IFunction1DSpectrum needs a different domain creator. If a function
+           * implements that type, we need to react appropriately at this point.
+           * Otherwise, the default creator FitMW is used.
+           */
+          if(boost::dynamic_pointer_cast<API::IFunction1DSpectrum>(m_function)) {
+            creator = new SeqDomainSpectrumCreator(this, workspacePropertyName);
+          } else {
+            creator = new FitMW(this, workspacePropertyName, m_domainType);
+          }
         }
         else
         {// don't know what to do with this workspace
diff --git a/Code/Mantid/Framework/CurveFitting/src/FunctionDomain1DSpectrumCreator.cpp b/Code/Mantid/Framework/CurveFitting/src/FunctionDomain1DSpectrumCreator.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4b24200b67496bc1c3ca671756f8d6a8e45817eb
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/src/FunctionDomain1DSpectrumCreator.cpp
@@ -0,0 +1,143 @@
+#include "MantidCurveFitting/FunctionDomain1DSpectrumCreator.h"
+
+namespace Mantid
+{
+namespace CurveFitting
+{
+
+using namespace API;
+
+
+/**
+ * Default Constructor.
+ */
+FunctionDomain1DSpectrumCreator::FunctionDomain1DSpectrumCreator() :
+    IDomainCreator(NULL, std::vector<std::string>(), FunctionDomain1DSpectrumCreator::Simple),
+    m_matrixWorkspace(),
+    m_workspaceIndex(0),
+    m_workspaceIndexIsSet(false)
+{
+}
+
+/**
+ * Sets the matrix workspace this creator is working with.
+ * @param matrixWorkspace :: Pointer to matrix workspace the domain is based on.
+ */
+void FunctionDomain1DSpectrumCreator::setMatrixWorkspace(MatrixWorkspace_sptr matrixWorkspace)
+{
+    m_matrixWorkspace = matrixWorkspace;
+}
+
+/**
+ * Sets the workspace index for the created domain. Does not perform any validity checks.
+ * @param workspaceIndex :: Index of spectrum for which the domain is created.
+ */
+void FunctionDomain1DSpectrumCreator::setWorkspaceIndex(size_t workspaceIndex)
+{
+    m_workspaceIndex = workspaceIndex;
+
+    m_workspaceIndexIsSet = true;
+}
+
+/**
+ * Creates the domain according to the stored MatrixWorkspace and workspace index.
+ *
+ * This method constructs a FunctionDomain1DSpectrum instance and set the domain and values parameters.
+ * If no workspace is present, the index is invalid or there are too few bins (0), the method throws std::invalid_argument.
+ *
+ * @param domain :: Pointer that holds the domain instance after the call.
+ * @param values :: Pointer that holds the function values instance after the call.
+ * @param i0 :: Size offset in case the FunctionValues object already contains data.
+ */
+void FunctionDomain1DSpectrumCreator::createDomain(boost::shared_ptr<FunctionDomain> &domain, boost::shared_ptr<FunctionValues> &values, size_t i0)
+{
+    throwIfWorkspaceInvalid();
+
+    if(m_matrixWorkspace->isHistogramData()) {
+        domain.reset(new FunctionDomain1DSpectrum(m_workspaceIndex, getVectorHistogram()));
+    } else {
+        domain.reset(new FunctionDomain1DSpectrum(m_workspaceIndex, getVectorNonHistogram()));
+    }
+
+    if(!values) {
+        values.reset(new FunctionValues(*domain));
+    } else {
+        values->expand(i0 + domain->size());
+    }
+
+    const MantidVec &yData = m_matrixWorkspace->readY(m_workspaceIndex);
+    const MantidVec &eData = m_matrixWorkspace->readE(m_workspaceIndex);
+
+    for(size_t i = 0; i < yData.size(); ++i) {
+        values->setFitData(i, yData[i]);
+        values->setFitWeight(i, eData[i] != 0 ? eData[i] : 1.0);
+    }
+}
+
+/**
+ * Returns the domain sizes.
+ *
+ * The function throws std::invalid_argument if the workspace, or the index are not valid.
+ *
+ * @return Domain size, depending on whether the MatrixWorkspace contains histogram data or not.
+ */
+size_t FunctionDomain1DSpectrumCreator::getDomainSize() const
+{
+    throwIfWorkspaceInvalid();
+
+    size_t numberOfXValues = m_matrixWorkspace->readX(m_workspaceIndex).size();
+
+    if(m_matrixWorkspace->isHistogramData()) {
+        return numberOfXValues - 1;
+    }
+
+    return numberOfXValues;
+}
+
+
+/// Checks the assigned MatrixWorkspace and workspace index.
+void FunctionDomain1DSpectrumCreator::throwIfWorkspaceInvalid() const
+{
+    if(!m_matrixWorkspace) {
+        throw std::invalid_argument("No matrix workspace assigned or does not contain histogram data - cannot create domain.");
+    }
+
+    if(!m_workspaceIndexIsSet || m_workspaceIndex >= m_matrixWorkspace->getNumberHistograms()) {
+        throw std::invalid_argument("Workspace index has not been set or is invalid.");
+    }
+}
+
+/// Returns vector with x-values of spectrum if MatrixWorkspace contains histogram data.
+MantidVec FunctionDomain1DSpectrumCreator::getVectorHistogram() const
+{
+    const MantidVec wsXData = m_matrixWorkspace->readX(m_workspaceIndex);
+    size_t wsXSize = wsXData.size();
+
+    if(wsXSize < 2) {
+        throw std::invalid_argument("Histogram Workspace2D with less than two x-values cannot be processed.");
+    }
+
+    MantidVec x(wsXSize - 1);
+
+    for(size_t i = 0; i < x.size(); ++i) {
+        x[i] = (wsXData[i] + wsXData[i + 1]) / 2.0;
+    }
+
+    return x;
+}
+
+/// Returns vector with x-values of spectrum if MatrixWorkspace does not contain histogram data.
+MantidVec FunctionDomain1DSpectrumCreator::getVectorNonHistogram() const
+{
+    const MantidVec wsXData = m_matrixWorkspace->readX(m_workspaceIndex);
+    size_t wsXSize = wsXData.size();
+
+    if(wsXSize < 1) {
+        throw std::invalid_argument("Workspace2D with less than one x-value cannot be processed.");
+    }
+
+    return MantidVec(wsXData);
+}
+
+} // namespace CurveFitting
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/CurveFitting/src/NormaliseByPeakArea.cpp b/Code/Mantid/Framework/CurveFitting/src/NormaliseByPeakArea.cpp
index 6a1d1ccddab827b8749e7eec631246c9a753356f..9023014e8f7d9cb0b530119c08381cedf64f1477 100644
--- a/Code/Mantid/Framework/CurveFitting/src/NormaliseByPeakArea.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/NormaliseByPeakArea.cpp
@@ -63,7 +63,8 @@ namespace Mantid
       mustBePositive->setLower(0.0);
       mustBePositive->setLowerExclusive(true); //strictly greater than 0.0
       declareProperty("Mass",-1.0,mustBePositive,"The mass, in AMU, defining the recoil peak to fit");
-      declareProperty("Sum", true, "If true all spectra are summed in quadrature to produce the final result");
+      declareProperty("Sum", true, "If true all spectra on the Y-space, fitted & symmetrised workspaces "
+                      "are summed in quadrature to produce the final result");
 
       declareProperty(new WorkspaceProperty<>("OutputWorkspace","",Direction::Output),
                       "Input workspace normalised by the fitted peak area");
diff --git a/Code/Mantid/Framework/CurveFitting/src/SeqDomainSpectrumCreator.cpp b/Code/Mantid/Framework/CurveFitting/src/SeqDomainSpectrumCreator.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0f479cdb408845883a9d5de222245bc90f3b1355
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/src/SeqDomainSpectrumCreator.cpp
@@ -0,0 +1,178 @@
+#include "MantidCurveFitting/SeqDomainSpectrumCreator.h"
+#include "MantidAPI/Workspace.h"
+#include "MantidCurveFitting/SeqDomain.h"
+#include "MantidCurveFitting/FunctionDomain1DSpectrumCreator.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidCurveFitting/Jacobian.h"
+#include "MantidKernel/Matrix.h"
+#include "MantidAPI/WorkspaceProperty.h"
+
+namespace Mantid
+{
+namespace CurveFitting
+{
+
+using namespace API;
+
+/**
+ * Constructor
+ *
+ * Manager can be a null-pointer if required in a context where no PropertyManager is available. The same for the second argument,
+ * it can be an empty string if the functionality is not required.
+ *
+ * @param manager :: Pointer to IPropertyManager instance.
+ * @param workspacePropertyName :: Name of the output property for a created workspace in case a PropertyManager is used.
+ */
+SeqDomainSpectrumCreator::SeqDomainSpectrumCreator(Kernel::IPropertyManager *manager, const std::string &workspacePropertyName) :
+    IDomainCreator(manager, std::vector<std::string>(1, workspacePropertyName), SeqDomainSpectrumCreator::Sequential),
+    m_matrixWorkspace()
+{
+    m_workspacePropertyName = m_workspacePropertyNames.front();
+}
+
+/**
+ * Creates a sequential domain corresponding to the assigned MatrixWorkspace
+ *
+ * For each spectrum in the workspace, a FunctionDomain1DSpectrumCreator is constructed and added to a SeqDomain. This way
+ * each spectrum of the workspace is represented by its own, independent domain.
+ *
+ * @param domain :: Pointer to outgoing FunctionDomain instance.
+ * @param values :: Pointer to outgoing FunctionValues object.
+ * @param i0 :: Size offset for values object if it already contains data.
+ */
+void SeqDomainSpectrumCreator::createDomain(boost::shared_ptr<FunctionDomain> &domain, boost::shared_ptr<FunctionValues> &values, size_t i0)
+{
+    setParametersFromPropertyManager();
+
+    if(!m_matrixWorkspace) {
+        throw std::invalid_argument("No matrix workspace assigned - can not create domain.");
+    }
+
+    SeqDomain *seqDomain = SeqDomain::create(m_domainType);
+
+    size_t numberOfHistograms = m_matrixWorkspace->getNumberHistograms();
+    for(size_t i = 0; i < numberOfHistograms; ++i) {
+        FunctionDomain1DSpectrumCreator *spectrumDomain = new FunctionDomain1DSpectrumCreator;
+        spectrumDomain->setMatrixWorkspace(m_matrixWorkspace);
+        spectrumDomain->setWorkspaceIndex(i);
+
+        seqDomain->addCreator(IDomainCreator_sptr(spectrumDomain));
+    }
+
+    domain.reset(seqDomain);
+
+    if(!values) {
+        values.reset(new FunctionValues(*domain));
+    } else {
+        values->expand(i0 + domain->size());
+    }
+
+}
+
+/**
+ * Creates an output workspace using the given function and domain
+ *
+ * This method creates a MatrixWorkspace with the same dimensions as the input workspace that was assigned before or throws
+ * std::invalid_argument if no valid workspace is present. The method also checks that the provided domain is a SeqDomain.
+ * The function needs to be able to handle a FunctionDomain1D-domain. If all requirements are met, an output workspace
+ * is created and populated with the calculated values.
+ *
+ * @param baseName :: Basename for output workspace.
+ * @param function :: Function that can handle a FunctionDomain1D-domain.
+ * @param domain :: Pointer to SeqDomain instance.
+ * @param values :: Pointer to FunctionValues instance, currently not used.
+ * @param outputWorkspacePropertyName :: Name of output workspace property, if used.
+ * @return MatrixWorkspace with calculated values.
+ */
+
+Workspace_sptr SeqDomainSpectrumCreator::createOutputWorkspace(const std::string &baseName, IFunction_sptr function, boost::shared_ptr<FunctionDomain> domain, boost::shared_ptr<FunctionValues> values, const std::string &outputWorkspacePropertyName)
+{
+    // don't need values, since the values need to be calculated spectrum by spectrum (see loop below).
+    UNUSED_ARG(values);
+
+    boost::shared_ptr<SeqDomain> seqDomain = boost::dynamic_pointer_cast<SeqDomain>(domain);
+
+    if(!seqDomain) {
+        throw std::invalid_argument("CreateOutputWorkspace requires SeqDomain.");
+    }
+
+    if(!m_matrixWorkspace) {
+        throw std::invalid_argument("No MatrixWorkspace assigned. Cannot construct proper output workspace.");
+    }
+
+    MatrixWorkspace_sptr outputWs = boost::dynamic_pointer_cast<MatrixWorkspace>(WorkspaceFactory::Instance().create(m_matrixWorkspace));
+
+    for(size_t i = 0; i < seqDomain->getNDomains(); ++i) {
+        FunctionDomain_sptr localDomain;
+        FunctionValues_sptr localValues;
+
+        seqDomain->getDomainAndValues(i, localDomain, localValues);
+        function->function(*localDomain, *localValues);
+
+        const MantidVec& originalXValue = m_matrixWorkspace->readX(i);
+        MantidVec& xValues = outputWs->dataX(i);
+        assert(xValues.size() == originalXValue.size());
+        MantidVec& yValues = outputWs->dataY(i);
+
+        xValues.assign( originalXValue.begin(), originalXValue.end() );
+        for(size_t j = 0; j < yValues.size(); ++j) {
+            yValues[j] = localValues->getCalculated(j);
+        }
+    }
+
+    if(m_manager && !outputWorkspacePropertyName.empty()) {
+        declareProperty(new WorkspaceProperty<MatrixWorkspace>(outputWorkspacePropertyName, "", Kernel::Direction::Output),
+                        "Result workspace");
+
+        m_manager->setPropertyValue(outputWorkspacePropertyName, baseName + "Workspace");
+        m_manager->setProperty(outputWorkspacePropertyName, outputWs);
+    }
+
+    return outputWs;
+}
+
+/**
+ * Returns the domain size. Throws if no MatrixWorkspace has been set.
+ *
+ * @return Total domain size.
+ */
+size_t SeqDomainSpectrumCreator::getDomainSize() const
+{
+    if(!m_matrixWorkspace) {
+        throw std::invalid_argument("No matrix workspace assigned.");
+    }
+
+    size_t nHist = m_matrixWorkspace->getNumberHistograms();
+    size_t totalSize = 0;
+
+    for(size_t i = 0; i < nHist; ++i) {
+        totalSize += m_matrixWorkspace->dataY(i).size();
+    }
+
+    return totalSize;
+}
+
+/// Tries to extract a workspace from the assigned property manager.
+void SeqDomainSpectrumCreator::setParametersFromPropertyManager()
+{
+    if(m_manager) {
+        Workspace_sptr workspace = m_manager->getProperty(m_workspacePropertyName);
+
+        setMatrixWorkspace(boost::dynamic_pointer_cast<MatrixWorkspace>(workspace));
+    }
+}
+
+/// Sets the MatrixWorkspace the created domain is based on.
+void SeqDomainSpectrumCreator::setMatrixWorkspace(MatrixWorkspace_sptr matrixWorkspace)
+{
+    if(!matrixWorkspace) {
+        throw std::invalid_argument("InputWorkspace must be a valid MatrixWorkspace.");
+    }
+
+    m_matrixWorkspace = matrixWorkspace;
+}
+
+
+
+} // namespace CurveFitting
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/CurveFitting/test/FunctionDomain1DSpectrumCreatorTest.h b/Code/Mantid/Framework/CurveFitting/test/FunctionDomain1DSpectrumCreatorTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a9ae0f20659ce267a47b0db06d504ef79c82ad8
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/test/FunctionDomain1DSpectrumCreatorTest.h
@@ -0,0 +1,161 @@
+#ifndef MANTID_CURVEFITTING_FUNCTIONDOMAIN1DSPECTRUMCREATORTEST_H_
+#define MANTID_CURVEFITTING_FUNCTIONDOMAIN1DSPECTRUMCREATORTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidCurveFitting/FunctionDomain1DSpectrumCreator.h"
+#include "MantidAPI/FunctionDomain.h"
+#include "MantidAPI/FunctionValues.h"
+
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+
+using Mantid::CurveFitting::FunctionDomain1DSpectrumCreator;
+
+using namespace Mantid::API;
+
+class FunctionDomain1DSpectrumCreatorTest : public CxxTest::TestSuite
+{
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static FunctionDomain1DSpectrumCreatorTest *createSuite() { return new FunctionDomain1DSpectrumCreatorTest(); }
+  static void destroySuite( FunctionDomain1DSpectrumCreatorTest *suite ) { delete suite; }
+
+  void testInstantiation()
+  {
+      TS_ASSERT_THROWS_NOTHING(FunctionDomain1DSpectrumCreator creator;)
+  }
+
+  void testDefaultConstructor()
+  {
+      TestableFunctionDomain1DSpectrumCreator creator;
+
+      TS_ASSERT_EQUALS(creator.m_workspaceIndexIsSet, false);
+      TS_ASSERT(!creator.m_matrixWorkspace);
+      TS_ASSERT_THROWS(creator.getDomainSize(), std::invalid_argument);
+
+      FunctionDomain_sptr domain;
+      FunctionValues_sptr values;
+      TS_ASSERT_THROWS(creator.createDomain(domain, values), std::invalid_argument);
+  }
+
+  void testSetWorkspaceIndex()
+  {
+      TestableFunctionDomain1DSpectrumCreator creator;
+
+      creator.setWorkspaceIndex(10);
+
+      TS_ASSERT_EQUALS(creator.m_workspaceIndex, 10);
+      TS_ASSERT_EQUALS(creator.m_workspaceIndexIsSet, true);
+  }
+
+  void testSetMatrixWorkspace()
+  {
+      TestableFunctionDomain1DSpectrumCreator creator;
+
+      MatrixWorkspace_sptr matrixWs = WorkspaceCreationHelper::Create2DWorkspace123(10, 15);
+      creator.setMatrixWorkspace(matrixWs);
+
+      TS_ASSERT_EQUALS(creator.m_matrixWorkspace->getNumberHistograms(), 10);
+      TS_ASSERT_EQUALS(creator.m_matrixWorkspace->readX(0).size(), 15);
+      TS_ASSERT_EQUALS(creator.m_matrixWorkspace->readX(0)[0], 1.0);
+      TS_ASSERT_EQUALS(creator.m_matrixWorkspace->readX(4)[0], 1.0);
+  }
+
+  void testThrowIfWorkspaceInvalid()
+  {
+      TestableFunctionDomain1DSpectrumCreator creator;
+
+      // throws, because workspace and index are not set.
+      TS_ASSERT_THROWS(creator.throwIfWorkspaceInvalid(), std::invalid_argument);
+
+      creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspace123(10, 15));
+      // still throws, since workspace index has not been set explicitly.
+      TS_ASSERT_THROWS(creator.throwIfWorkspaceInvalid(), std::invalid_argument);
+
+      creator.setWorkspaceIndex(4);
+      TS_ASSERT_THROWS_NOTHING(creator.throwIfWorkspaceInvalid());
+
+      creator.setWorkspaceIndex(34);
+      // throws also, because index is invalid
+      TS_ASSERT_THROWS(creator.throwIfWorkspaceInvalid(), std::invalid_argument);
+  }
+
+  void testGetVectorHistogram()
+  {
+      TestableFunctionDomain1DSpectrumCreator creator;
+      creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspaceBinned(1, 5, 0.0, 1.0));
+      creator.setWorkspaceIndex(0);
+
+      std::vector<double> xValues = creator.getVectorHistogram();
+
+      TS_ASSERT_EQUALS(xValues.size(), 5);
+      for(size_t i = 0; i < xValues.size(); ++i) {
+          TS_ASSERT_EQUALS(xValues[i], (static_cast<double>(i) + 0.5) * 1.0);
+      }
+  }
+
+  void testGetVectorNonHistogram()
+  {
+      TestableFunctionDomain1DSpectrumCreator creator;
+      creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspace123(1, 5));
+      creator.setWorkspaceIndex(0);
+
+      std::vector<double> xValues = creator.getVectorNonHistogram();
+
+      TS_ASSERT_EQUALS(xValues.size(), 5);
+
+      std::vector<double> xValuesWs = creator.m_matrixWorkspace->readX(0);
+
+      for(size_t i = 0; i < xValues.size(); ++i) {
+          TS_ASSERT_EQUALS(xValues[i], xValuesWs[i]);
+      }
+  }
+
+  void testGetDomainSize()
+  {
+      FunctionDomain1DSpectrumCreator creator;
+      creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspaceBinned(1, 5, 0.0, 1.0));
+      creator.setWorkspaceIndex(0);
+
+      TS_ASSERT_EQUALS(creator.getDomainSize(), 5);
+
+      creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspace123(1, 15));
+
+      TS_ASSERT_EQUALS(creator.getDomainSize(), 15);
+  }
+
+  void testCreateDomain()
+  {
+      TestableFunctionDomain1DSpectrumCreator creator;
+      creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspace123(1, 5));
+      creator.setWorkspaceIndex(0);
+
+      FunctionDomain_sptr domain;
+      FunctionValues_sptr values;
+
+      creator.createDomain(domain, values);
+
+      TS_ASSERT(domain);
+      TS_ASSERT(values);
+
+      boost::shared_ptr<FunctionDomain1DSpectrum> spectrum = boost::dynamic_pointer_cast<FunctionDomain1DSpectrum>(domain);
+
+      TS_ASSERT(spectrum);
+      TS_ASSERT_EQUALS(spectrum->getWorkspaceIndex(), 0);
+      TS_ASSERT_EQUALS(spectrum->size(), 5);
+  }
+
+
+private:
+  class TestableFunctionDomain1DSpectrumCreator : public FunctionDomain1DSpectrumCreator
+  {
+      friend class FunctionDomain1DSpectrumCreatorTest;
+  public:
+      TestableFunctionDomain1DSpectrumCreator() : FunctionDomain1DSpectrumCreator() { }
+      ~TestableFunctionDomain1DSpectrumCreator() { }
+  };
+};
+
+
+#endif /* MANTID_CURVEFITTING_FUNCTIONDOMAIN1DSPECTRUMCREATORTEST_H_ */
diff --git a/Code/Mantid/Framework/CurveFitting/test/SeqDomainSpectrumCreatorTest.h b/Code/Mantid/Framework/CurveFitting/test/SeqDomainSpectrumCreatorTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..ee1756b56d25f526a50c00baf1c302de3e46b714
--- /dev/null
+++ b/Code/Mantid/Framework/CurveFitting/test/SeqDomainSpectrumCreatorTest.h
@@ -0,0 +1,300 @@
+#ifndef MANTID_CURVEFITTING_SEQDOMAINSPECTRUMCREATORTEST_H_
+#define MANTID_CURVEFITTING_SEQDOMAINSPECTRUMCREATORTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidKernel/IPropertyManager.h"
+#include "MantidCurveFitting/SeqDomainSpectrumCreator.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+#include "MantidCurveFitting/SeqDomain.h"
+#include "MantidAPI/IFunction1DSpectrum.h"
+#include "MantidAPI/ParamFunction.h"
+
+#include "MantidCurveFitting/Fit.h"
+#include "MantidAPI/TableRow.h"
+#include "MantidAPI/FunctionFactory.h"
+
+#include "MantidAPI/FrameworkManager.h"
+#include "MantidAPI/AlgorithmManager.h"
+
+using namespace Mantid::Kernel;
+using namespace Mantid::API;
+using namespace Mantid::CurveFitting;
+
+class SeqDomainSpectrumCreatorTest : public CxxTest::TestSuite
+{
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static SeqDomainSpectrumCreatorTest *createSuite() { return new SeqDomainSpectrumCreatorTest(); }
+  static void destroySuite( SeqDomainSpectrumCreatorTest *suite ) { delete suite; }
+
+  SeqDomainSpectrumCreatorTest()
+  {
+      FrameworkManager::Instance();
+  }
+
+  void testConstructor()
+  {
+      TS_ASSERT_THROWS_NOTHING(SeqDomainSpectrumCreator creator(NULL, ""));
+
+      TestableSeqDomainSpectrumCreator otherCreator(NULL, "Test");
+
+      TS_ASSERT_EQUALS(otherCreator.m_workspacePropertyName, otherCreator.m_workspacePropertyNames.front());
+      TS_ASSERT_EQUALS(otherCreator.m_workspacePropertyName, "Test");
+  }
+
+  void testSetMatrixWorkspace()
+  {
+      TestableSeqDomainSpectrumCreator creator(NULL, "");
+      TS_ASSERT_THROWS_NOTHING(creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspace(5, 5)));
+
+      TS_ASSERT_EQUALS(creator.m_matrixWorkspace->getNumberHistograms(), 5);
+
+      TS_ASSERT_THROWS(creator.setMatrixWorkspace(MatrixWorkspace_sptr()), std::invalid_argument);
+  }
+
+  void testGetDomainSize()
+  {
+      TestableSeqDomainSpectrumCreator creator(NULL, "");
+      creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspace123(4, 12));
+
+      FunctionDomain_sptr domain;
+      FunctionValues_sptr values;
+
+      creator.createDomain(domain, values);
+
+      boost::shared_ptr<SeqDomain> seqDomain = boost::dynamic_pointer_cast<SeqDomain>(domain);
+
+      TS_ASSERT(seqDomain);
+      TS_ASSERT_EQUALS(seqDomain->getNDomains(), 4);
+      TS_ASSERT_EQUALS(seqDomain->size(), 4 * 12);
+  }
+
+  void testCreateDomain()
+  {
+      TestableSeqDomainSpectrumCreator creator(NULL, "");
+      creator.setMatrixWorkspace(WorkspaceCreationHelper::Create2DWorkspace123(4, 12));
+
+      FunctionDomain_sptr domain;
+      FunctionValues_sptr values;
+
+      creator.createDomain(domain, values);
+
+      boost::shared_ptr<SeqDomain> seqDomain = boost::dynamic_pointer_cast<SeqDomain>(domain);
+
+      for(size_t i = 0; i < seqDomain->getNDomains(); ++i) {
+          FunctionDomain_sptr localDomain;
+          FunctionValues_sptr localValues;
+
+          seqDomain->getDomainAndValues(i, localDomain, localValues);
+
+          boost::shared_ptr<FunctionDomain1DSpectrum> localSpectrumDomain = boost::dynamic_pointer_cast<FunctionDomain1DSpectrum>(localDomain);
+          TS_ASSERT(localSpectrumDomain);
+
+          TS_ASSERT_EQUALS(localSpectrumDomain->getWorkspaceIndex(), i);
+          TS_ASSERT_EQUALS(localSpectrumDomain->size(), 12);
+      }
+  }
+
+  void testCreateOutputWorkspace()
+  {
+      double slope = 2.0;
+      // all x values are 1.0
+      MatrixWorkspace_sptr matrixWs = WorkspaceCreationHelper::Create2DWorkspace123(4, 12);
+
+      TestableSeqDomainSpectrumCreator creator(NULL, "");
+      creator.setMatrixWorkspace(matrixWs);
+
+      FunctionDomain_sptr domain;
+      FunctionValues_sptr values;
+
+      creator.createDomain(domain, values);
+
+      IFunction_sptr testFunction(new SeqDomainCreatorTestFunction);
+      testFunction->initialize();
+      testFunction->setParameter("Slope", slope);
+
+      Workspace_sptr outputWs = creator.createOutputWorkspace("", testFunction, domain, values);
+
+      MatrixWorkspace_sptr outputWsMatrix = boost::dynamic_pointer_cast<MatrixWorkspace>(outputWs);
+      TS_ASSERT(outputWsMatrix);
+
+      TS_ASSERT_EQUALS(outputWsMatrix->getNumberHistograms(), matrixWs->getNumberHistograms());
+
+      // Spectrum 0: 0 + 2 * 1 -> All y-values should be 2
+      // Spectrum 1: 1 + 2 * 1 -> All y-values should be 3...etc.
+      for(size_t i = 0; i < outputWsMatrix->getNumberHistograms(); ++i) {
+          const std::vector<double> &x = outputWsMatrix->readX(i);
+          const std::vector<double> &y = outputWsMatrix->readY(i);
+
+          for(size_t j = 0; j < x.size(); ++j) {
+              TS_ASSERT_EQUALS(x[j], 1.0);
+              TS_ASSERT_EQUALS(y[j], static_cast<double>(i) + slope * x[j]);
+          }
+      }
+  }
+
+  void testFit()
+  {
+      double slope = 2.0;
+
+      MatrixWorkspace_sptr matrixWs = WorkspaceCreationHelper::Create2DWorkspace123(400, 500);
+      for(size_t i = 0; i < matrixWs->getNumberHistograms(); ++i) {
+          std::vector<double> &x = matrixWs->dataX(i);
+          std::vector<double> &y = matrixWs->dataY(i);
+          std::vector<double> &e = matrixWs->dataE(i);
+
+          for(size_t j = 0; j < x.size(); ++j) {
+              x[j] = static_cast<double>(j);
+              y[j] = static_cast<double>(i) + slope * x[j];
+              e[j] = 0.1 * y[j];
+          }
+      }
+
+      WorkspaceCreationHelper::addNoise(matrixWs, 0.0, -0.1, 0.1);
+
+      IFunction_sptr fun(new SeqDomainCreatorTestFunction);
+      fun->initialize();
+      fun->setParameter("Slope", 0.0);
+
+      Mantid::API::IAlgorithm_sptr fit = Mantid::API::AlgorithmManager::Instance().create("Fit");
+      fit->initialize();
+
+      fit->setProperty("Function",fun);
+      fit->setProperty("InputWorkspace",matrixWs);
+      fit->setProperty("CreateOutput",true);
+      fit->setProperty("Minimizer", "Levenberg-MarquardtMD");
+
+      fit->execute();
+
+      TS_ASSERT(fit->isExecuted());
+
+      TS_ASSERT_DELTA(fun->getParameter(0), 2.0, 1e-6);
+      TS_ASSERT_LESS_THAN(fun->getError(0), 1e-6);
+  }
+
+  void testFitComplex()
+  {
+      std::vector<double> slopes(40);
+      for(size_t i = 0; i < slopes.size(); ++i) {
+          slopes[i] = static_cast<double>(i);
+      }
+
+      MatrixWorkspace_sptr matrixWs = WorkspaceCreationHelper::Create2DWorkspace123(400, 50);
+      for(size_t i = 0; i < matrixWs->getNumberHistograms(); ++i) {
+          std::vector<double> &x = matrixWs->dataX(i);
+          std::vector<double> &y = matrixWs->dataY(i);
+          std::vector<double> &e = matrixWs->dataE(i);
+
+          for(size_t j = 0; j < x.size(); ++j) {
+              x[j] = static_cast<double>(j);
+              y[j] = static_cast<double>(i) + slopes[i % slopes.size()] * x[j];
+              e[j] = std::max(1.0, sqrt(y[j]));
+          }
+      }
+
+      //WorkspaceCreationHelper::addNoise(matrixWs, 0.0, -0.1, 0.1);
+
+      IFunction_sptr fun(new SeqDomainCreatorTestFunctionComplex);
+      fun->initialize();
+      for(size_t i = 0; i < slopes.size(); ++ i) {
+        fun->setParameter(i, static_cast<double>(i) + 1.1);
+      }
+
+      Mantid::API::IAlgorithm_sptr fit = Mantid::API::AlgorithmManager::Instance().create("Fit");
+      fit->initialize();
+
+      fit->setProperty("Function",fun);
+      fit->setProperty("InputWorkspace",matrixWs);
+      fit->setProperty("CreateOutput",true);
+      fit->setProperty("Minimizer", "Levenberg-MarquardtMD");
+
+      fit->execute();
+
+      TS_ASSERT(fit->isExecuted());
+
+      for(size_t i = 0; i < slopes.size(); ++ i) {
+          TS_ASSERT_DELTA(fun->getParameter(i), static_cast<double>(i), 1e-5);
+          TS_ASSERT_LESS_THAN(fun->getError(i), 2e-4);
+      }
+
+  }
+
+
+private:
+  class TestableSeqDomainSpectrumCreator : public SeqDomainSpectrumCreator {
+      friend class SeqDomainSpectrumCreatorTest;
+
+  public:
+      TestableSeqDomainSpectrumCreator(IPropertyManager* manager,
+                                        const std::string& workspacePropertyName)
+          : SeqDomainSpectrumCreator(manager, workspacePropertyName)
+      {
+
+      }
+
+      ~TestableSeqDomainSpectrumCreator() { }
+  };
+
+  class SeqDomainCreatorTestFunction : public virtual IFunction1DSpectrum, public virtual ParamFunction
+  {
+  public:
+      ~SeqDomainCreatorTestFunction() { }
+
+      std::string name() const { return "SeqDomainCreatorTestFunction"; }
+
+      void function1DSpectrum(const FunctionDomain1DSpectrum &domain, FunctionValues &values) const
+      {
+
+          double wsIndex = static_cast<double>(domain.getWorkspaceIndex());
+          double slope = getParameter("Slope");
+
+          for(size_t j = 0; j < domain.size(); ++j) {
+              values.addToCalculated(j, wsIndex + slope * domain[j]);
+          }
+      }
+
+  protected:
+      void init()
+      {
+          declareParameter("Slope", 1.0);
+      }
+  };
+
+  class SeqDomainCreatorTestFunctionComplex : public virtual IFunction1DSpectrum, public virtual ParamFunction
+  {
+  public:
+      ~SeqDomainCreatorTestFunctionComplex() { }
+
+      std::string name() const { return "SeqDomainCreatorTestFunctionComplex"; }
+
+      void function1DSpectrum(const FunctionDomain1DSpectrum &domain, FunctionValues &values) const
+      {
+          double wsIndex = static_cast<double>(domain.getWorkspaceIndex());
+          double slope = getParameter(domain.getWorkspaceIndex() % 40);
+
+          for(size_t j = 0; j < domain.size(); ++j) {
+              values.addToCalculated(j, wsIndex + slope * domain[j]);
+          }
+      }
+
+      void functionDeriv1DSpectrum(const FunctionDomain1DSpectrum &domain, Jacobian &jacobian)
+      {
+          for(size_t j = 0; j < domain.size(); ++j) {
+              jacobian.set(j, domain.getWorkspaceIndex() % 40, domain[j]);
+          }
+      }
+
+  protected:
+      void init()
+      {
+          for(size_t i = 0; i < 40; ++ i) {
+            declareParameter("Slope" + boost::lexical_cast<std::string>(i), 4.0);
+          }
+      }
+  };
+
+};
+
+#endif /* MANTID_CURVEFITTING_SEQDOMAINSPECTRUMCREATORTEST_H_ */
diff --git a/Code/Mantid/Framework/DataHandling/CMakeLists.txt b/Code/Mantid/Framework/DataHandling/CMakeLists.txt
index aecb8938f1610e79b4d543c00f99fa294c70bdf9..0779ab6ede976738343b8a8617eebe034e55ceb0 100644
--- a/Code/Mantid/Framework/DataHandling/CMakeLists.txt
+++ b/Code/Mantid/Framework/DataHandling/CMakeLists.txt
@@ -3,12 +3,15 @@ set ( SRC_FILES
 	src/AsciiPointBase.cpp
 	src/CompressEvents.cpp
 	src/CreateChopperModel.cpp
+	src/CreateChunkingFromInstrument.cpp
 	src/CreateModeratorModel.cpp
 	src/CreateSampleShape.cpp
 	src/CreateSimulationWorkspace.cpp
 	src/DefineGaugeVolume.cpp
 	src/DeleteTableRows.cpp
 	src/DetermineChunking.cpp
+	src/ExtractMonitorWorkspace.cpp
+	src/FilterEventsByLogValuePreNexus.cpp
 	src/FindDetectorsInShape.cpp
 	src/FindDetectorsPar.cpp
 	src/GenerateGroupingPowder.cpp
@@ -31,7 +34,7 @@ set ( SRC_FILES
 	src/LoadEventPreNexus.cpp
 	src/LoadEventPreNexus2.cpp
 	src/LoadFullprofResolution.cpp
-        src/LoadGSASInstrumentFile.cpp
+	src/LoadGSASInstrumentFile.cpp
 	src/LoadGSS.cpp
 	src/LoadHelper.cpp
 	src/LoadIDFFromNexus.cpp
@@ -93,16 +96,16 @@ set ( SRC_FILES
 	src/ModifyDetectorDotDatFile.cpp
 	src/MoveInstrumentComponent.cpp
 	src/NexusTester.cpp
-        src/PDLoadCharacterizations.cpp
-        src/ProcessDasNexusLog.cpp
+	src/PDLoadCharacterizations.cpp
+	src/ProcessDasNexusLog.cpp
 	src/RawFileInfo.cpp
 	src/RemoveLogs.cpp
 	src/RenameLog.cpp
 	src/RotateInstrumentComponent.cpp
 	src/SNSDataArchive.cpp
 	src/SNSDataArchiveICAT2.cpp
-	src/SaveAscii.cpp
 	src/SaveANSTOAscii.cpp
+	src/SaveAscii.cpp
 	src/SaveAscii2.cpp
 	src/SaveCSV.cpp
 	src/SaveCalFile.cpp
@@ -114,8 +117,8 @@ set ( SRC_FILES
 	src/SaveFocusedXYE.cpp
 	src/SaveFullprofResolution.cpp
 	src/SaveGSS.cpp
-	src/SaveISISNexus.cpp
 	src/SaveILLCosmosAscii.cpp
+	src/SaveISISNexus.cpp
 	src/SaveIsawDetCal.cpp
 	src/SaveMask.cpp
 	src/SaveNISTDAT.cpp
@@ -124,15 +127,14 @@ set ( SRC_FILES
 	src/SaveNexusProcessed.cpp
 	src/SavePAR.cpp
 	src/SavePHX.cpp
-	src/SaveReflTBL.cpp
 	src/SaveRKH.cpp
+	src/SaveReflTBL.cpp
 	src/SaveSPE.cpp
 	src/SaveToSNSHistogramNexus.cpp
 	src/SaveVTK.cpp
 	src/SetSampleMaterial.cpp
 	src/SetScalingPSD.cpp
 	src/UpdateInstrumentFromFile.cpp
-	src/FilterEventsByLogValuePreNexus.cpp
 )
 
 set ( INC_FILES
@@ -140,12 +142,15 @@ set ( INC_FILES
 	inc/MantidDataHandling/AsciiPointBase.h
 	inc/MantidDataHandling/CompressEvents.h
 	inc/MantidDataHandling/CreateChopperModel.h
+	inc/MantidDataHandling/CreateChunkingFromInstrument.h
 	inc/MantidDataHandling/CreateModeratorModel.h
 	inc/MantidDataHandling/CreateSampleShape.h
 	inc/MantidDataHandling/CreateSimulationWorkspace.h
 	inc/MantidDataHandling/DefineGaugeVolume.h
 	inc/MantidDataHandling/DeleteTableRows.h
 	inc/MantidDataHandling/DetermineChunking.h
+	inc/MantidDataHandling/ExtractMonitorWorkspace.h
+	inc/MantidDataHandling/FilterEventsByLogValuePreNexus.h
 	inc/MantidDataHandling/FindDetectorsInShape.h
 	inc/MantidDataHandling/FindDetectorsPar.h
 	inc/MantidDataHandling/GenerateGroupingPowder.h
@@ -168,7 +173,7 @@ set ( INC_FILES
 	inc/MantidDataHandling/LoadEventPreNexus.h
 	inc/MantidDataHandling/LoadEventPreNexus2.h
 	inc/MantidDataHandling/LoadFullprofResolution.h
-        inc/MantidDataHandling/LoadGSASInstrumentFile.h
+	inc/MantidDataHandling/LoadGSASInstrumentFile.h
 	inc/MantidDataHandling/LoadGSS.h
 	inc/MantidDataHandling/LoadHelper.h
 	inc/MantidDataHandling/LoadIDFFromNexus.h
@@ -225,8 +230,8 @@ set ( INC_FILES
 	inc/MantidDataHandling/ModifyDetectorDotDatFile.h
 	inc/MantidDataHandling/MoveInstrumentComponent.h
 	inc/MantidDataHandling/NexusTester.h
-  inc/MantidDataHandling/PDLoadCharacterizations.h
-  inc/MantidDataHandling/ProcessDasNexusLog.h
+	inc/MantidDataHandling/PDLoadCharacterizations.h
+	inc/MantidDataHandling/ProcessDasNexusLog.h
 	inc/MantidDataHandling/RawFileInfo.h
 	inc/MantidDataHandling/RemoveLogs.h
 	inc/MantidDataHandling/RenameLog.h
@@ -246,8 +251,8 @@ set ( INC_FILES
 	inc/MantidDataHandling/SaveFocusedXYE.h
 	inc/MantidDataHandling/SaveFullprofResolution.h
 	inc/MantidDataHandling/SaveGSS.h
-	inc/MantidDataHandling/SaveISISNexus.h
 	inc/MantidDataHandling/SaveILLCosmosAscii.h
+	inc/MantidDataHandling/SaveISISNexus.h
 	inc/MantidDataHandling/SaveIsawDetCal.h
 	inc/MantidDataHandling/SaveMask.h
 	inc/MantidDataHandling/SaveNISTDAT.h
@@ -256,15 +261,14 @@ set ( INC_FILES
 	inc/MantidDataHandling/SaveNexusProcessed.h
 	inc/MantidDataHandling/SavePAR.h
 	inc/MantidDataHandling/SavePHX.h
-	inc/MantidDataHandling/SaveReflTBL.h
 	inc/MantidDataHandling/SaveRKH.h
+	inc/MantidDataHandling/SaveReflTBL.h
 	inc/MantidDataHandling/SaveSPE.h
 	inc/MantidDataHandling/SaveToSNSHistogramNexus.h
 	inc/MantidDataHandling/SaveVTK.h
 	inc/MantidDataHandling/SetSampleMaterial.h
 	inc/MantidDataHandling/SetScalingPSD.h
 	inc/MantidDataHandling/UpdateInstrumentFromFile.h
-	inc/MantidDataHandling/FilterEventsByLogValuePreNexus.h
 	src/LoadRaw/byte_rel_comp.h
 	src/LoadRaw/isisraw.h
 	src/LoadRaw/isisraw2.h
@@ -276,12 +280,15 @@ set ( TEST_FILES
 	AppendGeometryToSNSNexusTest.h
 	CompressEventsTest.h
 	CreateChopperModelTest.h
+	CreateChunkingFromInstrumentTest.h
 	CreateModeratorModelTest.h
 	CreateSampleShapeTest.h
 	CreateSimulationWorkspaceTest.h
 	DefineGaugeVolumeTest.h
 	DeleteTableRowsTest.h
 	DetermineChunkingTest.h
+	ExtractMonitorWorkspaceTest.h
+	FilterEventsByLogValuePreNexusTest.h
 	FindDetectorsInShapeTest.h
 	FindDetectorsParTest.h
 	GenerateGroupingPowderTest.h
@@ -353,8 +360,8 @@ set ( TEST_FILES
 	ModifyDetectorDotDatFileTest.h
 	MoveInstrumentComponentTest.h
 	NexusTesterTest.h
-  PDLoadCharacterizationsTest.h
-  ProcessDasNexusLogTest.h
+	PDLoadCharacterizationsTest.h
+	ProcessDasNexusLogTest.h
 	RawFileInfoTest.h
 	RemoveLogsTest.h
 	RenameLogTest.h
@@ -390,7 +397,6 @@ set ( TEST_FILES
 	SetScalingPSDTest.h
 	UpdateInstrumentFromFileTest.h
 	XMLlogfileTest.h
-	FilterEventsByLogValuePreNexusTest.h
 )
 
 
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/CreateChunkingFromInstrument.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/CreateChunkingFromInstrument.h
new file mode 100644
index 0000000000000000000000000000000000000000..b289977696a99d1702e4c37c0ce88a973ed9e359
--- /dev/null
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/CreateChunkingFromInstrument.h
@@ -0,0 +1,57 @@
+#ifndef MANTID_DATAHANDLING_CREATECHUNKINGFROMINSTRUMENT_H_
+#define MANTID_DATAHANDLING_CREATECHUNKINGFROMINSTRUMENT_H_
+
+#include "MantidAPI/Algorithm.h"
+#include "MantidGeometry/Instrument.h"
+#include "MantidKernel/System.h"
+
+namespace Mantid
+{
+namespace DataHandling
+{
+
+  /** CreateChunkingFromInstrument : TODO: DESCRIPTION
+    
+    Copyright &copy; 2014 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
+
+    This file is part of Mantid.
+
+    Mantid 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.
+
+    Mantid 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.  If not, see <http://www.gnu.org/licenses/>.
+
+    File change history is stored at: <https://github.com/mantidproject/mantid>
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+  */
+  class DLLExport CreateChunkingFromInstrument  : public API::Algorithm
+  {
+  public:
+    CreateChunkingFromInstrument();
+    virtual ~CreateChunkingFromInstrument();
+    
+    virtual const std::string name() const;
+    virtual int version() const;
+    virtual const std::string category() const;
+    virtual const std::string summary() const;
+    virtual std::map<std::string, std::string> validateInputs();
+
+  private:
+    void init();
+    void exec();
+    Geometry::Instrument_const_sptr getInstrument();
+  };
+
+
+} // namespace DataHandling
+} // namespace Mantid
+
+#endif  /* MANTID_DATAHANDLING_CREATECHUNKINGFROMINSTRUMENT_H_ */
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ExtractMonitorWorkspace.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ExtractMonitorWorkspace.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e96df2baecfc5bf2a6f430276f34110bc07c9a7
--- /dev/null
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/ExtractMonitorWorkspace.h
@@ -0,0 +1,55 @@
+#ifndef MANTID_DATAHANDLING_EXTRACTMONITORWORKSPACE_H_
+#define MANTID_DATAHANDLING_EXTRACTMONITORWORKSPACE_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/Algorithm.h"
+
+namespace Mantid
+{
+namespace DataHandling
+{
+  /** Looks for an internally-stored monitor workspace on the input workspace and
+      sets it as the output workspace if found. The input workspace will no longer
+      hold a reference to the monitor workspace after running this algorithm.
+      If no monitor workspace is present the algorithm will fail.
+    
+      Copyright &copy; 2014 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
+
+      This file is part of Mantid.
+
+      Mantid 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.
+
+      Mantid 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.  If not, see <http://www.gnu.org/licenses/>.
+
+      File change history is stored at: <https://github.com/mantidproject/mantid>
+      Code Documentation is available at: <http://doxygen.mantidproject.org>
+  */
+  class DLLExport ExtractMonitorWorkspace  : public API::Algorithm
+  {
+  public:
+    ExtractMonitorWorkspace();
+    virtual ~ExtractMonitorWorkspace();
+    
+    virtual const std::string name() const;
+    virtual int version() const;
+    virtual const std::string category() const;
+    virtual const std::string summary() const;
+
+  private:
+    void init();
+    void exec();
+  };
+
+} // namespace DataHandling
+} // namespace Mantid
+
+#endif  /* MANTID_DATAHANDLING_EXTRACTMONITORWORKSPACE_H_ */
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadHelper.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadHelper.h
index 54cfd3428151709b792dc02a0e4a6e7b0d7afb9c..020df6eb2fb99139f968d8be132ee80705f00f95 100644
--- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadHelper.h
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadHelper.h
@@ -34,11 +34,11 @@ public:
 	LoadHelper();
 	virtual ~LoadHelper();
 
-	std::string findInstrumentNexusPath(const NeXus::NXEntry&);
-	std::string getStringFromNexusPath(const NeXus::NXEntry&,
+	std::string findInstrumentNexusPath(const Mantid::NeXus::NXEntry&);
+	std::string getStringFromNexusPath(const Mantid::NeXus::NXEntry&,
 			const std::string&);
-	double getDoubleFromNexusPath(const NeXus::NXEntry&, const std::string&);
-	std::vector<double> getTimeBinningFromNexusPath(const NeXus::NXEntry &,
+	double getDoubleFromNexusPath(const Mantid::NeXus::NXEntry&, const std::string&);
+	std::vector<double> getTimeBinningFromNexusPath(const Mantid::NeXus::NXEntry &,
 			const std::string &);
 	static double calculateStandardError(double in) {
 		return sqrt(in);
diff --git a/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp b/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4038ddd6408790d8016d478477e9fb63edf5ff99
--- /dev/null
+++ b/Code/Mantid/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
@@ -0,0 +1,500 @@
+/*WIKI*
+Workflow algorithm to determine chunking strategy
+for event nexus file. This will break up the instrument
+into logical components according to the instrument hierarchy.
+
+This algorithm does assume that there are components in the
+geometry named "bank#" and returns a table workspace of those
+names. Trying this on an instrument without components named
+that will generate an exception. Also, requesting "ChunkBy=All"
+will return an empty table workspace.
+*WIKI*/
+
+#include "MantidAPI/FileProperty.h"
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/TableRow.h"
+#include "MantidDataHandling/CreateChunkingFromInstrument.h"
+#include "MantidDataObjects/Workspace2D.h"
+#include "MantidGeometry/IDetector.h"
+#include "MantidKernel/ListValidator.h"
+#include <boost/tokenizer.hpp>
+#include <nexus/NeXusFile.hpp>
+#include <nexus/NeXusException.hpp>
+
+namespace Mantid
+{
+namespace DataHandling
+{
+  using namespace Mantid::API;
+  using namespace Mantid::DataObjects;
+  using namespace Mantid::Geometry;
+  using namespace Mantid::Kernel;
+  using namespace std;
+
+  typedef boost::tokenizer<boost::char_separator<char> >  tokenizer;
+
+  // Register the algorithm into the AlgorithmFactory
+  DECLARE_ALGORITHM(CreateChunkingFromInstrument)
+  
+
+  namespace { // anonymous namespace to hide things
+    /// Input file name
+    const string PARAM_IN_FILE("Filename");
+    /// Input workspace parameter name
+    const string PARAM_IN_WKSP("InputWorkspace");
+    /// Instrument name parameter name
+    const string PARAM_INST_NAME("InstrumentName");
+    /// Instrument file parameter name
+    const string PARAM_INST_FILE("InstrumentFilename");
+    /// Explicitly name instrument components
+    const string PARAM_CHUNK_NAMES("ChunkNames");
+    /// Canned instrument components names
+    const string PARAM_CHUNK_BY("ChunkBy");
+    /// Recursion depth parameter name
+    const string PARAM_MAX_RECURSE("MaxRecursionDepth");
+    /// Output workspace parameter name
+    const string PARAM_OUT_WKSP("OutputWorkspace");
+    /// Maximum number of banks to look for
+    const string PARAM_MAX_BANK_NUM("MaxBankNumber");
+  }
+
+  //----------------------------------------------------------------------------------------------
+  /** Constructor
+   */
+  CreateChunkingFromInstrument::CreateChunkingFromInstrument()
+  {
+  }
+    
+  //----------------------------------------------------------------------------------------------
+  /** Destructor
+   */
+  CreateChunkingFromInstrument::~CreateChunkingFromInstrument()
+  {
+  }
+  
+
+  //----------------------------------------------------------------------------------------------
+  /// Algorithm's name for identification. @see Algorithm::name
+  const string CreateChunkingFromInstrument::name() const { return "CreateChunkingFromInstrument";};
+  
+  /// Algorithm's version for identification. @see Algorithm::version
+  int CreateChunkingFromInstrument::version() const { return 1;};
+  
+  /// Algorithm's category for identification. @see Algorithm::category
+  const string CreateChunkingFromInstrument::category() const { return "Workflow\\DataHandling";}
+
+  /// Algorithm's summary for identification. @see Algorithm::summary
+  const string CreateChunkingFromInstrument::summary() const { return "Creates chunking at a level of the instrument or instrument components."; }
+
+  //----------------------------------------------------------------------------------------------
+  /** Initialize the algorithm's properties.
+   */
+  void CreateChunkingFromInstrument::init()
+  {
+    // instrument selection
+    string grp1Name("Specify the Instrument");
+
+    std::vector<std::string> exts;
+    exts.push_back("_event.nxs");
+    exts.push_back(".nxs.h5");
+    exts.push_back(".nxs");
+    this->declareProperty(new FileProperty(PARAM_IN_FILE, "", FileProperty::OptionalLoad, exts),
+        "The name of the event nexus file to read, including its full or relative path." );
+
+    this->declareProperty(new WorkspaceProperty<>(PARAM_IN_WKSP,"",Direction::Input, PropertyMode::Optional),
+                          "Optional: An input workspace with the instrument we want to use.");
+
+    this->declareProperty(new PropertyWithValue<string>(PARAM_INST_NAME,"",Direction::Input),
+                          "Optional: Name of the instrument to base the ChunkingWorkpace on which to base the GroupingWorkspace.");
+
+    this->declareProperty(new FileProperty(PARAM_INST_FILE, "", FileProperty::OptionalLoad, ".xml"),
+                          "Optional: Path to the instrument definition file on which to base the ChunkingWorkpace.");
+
+    this->setPropertyGroup(PARAM_IN_FILE, grp1Name);
+    this->setPropertyGroup(PARAM_IN_WKSP, grp1Name);
+    this->setPropertyGroup(PARAM_INST_NAME, grp1Name);
+    this->setPropertyGroup(PARAM_INST_FILE, grp1Name);
+
+    // chunking
+    string grp2Name("Specify Instrument Components");
+
+    declareProperty(PARAM_CHUNK_NAMES,"",
+      "Optional: A string of the instrument component names to use as separate groups. "
+      "Use / or , to separate multiple groups. "
+      "If empty, then an empty GroupingWorkspace will be created.");
+    vector<string> grouping;
+    grouping.push_back("");
+    grouping.push_back("All");
+    grouping.push_back("Group");
+    grouping.push_back("Column");
+    grouping.push_back("bank");
+    declareProperty(PARAM_CHUNK_BY, "", boost::make_shared<StringListValidator>(grouping),
+        "Only used if GroupNames is empty: All detectors as one group, Groups (East,West for SNAP), Columns for SNAP, detector banks");
+
+    this->setPropertyGroup(PARAM_CHUNK_NAMES, grp2Name);
+    this->setPropertyGroup(PARAM_CHUNK_BY, grp2Name);
+
+    // everything else
+    declareProperty(PARAM_MAX_RECURSE, 5,
+                    "Number of levels to search into the instrument (default=5)");
+    declareProperty(PARAM_MAX_BANK_NUM, 300,
+                    "Maximum bank number to search for in the instrument");
+
+    declareProperty(new WorkspaceProperty<API::ITableWorkspace>(PARAM_OUT_WKSP,"",Direction::Output),
+                    "An output workspace describing the cunking.");
+  }
+
+  /// @copydoc Mantid::API::Algorithm::validateInputs
+  map<string, string> CreateChunkingFromInstrument::validateInputs()
+  {
+    map<string, string> result;
+
+    // get the input paramters
+    string filename = getPropertyValue(PARAM_IN_FILE);
+    MatrixWorkspace_sptr inWS = getProperty(PARAM_IN_WKSP);
+    string instName = getPropertyValue(PARAM_INST_NAME);
+    string instFilename = getPropertyValue(PARAM_INST_FILE);
+
+    // count how many ways the input instrument was specified
+    int numInst = 0;
+    if (!filename.empty()) numInst++;
+    if (inWS) numInst++;
+    if (!instName.empty()) numInst++;
+    if (!instFilename.empty()) numInst++;
+
+    // set the error bits
+    string msg;
+    if (numInst == 0)
+    {
+      msg = "Must specify instrument one way";
+    }
+    else if (numInst > 1)
+    {
+      msg = "Can only specify instrument one way";
+    }
+    if (!msg.empty())
+    {
+      result[PARAM_IN_FILE]   = msg;
+      result[PARAM_IN_WKSP]   = msg;
+      result[PARAM_INST_NAME] = msg;
+      result[PARAM_INST_FILE] = msg;
+    }
+
+    // get the chunking technology to use
+    string chunkNames  = getPropertyValue(PARAM_CHUNK_NAMES);
+    string chunkGroups = getPropertyValue(PARAM_CHUNK_BY);
+    msg = "";
+    if (chunkNames.empty() && chunkGroups.empty())
+    {
+      msg = "Must specify either " + PARAM_CHUNK_NAMES + " or "
+                 + PARAM_CHUNK_BY;
+    }
+    else if ((!chunkNames.empty()) && (!chunkGroups.empty()))
+    {
+      msg = "Must specify either " + PARAM_CHUNK_NAMES + " or "
+                 + PARAM_CHUNK_BY + " not both";
+    }
+    if (!msg.empty())
+    {
+      result[PARAM_CHUNK_NAMES] = msg;
+      result[PARAM_CHUNK_BY]    = msg;
+    }
+
+    return result;
+  }
+
+  /**
+   * Returns true if str starts with prefix.
+   *
+   * @param str The string to check.
+   * @param prefix The prefix to look for.
+   * @return true if str starts with prefix.
+   */
+  bool startsWith(const string & str, const string & prefix)
+  {
+    // can't start with if it is shorter than the prefix
+    if (str.length() < prefix.length())
+      return false;
+
+    return (str.substr(0, prefix.length()).compare(prefix) == 0);
+  }
+
+  /**
+   * Find the name of the parent of the component that starts with the
+   * supplied prefix.
+   *
+   * @param comp The component to find the parent of.
+   * @param prefix Prefix of parent names to look for.
+   * @return The correct parent name. This is an empty string if the name
+   * isn't found.
+   */
+  string parentName(IComponent_const_sptr comp, const string & prefix)
+  {
+    // handle the special case of the component has the name
+    if (startsWith(comp->getName(), prefix))
+      return comp->getName();
+
+    // find the parent with the correct name
+    IComponent_const_sptr parent = comp->getParent();
+    if (parent)
+    {
+      if (startsWith(parent->getName(), prefix))
+        return parent->getName();
+      else
+        return parentName(parent, prefix);
+    }
+    else
+    {
+      return "";
+    }
+  }
+
+  /**
+   * Find the name of the parent of the component that is in the list of
+   * parents that are being searched for.
+   *
+   * @param comp The component to find the parent of.
+   * @param names List of parent names to look for.
+   * @return The correct parent name. This is an empty string if the name
+   * isn't found.
+   */
+  string parentName(IComponent_const_sptr comp, const vector<string> & names)
+  {
+    // handle the special case of the component has the name
+    for (auto name = names.begin(); name != names.end(); ++name)
+      if (name->compare(comp->getName()) == 0)
+        return (*name);
+
+    // find the parent with the correct name
+    IComponent_const_sptr parent = comp->getParent();
+    if (parent)
+    {
+      // see if this is the parent
+      for (auto name = names.begin(); name != names.end(); ++name)
+        if (name->compare(parent->getName()) == 0)
+          return (*name);
+
+      // or recurse
+      return parentName(parent, names);
+    }
+    else
+    {
+      return "";
+    }
+  }
+
+  /**
+   * Split a list of instrument components into a vector of strings.
+   *
+   * @param names Comma separated list of instrument components
+   * @return The vector of instrument component names.
+   */
+  vector<string> getGroupNames(const string & names)
+  {
+    vector<string> groups;
+
+    // check that there is something
+    if (names.empty())
+      return groups;
+
+    // do the actual splitting
+    const boost::char_separator<char> SEPERATOR(",");
+    tokenizer tokens(names, SEPERATOR);
+    for (auto item = tokens.begin(); item != tokens.end(); ++item)
+    {
+      groups.push_back(*item);
+    }
+
+    return groups;
+  }
+
+  /**
+   * Determine the instrument from the various input parameters.
+   *
+   * @return The correct instrument.
+   */
+  Instrument_const_sptr CreateChunkingFromInstrument::getInstrument()
+  {
+    // try the input workspace
+    MatrixWorkspace_sptr inWS = getProperty(PARAM_IN_WKSP);
+    if (inWS)
+    {
+      return inWS->getInstrument();
+    }
+
+    // temporary workspace to hang everything else off of
+    MatrixWorkspace_sptr tempWS(new Workspace2D());
+    // name of the instrument
+    string instName = getPropertyValue(PARAM_INST_NAME);
+
+    // see if there is an input file
+    string filename = getPropertyValue(PARAM_IN_FILE);
+    if (!filename.empty())
+    {
+      string top_entry_name("entry"); // TODO make more flexible
+
+      // get the instrument name from the filename
+      size_t n = filename.rfind('/');
+      if (n != std::string::npos)
+      {
+        std::string temp = filename.substr(n+1, filename.size()-n-1);
+        n = temp.find('_');
+        if (n != std::string::npos && n > 0)
+        {
+          instName = temp.substr(0, n);
+        }
+      }
+
+      // read information from the nexus file itself
+      try {
+        NeXus::File nxsfile(filename);
+
+        // get the run start time
+        string start_time;
+        nxsfile.openGroup(top_entry_name, "NXentry");
+        nxsfile.readData("start_time", start_time);
+        tempWS->mutableRun().addProperty("run_start", DateAndTime(start_time).toISO8601String(), true );
+
+        // get the instrument name
+        nxsfile.openGroup("instrument", "NXinstrument");
+        nxsfile.readData("name", instName);
+        nxsfile.closeGroup();
+
+        // Test if IDF exists in file, move on quickly if not
+        nxsfile.openPath("instrument/instrument_xml");
+        nxsfile.close();
+        IAlgorithm_sptr loadInst= createChildAlgorithm("LoadIDFFromNexus",0.0,0.2);
+        // Now execute the Child Algorithm. Catch and log any error, but don't stop.
+        try
+        {
+          loadInst->setPropertyValue("Filename", filename);
+          loadInst->setProperty<MatrixWorkspace_sptr> ("Workspace", tempWS);
+          loadInst->setPropertyValue("InstrumentParentPath",top_entry_name);
+          loadInst->execute();
+        }
+        catch( std::invalid_argument&)
+        {
+          g_log.error("Invalid argument to LoadIDFFromNexus Child Algorithm ");
+        }
+        catch (std::runtime_error&)
+        {
+          g_log.debug("No instrument definition found in "+filename+" at "+top_entry_name+"/instrument");
+        }
+
+        if ( loadInst->isExecuted() )
+          return tempWS->getInstrument();
+        else
+          g_log.information("No IDF loaded from Nexus file.");
+
+      } catch (::NeXus::Exception&) {
+        g_log.information("No instrument definition found in "+filename+" at "+top_entry_name+"/instrument");
+      }
+    }
+
+    // run LoadInstrument if other methods have not run
+    string instFilename = getPropertyValue(PARAM_INST_FILE);
+
+    Algorithm_sptr childAlg = createChildAlgorithm("LoadInstrument",0.0,0.2);
+    childAlg->setProperty<MatrixWorkspace_sptr>("Workspace", tempWS);
+    childAlg->setPropertyValue("Filename", instFilename);
+    childAlg->setPropertyValue("InstrumentName", instName);
+    childAlg->executeAsChildAlg();
+    return tempWS->getInstrument();
+  }
+
+  //----------------------------------------------------------------------------------------------
+  /** Execute the algorithm.
+   */
+  void CreateChunkingFromInstrument::exec()
+  {
+    // get the instrument
+    Instrument_const_sptr inst = this->getInstrument();
+
+    // setup the output workspace
+    ITableWorkspace_sptr strategy = WorkspaceFactory::Instance().createTable("TableWorkspace");
+    strategy->addColumn("str", "BankName");
+    this->setProperty("OutputWorkspace", strategy);
+
+    // get the correct level of grouping
+    string groupLevel = this->getPropertyValue(PARAM_CHUNK_BY);
+    vector<string> groupNames = getGroupNames(this->getPropertyValue(PARAM_CHUNK_NAMES));
+    if (groupLevel.compare("All") == 0)
+    {
+      return; // nothing to do
+    }
+    else if (inst->getName().compare("SNAP") == 0 && groupLevel.compare("Group") == 0)
+    {
+      groupNames.clear();
+      groupNames.push_back("East");
+      groupNames.push_back("West");
+    }
+
+    // set up a progress bar with the "correct" number of steps
+    int maxBankNum = this->getProperty(PARAM_MAX_BANK_NUM);
+    Progress progress(this, .2, 1., maxBankNum);
+
+    // search the instrument for the bank names
+    int maxRecurseDepth = this->getProperty(PARAM_MAX_RECURSE);
+    map<string, vector<string> > grouping;
+    // cppcheck-suppress syntaxError
+    PRAGMA_OMP(parallel for schedule(dynamic, 1) )
+    for (int num = 0; num < maxBankNum; ++num)
+    {
+      PARALLEL_START_INTERUPT_REGION
+      ostringstream mess;
+      mess<< "bank"<<num;
+      IComponent_const_sptr comp = inst->getComponentByName(mess.str(), maxRecurseDepth);
+      PARALLEL_CRITICAL(grouping)
+      if(comp)
+      {
+        // get the name of the correct parent
+        string parent;
+        if (groupNames.empty())
+        {
+          parent = parentName(comp, groupLevel);
+        }
+        else
+        {
+          parent = parentName(comp, groupNames);
+        }
+
+        // add it to the correct chunk
+        if (!parent.empty())
+        {
+          if (grouping.count(parent) == 0)
+            grouping[parent] = vector<string>();
+
+          grouping[parent].push_back(comp->getName());
+        }
+      }
+      progress.report();
+      PARALLEL_END_INTERUPT_REGION
+    }
+    PARALLEL_CHECK_INTERUPT_REGION
+
+    // check to see that something happened
+    if (grouping.empty())
+        throw std::runtime_error("Failed to find any banks in the instrument");
+
+    // fill in the table workspace
+    for (auto group = grouping.begin(); group != grouping.end(); ++group)
+    {
+      stringstream banks;
+      for (auto bank = group->second.begin(); bank != group->second.end(); ++bank)
+        banks << (*bank) << ",";
+
+      // remove the trailing comma
+      string banksStr = banks.str();
+      banksStr = banksStr.substr(0, banksStr.size()-1);
+
+      // add it to the table
+      TableRow row = strategy->appendRow();
+      row << banksStr;
+    }
+
+  }
+
+
+
+} // namespace DataHandling
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp b/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..3d25c06e4be579b74ffa8f162bc4f654017c6608
--- /dev/null
+++ b/Code/Mantid/Framework/DataHandling/src/ExtractMonitorWorkspace.cpp
@@ -0,0 +1,67 @@
+/*WIKI*
+This algorithm looks for an internally-stored monitor workspace on the input workspace and
+sets it as the output workspace if found. The input workspace will no longer hold a reference
+to the monitor workspace after this algorithm has been run on it.
+If no monitor workspace is present the algorithm will fail.
+*WIKI*/
+
+#include "MantidDataHandling/ExtractMonitorWorkspace.h"
+
+namespace Mantid
+{
+namespace DataHandling
+{
+  // Register the algorithm into the AlgorithmFactory
+  DECLARE_ALGORITHM(ExtractMonitorWorkspace)
+  
+  using namespace Mantid::Kernel;
+  using namespace Mantid::API;
+
+  ExtractMonitorWorkspace::ExtractMonitorWorkspace()
+  {}
+
+  ExtractMonitorWorkspace::~ExtractMonitorWorkspace()
+  {}
+
+  /// Algorithm's name for identification. @see Algorithm::name
+  const std::string ExtractMonitorWorkspace::name() const { return "ExtractMonitorWorkspace";};
+  
+  /// Algorithm's version for identification. @see Algorithm::version
+  int ExtractMonitorWorkspace::version() const { return 1;};
+  
+  /// Algorithm's category for identification. @see Algorithm::category
+  const std::string ExtractMonitorWorkspace::category() const { return "DataHandling";}
+
+  /// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
+  const std::string  ExtractMonitorWorkspace::summary() const
+  {
+    return "Retrieves a workspace of monitor data held within the input workspace, if present.";
+  }
+
+  /** Initialize the algorithm's properties.
+   */
+  void ExtractMonitorWorkspace::init()
+  {
+    declareProperty(new WorkspaceProperty<>("InputWorkspace","",Direction::Input), "An input workspace.");
+    declareProperty(new WorkspaceProperty<>("MonitorWorkspace","",Direction::Output), "An output workspace.");
+  }
+
+  /** Execute the algorithm.
+   */
+  void ExtractMonitorWorkspace::exec()
+  {
+    MatrixWorkspace_sptr inputWS = getProperty("InputWorkspace");
+    auto monitorWS = inputWS->monitorWorkspace();
+
+    if ( ! monitorWS )
+    {
+      throw std::invalid_argument("The input workspace does not hold a monitor workspace");
+    }
+
+    setProperty("MonitorWorkspace", monitorWS);
+    // Now clear off the pointer on the input workspace
+    inputWS->setMonitorWorkspace(MatrixWorkspace_sptr());
+  }
+
+} // namespace DataHandling
+} // namespace Mantid
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadHelper.cpp b/Code/Mantid/Framework/DataHandling/src/LoadHelper.cpp
index eb3ea9d12b61db89ec0e03c641fa014393a29067..b82f6c47d87ec7d4a427f7399d1becddec6a0824 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadHelper.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadHelper.cpp
@@ -4,6 +4,7 @@
 
 #include "MantidDataHandling/LoadHelper.h"
 
+#include <nexus/napi.h>
 #include <boost/algorithm/string/predicate.hpp> //assert(boost::algorithm::ends_with("mystring", "ing"));
 
 namespace Mantid {
@@ -31,9 +32,9 @@ LoadHelper::~LoadHelper() {
  * Usually of the form: entry0/\<NXinstrument class\>/name
  */
 std::string LoadHelper::findInstrumentNexusPath(
-		const NeXus::NXEntry &firstEntry) {
+		const Mantid::NeXus::NXEntry &firstEntry) {
 	std::string insNamePath = "";
-	std::vector<NeXus::NXClassInfo> v = firstEntry.groups();
+	std::vector<Mantid::NeXus::NXClassInfo> v = firstEntry.groups();
 	for (auto it = v.begin(); it < v.end(); it++) {
 		if (it->nxclass == "NXinstrument") {
 			insNamePath = it->nxname;
@@ -43,12 +44,12 @@ std::string LoadHelper::findInstrumentNexusPath(
 	return insNamePath;
 }
 
-std::string LoadHelper::getStringFromNexusPath(const NeXus::NXEntry &firstEntry,
+std::string LoadHelper::getStringFromNexusPath(const Mantid::NeXus::NXEntry &firstEntry,
 		const std::string &nexusPath) {
 	return firstEntry.getString(nexusPath);
 }
 
-double LoadHelper::getDoubleFromNexusPath(const NeXus::NXEntry &firstEntry,
+double LoadHelper::getDoubleFromNexusPath(const Mantid::NeXus::NXEntry &firstEntry,
 		const std::string &nexusPath) {
 	return firstEntry.getFloat(nexusPath);
 }
@@ -58,9 +59,9 @@ double LoadHelper::getDoubleFromNexusPath(const NeXus::NXEntry &firstEntry,
  * Adds an extra bin at the end
  */
 std::vector<double> LoadHelper::getTimeBinningFromNexusPath(
-		const NeXus::NXEntry &firstEntry, const std::string &nexusPath) {
+		const Mantid::NeXus::NXEntry &firstEntry, const std::string &nexusPath) {
 
-	NeXus::NXFloat timeBinningNexus = firstEntry.openNXFloat(nexusPath);
+	Mantid::NeXus::NXFloat timeBinningNexus = firstEntry.openNXFloat(nexusPath);
 	timeBinningNexus.load();
 
 	size_t numberOfBins = static_cast<size_t>(timeBinningNexus.dim0()) + 1; // boundaries
@@ -189,11 +190,8 @@ void LoadHelper::addNexusFieldsToWsRun(NXhandle nxfileID,
 			//dump_attributes(nxfileID, indent_str);
 			g_log.debug()<<indent_str<<nxname<<" opened."<<std::endl;
 
-			if (parent_class=="NXData") {
-				g_log.debug()<<indent_str<<"skipping NXData"<<std::endl;
-				/* nothing */
-			} else if (parent_class=="NXMonitor") {
-				g_log.debug()<<indent_str<<"skipping NXMonitor"<<std::endl;
+			if (parent_class=="NXData" || parent_class=="NXMonitor") {
+				g_log.debug()<<indent_str<<"skipping "<<parent_class<<std::endl;
 				/* nothing */
 			} else { // create a property
 				int rank;
@@ -218,11 +216,14 @@ void LoadHelper::addNexusFieldsToWsRun(NXhandle nxfileID,
 				} else {
 					void *dataBuffer;
 					NXmalloc (&dataBuffer, rank, dims, type);
+
+
 					if (NXgetdata(nxfileID, dataBuffer) != NX_OK) {
 						NXfree(&dataBuffer);
 						throw std::runtime_error("Cannot read data from NeXus file");
 					}
 
+
 					if (type==NX_CHAR) {
 						std::string property_value((const char *)dataBuffer);
 						if (boost::algorithm::ends_with(property_name, "_time")) {
@@ -250,20 +251,47 @@ void LoadHelper::addNexusFieldsToWsRun(NXhandle nxfileID,
 							g_log.debug()<<indent_str<<"[ "<<property_name<<" has unit "<<units_sbuf<<" ]"<<std::endl;
 						}
 
+						if (dims[0]!=1) {
+							g_log.debug()<<indent_str<<property_name<<" is an array..."<<std::endl;
+							if (dims[0]>10) {
+								g_log.debug()<<indent_str<<"   skipping it (size="<<dims[0]<<")."<<std::endl;
+								NXfree(&dataBuffer);
+								continue;
+							}
+
+						}
+
 
 						if ((type==NX_FLOAT32)||(type==NX_FLOAT64)) {
 							// Mantid numerical properties are double only.
 							double property_double_value=0.0;
-							if (type==NX_FLOAT32) {
-								property_double_value = *((float*)dataBuffer);
-							} else if (type==NX_FLOAT64) {
-								property_double_value = *((double*)dataBuffer);
-							}
 
-							if(units_status!=NX_ERROR)
-								runDetails.addProperty(property_name, property_double_value, std::string(units_sbuf));
-							else
-								runDetails.addProperty(property_name, property_double_value);
+							// Simple case, one value
+							if (dims[0]==1) {
+								if (type==NX_FLOAT32) {
+									property_double_value = *((float*)dataBuffer);
+								} else if (type==NX_FLOAT64) {
+									property_double_value = *((double*)dataBuffer);
+								}
+								if(units_status!=NX_ERROR)
+									runDetails.addProperty(property_name, property_double_value, std::string(units_sbuf));
+								else
+									runDetails.addProperty(property_name, property_double_value);
+							} else {
+								// An array
+								for (int dim_index=0 ; dim_index<dims[0]; dim_index++) {
+									if (type==NX_FLOAT32) {
+										property_double_value = ((float*)dataBuffer)[dim_index];
+									} else if (type==NX_FLOAT64) {
+										property_double_value = ((double*)dataBuffer)[dim_index];
+									}
+									std::string indexed_property_name = property_name + std::string("_") + boost::lexical_cast<std::string>(dim_index);
+									if(units_status!=NX_ERROR)
+										runDetails.addProperty(indexed_property_name, property_double_value, std::string(units_sbuf));
+									else
+										runDetails.addProperty(indexed_property_name, property_double_value);
+								}
+							}
 
 						} else {
 							// int case
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus.cpp
index e6285f75a675cc721d123643041a4a42d66e3065..f901fb22f82b473d1c0145e85c744fec654485e5 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus.cpp
@@ -16,7 +16,7 @@ namespace Mantid
 
     LoadISISNexus::LoadISISNexus() : Algorithm(), DeprecatedAlgorithm()
     {
-      useAlgorithm("LoadISISNexus Version 2");
+      useAlgorithm("LoadISISNexus", 2);
     }
 
     /** Initialises the algorithm with the properties as they were when this algorithm was removed from Mantid,
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRaw.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRaw.cpp
index 4e3136c9ff16e1676faa74c41a03146648daff7c..c5e6d8c757f7c51f6f72d0fba287a64e8952cbe6 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadRaw.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadRaw.cpp
@@ -17,7 +17,7 @@ namespace Mantid
     /// Empty default constructor
     LoadRaw::LoadRaw() : Algorithm(), DeprecatedAlgorithm()
     {
-      useAlgorithm("LoadRaw Version 3");
+      useAlgorithm("LoadRaw", 3);
     }
 
     /** Initialises the algorithm with the properties as they were when this algorithm was removed from Mantid,
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRaw2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRaw2.cpp
index f7bb11917d5afafeaebf2182b6db953a5186b83e..7484852e04d451ed3e6244ac29de102ea4af98d1 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadRaw2.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadRaw2.cpp
@@ -18,7 +18,7 @@ namespace Mantid
     /// Empty default constructor
     LoadRaw2::LoadRaw2() : Algorithm(), DeprecatedAlgorithm()
     {
-      useAlgorithm("LoadRaw Version 3");
+      useAlgorithm("LoadRaw", 3);
     }
 
     /** Initialises the algorithm with the properties as they were when this algorithm was removed from Mantid,
diff --git a/Code/Mantid/Framework/DataHandling/test/CreateChunkingFromInstrumentTest.h b/Code/Mantid/Framework/DataHandling/test/CreateChunkingFromInstrumentTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..cd007b8a197a472ae8a32af8070e6c987b5043fc
--- /dev/null
+++ b/Code/Mantid/Framework/DataHandling/test/CreateChunkingFromInstrumentTest.h
@@ -0,0 +1,138 @@
+#ifndef MANTID_DATAHANDLING_CREATECHUNKINGFROMINSTRUMENTTEST_H_
+#define MANTID_DATAHANDLING_CREATECHUNKINGFROMINSTRUMENTTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidAPI/ITableWorkspace.h"
+#include "MantidDataHandling/CreateChunkingFromInstrument.h"
+
+using Mantid::DataHandling::CreateChunkingFromInstrument;
+using namespace Mantid::API;
+
+class CreateChunkingFromInstrumentTest : public CxxTest::TestSuite
+{
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static CreateChunkingFromInstrumentTest *createSuite() { return new CreateChunkingFromInstrumentTest(); }
+  static void destroySuite( CreateChunkingFromInstrumentTest *suite ) { delete suite; }
+
+
+  void test_Init()
+  {
+    CreateChunkingFromInstrument alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT( alg.isInitialized() )
+  }
+  
+  void test_snap()
+  {
+    // Name of the output workspace.
+    std::string outWSName("CreateChunkingFromInstrumentTest_OutputSNAP");
+  
+    CreateChunkingFromInstrument alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT( alg.isInitialized() )
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("InstrumentName", "snap") );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("ChunkNames", "East,West"); );
+    TS_ASSERT_THROWS_NOTHING( alg.setProperty("MaxBankNumber", 20) );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWSName) );
+    TS_ASSERT_THROWS_NOTHING( alg.execute(); );
+    TS_ASSERT( alg.isExecuted() );
+    
+    // Retrieve the workspace from data service. TODO: Change to your desired type
+    Workspace_sptr ws;
+    TS_ASSERT_THROWS_NOTHING( ws = AnalysisDataService::Instance().retrieveWS<Workspace>(outWSName) );
+    TS_ASSERT(ws);
+    if (!ws) return;
+
+    // Check the results
+    ITableWorkspace_sptr tws = boost::dynamic_pointer_cast<ITableWorkspace>(ws);
+    TS_ASSERT_EQUALS(tws->columnCount(), 1);
+    TS_ASSERT_EQUALS(tws->getColumnNames()[0], "BankName");
+    TS_ASSERT_EQUALS(tws->rowCount(), 2);
+    
+    // Remove workspace from the data service.
+    AnalysisDataService::Instance().remove(outWSName);
+  }
+  
+  void test_pg3()
+  {
+    // Name of the output workspace.
+    std::string outWSName("CreateChunkingFromInstrumentTest_OutputPOWGEN");
+
+    CreateChunkingFromInstrument alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT( alg.isInitialized() )
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("InstrumentName", "pg3") );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("ChunkBy", "Group"); );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWSName) );
+    TS_ASSERT_THROWS_NOTHING( alg.execute(); );
+    TS_ASSERT( alg.isExecuted() );
+
+    // Retrieve the workspace from data service. TODO: Change to your desired type
+    Workspace_sptr ws;
+    TS_ASSERT_THROWS_NOTHING( ws = AnalysisDataService::Instance().retrieveWS<Workspace>(outWSName) );
+    TS_ASSERT(ws);
+    if (!ws) return;
+
+    // Check the results
+    ITableWorkspace_sptr tws = boost::dynamic_pointer_cast<ITableWorkspace>(ws);
+    TS_ASSERT_EQUALS(tws->columnCount(), 1);
+    TS_ASSERT_EQUALS(tws->getColumnNames()[0], "BankName");
+    TS_ASSERT_EQUALS(tws->rowCount(), 4);
+
+    // Remove workspace from the data service.
+    AnalysisDataService::Instance().remove(outWSName);
+  }
+
+  void test_seq()
+  {
+    // Name of the output workspace.
+    std::string outWSName("CreateChunkingFromInstrumentTest_OutputSEQ");
+
+    CreateChunkingFromInstrument alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT( alg.isInitialized() )
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("InstrumentName", "seq") );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("ChunkBy", "All"); );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWSName) );
+    TS_ASSERT_THROWS_NOTHING( alg.execute(); );
+    TS_ASSERT( alg.isExecuted() );
+
+
+    // Retrieve the workspace from data service. TODO: Change to your desired type
+    Workspace_sptr ws;
+    TS_ASSERT_THROWS_NOTHING( ws = AnalysisDataService::Instance().retrieveWS<Workspace>(outWSName) );
+    TS_ASSERT(ws);
+    if (!ws) return;
+
+    // Check the results
+    ITableWorkspace_sptr tws = boost::dynamic_pointer_cast<ITableWorkspace>(ws);
+    TS_ASSERT_EQUALS(tws->columnCount(), 1);
+    TS_ASSERT_EQUALS(tws->getColumnNames()[0], "BankName");
+    TS_ASSERT_EQUALS(tws->rowCount(), 0);
+
+    // Remove workspace from the data service.
+    AnalysisDataService::Instance().remove(outWSName);
+  }
+
+  void test_seq_fails()
+  {
+    // Name of the output workspace.
+    std::string outWSName("CreateChunkingFromInstrumentTest_OutputSEQ");
+
+    // configure a version to throw an exception
+    CreateChunkingFromInstrument alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT( alg.isInitialized() )
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("InstrumentName", "seq") );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("ChunkNames", "B row,C row,D row"); );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWSName) );
+    TS_ASSERT_THROWS_NOTHING( alg.execute() );//, std::runtime_error );
+    TS_ASSERT( !alg.isExecuted() );
+  }
+};
+
+
+#endif /* MANTID_DATAHANDLING_CREATECHUNKINGFROMINSTRUMENTTEST_H_ */
diff --git a/Code/Mantid/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h b/Code/Mantid/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..0f5d135158d8f026101e12455b6146fdaf296672
--- /dev/null
+++ b/Code/Mantid/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h
@@ -0,0 +1,102 @@
+#ifndef MANTID_DATAHANDLING_EXTRACTMONITORWORKSPACETEST_H_
+#define MANTID_DATAHANDLING_EXTRACTMONITORWORKSPACETEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidDataHandling/ExtractMonitorWorkspace.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+
+using Mantid::DataHandling::ExtractMonitorWorkspace;
+using namespace Mantid::API;
+
+class ExtractMonitorWorkspaceTest : public CxxTest::TestSuite
+{
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static ExtractMonitorWorkspaceTest *createSuite() { return new ExtractMonitorWorkspaceTest(); }
+  static void destroySuite( ExtractMonitorWorkspaceTest *suite ) { delete suite; }
+
+  ExtractMonitorWorkspaceTest() : outWSName("ExtractMonitorWorkspaceTest_OutputWS")
+  {}
+
+  void test_init()
+  {
+    ExtractMonitorWorkspace alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT( alg.isInitialized() )
+  }
+  
+  void test_fails_if_no_monitor_workspace()
+  {
+    auto inws = WorkspaceCreationHelper::Create1DWorkspaceRand(1);
+  
+    ExtractMonitorWorkspace alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT_THROWS_NOTHING( alg.setProperty("InputWorkspace", inws) );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("MonitorWorkspace", outWSName) );
+    TS_ASSERT_THROWS_NOTHING( alg.execute(); );
+    TS_ASSERT( ! alg.isExecuted() );
+  }
+
+  void doTest(MatrixWorkspace_sptr inws, MatrixWorkspace_sptr monws)
+  {
+    inws->setMonitorWorkspace(monws);
+    TS_ASSERT_EQUALS( inws->monitorWorkspace(), monws );
+
+    ExtractMonitorWorkspace alg;
+    TS_ASSERT_THROWS_NOTHING( alg.initialize() )
+    TS_ASSERT_THROWS_NOTHING( alg.setProperty("InputWorkspace", inws) );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("MonitorWorkspace", outWSName) );
+    TS_ASSERT_THROWS_NOTHING( alg.execute(); );
+    TS_ASSERT( alg.isExecuted() );
+    
+    MatrixWorkspace_sptr ws;
+    TS_ASSERT_THROWS_NOTHING( ws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(outWSName) );
+    TS_ASSERT(ws);
+    if (!ws) return;
+
+    TS_ASSERT_EQUALS( ws, monws );
+    TSM_ASSERT( "The monitor workspace should have been wiped off the input workspace",
+                ! inws->monitorWorkspace() );
+
+    // Remove workspace from the data service.
+    AnalysisDataService::Instance().remove(outWSName);
+  }
+
+  void test_2D_2D()
+  {
+    auto inws = WorkspaceCreationHelper::Create1DWorkspaceRand(1);
+    auto monws = WorkspaceCreationHelper::Create1DWorkspaceFib(1);
+    doTest(inws, monws);
+  }
+
+  // These tests demonstrate that the workspaces don't have to be of the same type
+
+  void test_2D_event()
+  {
+    auto inws = WorkspaceCreationHelper::Create1DWorkspaceRand(1);
+    auto monws = WorkspaceCreationHelper::CreateEventWorkspace2(1,1);
+    doTest(inws, monws);
+  }
+
+  void test_event_2D()
+  {
+    auto inws = WorkspaceCreationHelper::CreateEventWorkspace2(1,1);
+    auto monws = WorkspaceCreationHelper::Create1DWorkspaceRand(1);
+    doTest(inws, monws);
+  }
+
+  void test_event_event()
+  {
+    auto inws = WorkspaceCreationHelper::CreateEventWorkspace2(1,1);
+    auto monws = WorkspaceCreationHelper::CreateEventWorkspace2(1,1);
+    doTest(inws, monws);
+  }
+
+private:
+  std::string outWSName;
+};
+
+
+#endif /* MANTID_DATAHANDLING_EXTRACTMONITORWORKSPACETEST_H_ */
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h
index df4f624a2e8c05c120f5f0e1a16f9e5d66d173d0..531f4036a611aa0f4ee7d59d5cebf9f935d35585 100644
--- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h
@@ -82,7 +82,7 @@ public:
   //! Get a pointer to the ith component in the assembly
   boost::shared_ptr<IComponent> operator[](int i) const;
   /// Returns a pointer to the first component of assembly encountered with the given name
-  boost::shared_ptr<const IComponent> getComponentByName(const std::string & cname, int nlevels = 0) const;
+  virtual boost::shared_ptr<const IComponent> getComponentByName(const std::string & cname, int nlevels = 0) const;
 
 
   Kernel::V3D getPos() const;
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h
index 11596c4fae94e753169b3c1018e2f6ea7a4acbbd..c57dfcdd91ba3a2e9d9f3eda83e0f9551b53b74b 100644
--- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h
@@ -76,7 +76,7 @@ public:
   //! Get all children
   void getChildren(std::vector<IComponent_const_sptr> & outVector, bool recursive) const;
   //! Returns a pointer to the first component of assembly encountered with the given name
-  boost::shared_ptr<const IComponent> getComponentByName(const std::string & cname, int nlevels = 0) const;
+  virtual boost::shared_ptr<const IComponent> getComponentByName(const std::string & cname, int nlevels = 0) const;
   //! Get a pointer to the ith component in the assembly
   boost::shared_ptr<IComponent> operator[](int i) const;
   //! Print information about all children
diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h
index ecade9ad74ea645b3e990cce78127e9aeab248de..48132d1da669c6aecc11b31a7296ec812bbf06d1 100644
--- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h
+++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Instrument/RectangularDetector.h
@@ -107,6 +107,7 @@ public:
   int minDetectorID();
   /// maximum detector id
   int maxDetectorID();
+  virtual boost::shared_ptr<const IComponent> getComponentByName(const std::string & cname, int nlevels = 0) const;
 
   // This should inherit the getBoundingBox implementation from  CompAssembly but
   // the multiple inheritance seems to confuse it so we'll explicityly tell it that here
diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp
index d2930924dbca5619201d5ffcd1886f6007c4395e..998d85f624d25543b042db0fb48b9b5361623fc9 100644
--- a/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp
+++ b/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp
@@ -1,10 +1,11 @@
 #include "MantidGeometry/Instrument/CompAssembly.h"
+#include "MantidGeometry/Instrument/RectangularDetector.h"
 #include "MantidGeometry/Instrument/ParComponentFactory.h"
 #include "MantidGeometry/IObjComponent.h"
 #include "MantidGeometry/Objects/BoundingBox.h"
 #include <algorithm>
 #include <ostream>
-#include <stdexcept> 
+#include <stdexcept>
 
 namespace Mantid
 {
@@ -339,7 +340,21 @@ boost::shared_ptr<const IComponent> CompAssembly::getComponentByName(const std::
         {
           // don't bother adding things to the queue that aren't assemblies
           if (bool(boost::dynamic_pointer_cast<const ICompAssembly>(comp)))
-            nodeQueue.push_back(comp);
+          {
+            // for rectangular detectors search the depth rather than siblings as there
+            // is a specific naming convention to speed things along
+            auto rectDet = boost::dynamic_pointer_cast<const RectangularDetector>(comp);
+            if (bool(rectDet))
+            {
+              auto child = rectDet->getComponentByName(cname, nlevels);
+              if (child)
+                return child;
+            }
+            else
+            {
+              nodeQueue.push_back(comp);
+            }
+          }
         }
       }
     }
diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/RectangularDetector.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/RectangularDetector.cpp
index 290690bc800408bc46ef9f34889e71516209de7d..8dfdbc9f571f427ae4551056fc9488b9b6b47ffe 100644
--- a/Code/Mantid/Framework/Geometry/src/Instrument/RectangularDetector.cpp
+++ b/Code/Mantid/Framework/Geometry/src/Instrument/RectangularDetector.cpp
@@ -462,7 +462,28 @@ int RectangularDetector::maxDetectorID()
   return m_maxDetId;
 }
 
+//-------------------------------------------------------------------------------------------------
+/// @copydoc Mantid::Geometry::CompAssembly::getComponentByName
+boost::shared_ptr<const IComponent> RectangularDetector::getComponentByName(const std::string & cname, int nlevels) const
+{
+  // cache the detector's name as all the other names are longer
+  const std::string NAME = this->getName();
+
+  // if the component name is too short, just return
+  if (cname.length() <= NAME.length())
+      return boost::shared_ptr<const IComponent>();
 
+  // check that the searched for name starts with the detector's
+  // name as they are generated
+  if (cname.substr(0, NAME.length()).compare(NAME) == 0)
+  {
+    return CompAssembly::getComponentByName(cname, nlevels);
+  }
+  else
+  {
+    return boost::shared_ptr<const IComponent>();
+  }
+}
 
 //------------------------------------------------------------------------------------------------
 /** Test the intersection of the ray with the children of the component assembly, for InstrumentRayTracer.
diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt
index e60d22d53aab342ec93b3d98f893171e4dc70d85..744077cca3ea2080effc1aaed3b441988963bc71 100644
--- a/Code/Mantid/Framework/Kernel/CMakeLists.txt
+++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt
@@ -410,7 +410,8 @@ set ( QTPLUGINS "." )
 set ( PYTHONPLUGIN_DIRS "${MANTID_ROOT}/Framework/PythonInterface/plugins" )
 set ( DATADIRS ${MANTID_ROOT}/../../Test/AutoTestData;${MANTID_ROOT}/../../Test/AutoTestData/UsageData;${MANTID_ROOT}/instrument )
 set ( COLORMAPS_FOLDER ${MANTID_ROOT}/Installers/colormaps/ )
-SET ( MANTIDPUBLISHER "http://upload.mantidproject.org/scriptrepository/payload/publish_debug" )
+set ( MANTIDPUBLISHER "http://upload.mantidproject.org/scriptrepository/payload/publish_debug" )
+set ( HTML_ROOT ${DOCS_BUILDDIR}/html )
 
 # Construct script paths.
 set ( MANTID_SCRIPTS ${MANTID_ROOT}/scripts )
@@ -483,7 +484,8 @@ endif ()
 set ( PLUGINS ${MANTID_ROOT}/plugins )
 set ( PYTHONPLUGIN_DIRS "${PLUGINS}/python" )
 set ( DATADIRS "" )
-SET ( MANTIDPUBLISHER "http://upload.mantidproject.org/scriptrepository/payload/publish" )
+set ( MANTIDPUBLISHER "http://upload.mantidproject.org/scriptrepository/payload/publish" )
+set ( HTML_ROOT ../share/doc/html )
 
 # Construct script paths by replacing the old MANTID_ROOT with the new one.
 # Unfortunately string (REGEX REPLACE ... )removes the semi-colons so we have to do this in a loop.
diff --git a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h
index 627f13ca1f455d213e150d9e66e5f76e97db7898..0afa134d8d44f679f537ed6208352b58fabfb8e4 100644
--- a/Code/Mantid/Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h
+++ b/Code/Mantid/Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h
@@ -94,6 +94,8 @@ namespace Mantid
       // available and call this function if it is.
       void initWorkspacePart2();
 
+      void initMonitorWorkspace();
+
       // Check to see if all the conditions we need for initWorkspacePart2() have been
       // met.  Making this a function because it's starting to get a little complicated
       // and I didn't want to be repeating the same tests in several places...
@@ -122,6 +124,7 @@ namespace Mantid
       bool m_workspaceInitialized;
       std::string m_wsName;
       detid2index_map m_indexMap;  // maps pixel id's to workspace indexes
+      detid2index_map m_monitorIndexMap;  // Same as above for the monitor workspace
 
       // We need these 2 strings to initialize m_buffer
       std::string m_instrumentName;
diff --git a/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp b/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp
index c68eef53980b0c1b35c52ea1e30b15db48654e26..ceaedd543ed3b6d2baef84bc6dc42535b1f8835e 100644
--- a/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp
+++ b/Code/Mantid/Framework/LiveData/src/SNSLiveEventDataListener.cpp
@@ -230,9 +230,7 @@ namespace LiveData
     // Yes, I know a send isn't guaranteed to send the whole buffer in one call.
     // I'm treating such a case as an error anyway.
     {
-      g_log.error()
-        << "SNSLiveEventDataListener::run(): Failed to send client hello packet.  Thread exiting."
-        << std::endl;
+      g_log.error("SNSLiveEventDataListener::run(): Failed to send client hello packet. Thread exiting.");
       m_stopThread = true;
     }
 
@@ -262,7 +260,7 @@ namespace LiveData
           bytesRead = m_socket.receiveBytes( bufFillAddr, bufFillLen);
         } catch (Poco::TimeoutException &) {
           // Don't need to stop processing or anything - just log a warning
-          g_log.warning() << "Timeout reading from the network.  Is SMS still sending?" << std::endl;
+          g_log.warning("Timeout reading from the network.  Is SMS still sending?");
         } catch (Poco::Net::NetException &e) {
           std::string msg("Parser::read(): ");
           msg += e.name();
@@ -294,28 +292,27 @@ namespace LiveData
       // For now, log it and let the thread exit.  In the future, we might
       // try to recover from this.  (A bad event packet could probably just
       // be ignored, for example)
-      g_log.fatal() << "Caught an invalid packet exception in SNSLiveEventDataListener"
-                    << " network read thread." << std::endl;
-      g_log.fatal() << "Exception message is: " << e.what() << std::endl;
-      g_log.fatal() << "Thread is exiting." << std::endl;
+      g_log.fatal() << "Caught an invalid packet exception in SNSLiveEventDataListener network read thread.\n"
+                    << "Exception message is: " << e.what() << ".\n"
+                    << "Thread is exiting.\n";
 
       m_isConnected = false;
 
       m_backgroundException = boost::shared_ptr<std::runtime_error>( new ADARA::invalid_packet(e));
 
     } catch (std::runtime_error &e) {  // exception handler for generic runtime exceptions
-      g_log.fatal() << "Caught a runtime exception." << std::endl
-                    << "Exception message: " << e.what() << std::endl
-                    << "Thread will exit." << std::endl;
+      g_log.fatal() << "Caught a runtime exception.\n"
+                    << "Exception message: " << e.what() << ".\n"
+                    << "Thread will exit.\n";
       m_isConnected = false;
 
       m_backgroundException = boost::shared_ptr<std::runtime_error>( new std::runtime_error( e));
 
     } catch (std::invalid_argument &e) { // TimeSeriesProperty (and possibly some other things) can
                                         // can throw these errors
-      g_log.fatal() << "Caught an invalid argument exception." << std::endl
-                    << "Exception message: "  << e.what() << std::endl
-                    << "Thread will exit." << std::endl;
+      g_log.fatal() << "Caught an invalid argument exception.\n"
+                    << "Exception message: "  << e.what() << ".\n"
+                    << "Thread will exit.\n";
       m_isConnected = false;
       m_workspaceInitialized = true;  // see the comments in the default exception
                                       // handler for why we set this value.
@@ -324,8 +321,8 @@ namespace LiveData
       m_backgroundException = boost::shared_ptr<std::runtime_error>( new std::runtime_error( newMsg));
 
     } catch (...) {  // Default exception handler
-      g_log.fatal() << "Uncaught exception in SNSLiveEventDataListener network read thread."
-                    << "  Thread is exiting." << std::endl;
+      g_log.fatal("Uncaught exception in SNSLiveEventDataListener network read thread."
+                  " Thread is exiting.");
       m_isConnected = false;
 
       m_backgroundException =
@@ -372,7 +369,7 @@ namespace LiveData
       // we can't process this packet at all.
       if (! m_workspaceInitialized)
       {
-        g_log.error() << "Cannot process BankedEventPacket because workspace isn't initialized." << std::endl;
+        g_log.error("Cannot process BankedEventPacket because workspace isn't initialized.");
         // Note: One error message per BankedEventPkt is likely to absolutely flood the error log.
         // Might want to think about rate limiting this somehow...
 
@@ -394,7 +391,8 @@ namespace LiveData
     }
 
     // Append the events
-    g_log.debug() << "----- Pulse ID: " << pkt.pulseId() << " -----" << std::endl;
+    g_log.debug() << "----- Pulse ID: " << pkt.pulseId() << " -----\n";
+    // Scope braces
     {
       Poco::ScopedLock<Poco::FastMutex> scopedLock(m_mutex);
 
@@ -432,8 +430,7 @@ namespace LiveData
         event = pkt.nextEvent();
         if (pkt.curBankId() != lastBankID)
         {
-          g_log.debug() << "BankID " << lastBankID << " had " << eventsPerBank
-                        << " events" << std::endl;
+          g_log.debug() << "BankID " << lastBankID << " had " << eventsPerBank << " events\n";
 
           lastBankID = pkt.curBankId();
           eventsPerBank = 0;
@@ -441,8 +438,8 @@ namespace LiveData
       }
     }  // mutex automatically unlocks here
 
-    g_log.debug() << "Total Events: " << totalEvents << std::endl;
-    g_log.debug() << "-------------------------------" << std::endl;
+    g_log.debug() << "Total Events: " << totalEvents << "\n";
+    g_log.debug("-------------------------------");
 
     return false;
   }
@@ -467,6 +464,10 @@ namespace LiveData
       return false;
     }
 
+    auto monitorBuffer =
+        boost::static_pointer_cast<DataObjects::EventWorkspace>(m_eventBuffer->monitorWorkspace());
+    const auto pktTime = timeFromPacket(pkt);
+
     while (pkt.nextSection())
     {
       unsigned monitorID = pkt.getSectionMonitorID();
@@ -492,26 +493,31 @@ namespace LiveData
         int events = pkt.getSectionEventCount();
         if (m_eventBuffer->run().hasProperty(monName))
         {
-        events += m_eventBuffer->run().getPropertyValueAsType<int>(monName);
+          events += m_eventBuffer->run().getPropertyValueAsType<int>(monName);
         }
         else
         {
-        // First time we've received this monitor.  Add it to our list
-        m_monitorLogs.push_back(monName);
+          // First time we've received this monitor.  Add it to our list
+          m_monitorLogs.push_back(monName);
         }
 
         // Update the property value (overwriting the old value if there was one)
         m_eventBuffer->mutableRun().addProperty<int>( monName, events, true);
         
-        // This is where we'll fetch the time-of-flight values for each
-        // event 
-        bool risingEdge;
-        uint32_t cycle;
-        uint32_t tof;
-        while (pkt.nextEvent( risingEdge, cycle, tof))
+        auto it = m_monitorIndexMap.find(-1 * monitorID); // Monitor IDs are negated in Mantid IDFs
+        if ( it != m_monitorIndexMap.end() )
+        {
+          bool risingEdge;
+          uint32_t cycle, tof;
+          while (pkt.nextEvent( risingEdge, cycle, tof))
+          {
+            // Add the event. Note that they're in units of 100 ns in the packet, need to change to microseconds.
+            monitorBuffer->getEventList(it->second).addEventQuickly(DataObjects::TofEvent(tof/10.0,pktTime));
+          }
+        }
+        else
         {
-          // TODO: Fill this section in - just as soon as we figure out what
-          // to actually do with the values.
+          g_log.error() << "Event from unknown monitor ID (" << monitorID << ") seen.\n";
         }
       }
     }
@@ -729,8 +735,8 @@ namespace LiveData
         if ( haveRunNumber )
         {
           // run_number should not exist at this point, and if it does, we can't do much about it.
-          g_log.debug() << "run_number property already exists.  Current value will be ignored.\n"
-                        << "(This should never happen.  Talk to the Mantid developers.)" << std::endl;
+          g_log.debug("run_number property already exists.  Current value will be ignored.\n"
+                      "(This should never happen.  Talk to the Mantid developers.)");
         }
         else
         {
@@ -1029,7 +1035,7 @@ namespace LiveData
 
     if ( ! deviceNode )
     {
-      g_log.error() << "Device descriptor packet did not contain a device element!!  This should never happen!" << std::endl;
+      g_log.error("Device descriptor packet did not contain a device element!!  This should never happen!");
       return false;
     }
 
@@ -1045,7 +1051,7 @@ namespace LiveData
 
     if ( ! node )
     {
-      g_log.warning() << "Device descriptor packet did not contain a process_variables element." << std::endl;
+      g_log.warning("Device descriptor packet did not contain a process_variables element.");
       return false;
     }
 
@@ -1237,7 +1243,7 @@ namespace LiveData
   /// cases, must) be done prior to receiving any packets from the SMS daemon.
   void SNSLiveEventDataListener::initWorkspacePart1()
   {
-    m_eventBuffer = boost::dynamic_pointer_cast<DataObjects::EventWorkspace>
+    m_eventBuffer = boost::static_pointer_cast<DataObjects::EventWorkspace>
         (WorkspaceFactory::Instance().create("EventWorkspace", 1, 1, 1));
     // The numbers in the create() function don't matter - they'll get overwritten
     // down in initWorkspacePart2() when we load the instrument definition.
@@ -1290,9 +1296,28 @@ namespace LiveData
       m_eventBuffer->mutableRun().getTimeSeriesProperty<int>( SCAN_PROPERTY)->addValue( m_dataStartTime, 0);
     }
 
+    initMonitorWorkspace();
+
     m_workspaceInitialized = true;
   }
 
+  /// Creates a monitor workspace sized to the number of monitors, with the monitor IDs set
+  void SNSLiveEventDataListener::initMonitorWorkspace()
+  {
+    auto monitors = m_eventBuffer->getInstrument()->getMonitors();
+    auto monitorsBuffer = WorkspaceFactory::Instance().create("EventWorkspace",monitors.size(),1,1);
+    WorkspaceFactory::Instance().initializeFromParent(m_eventBuffer,monitorsBuffer,true);
+    // Set the id numbers
+    for ( size_t i = 0; i < monitors.size(); ++i )
+    {
+      monitorsBuffer->getSpectrum(i)->setDetectorID( monitors[i] );
+    }
+
+    m_monitorIndexMap = monitorsBuffer->getDetectorIDToWorkspaceIndexMap( true );
+
+    m_eventBuffer->setMonitorWorkspace(monitorsBuffer);
+  }
+
   // Check to see if we have data for all of the logs listed in m_requiredLogs.
   // NOTE: This function does not lock the mutex!  The calling function must
   // ensure that m_eventBuffer won't change while the function runs (either by
@@ -1398,6 +1423,13 @@ namespace LiveData
     }
     m_monitorLogs.clear();
 
+    // Create a fresh monitor workspace and insert into the new 'main' workspace
+    auto monitorBuffer = m_eventBuffer->monitorWorkspace();
+    auto newMonitorBuffer = WorkspaceFactory::Instance().create("EventWorkspace",
+                              monitorBuffer->getNumberHistograms(), 1, 1 );
+    WorkspaceFactory::Instance().initializeFromParent(monitorBuffer, newMonitorBuffer, false);
+    temp->setMonitorWorkspace(newMonitorBuffer);
+
     // Lock the mutex and swap the workspaces
     {
       Poco::ScopedLock<Poco::FastMutex> scopedLock( m_mutex);
diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Stitch1DMD.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Stitch1DMD.h
index 445880c3c58cd9063d10e9941d4d0ea6747f9033..e24d1463115de8580fe9cb1f67f63ef74dea452d 100644
--- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Stitch1DMD.h
+++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Stitch1DMD.h
@@ -2,6 +2,7 @@
 #define MANTID_MDALGORITHMS_STITCH1D_H_
 
 #include "MantidKernel/System.h"
+#include "MantidAPI/DeprecatedAlgorithm.h"
 #include "MantidAPI/MultiPeriodGroupAlgorithm.h"
 #include "MantidMDEvents/MDHistoWorkspace.h"
 #include "MantidMDEvents/MDEventWorkspace.h"
@@ -33,7 +34,7 @@ namespace MDAlgorithms
     File change history is stored at: <https://github.com/mantidproject/mantid>
     Code Documentation is available at: <http://doxygen.mantidproject.org>
   */
-  class DLLExport Stitch1DMD  : public API::MultiPeriodGroupAlgorithm
+  class DLLExport Stitch1DMD  : public API::MultiPeriodGroupAlgorithm, public API::DeprecatedAlgorithm
   {
   public:
     Stitch1DMD();
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/Stitch1DMD.cpp b/Code/Mantid/Framework/MDAlgorithms/src/Stitch1DMD.cpp
index d4facda66b477b2cc88aae4eb5bed4a8df1a350d..d0f7a0de65b78f5f9cb2eb5debccccba3ad7b887 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/Stitch1DMD.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/Stitch1DMD.cpp
@@ -40,6 +40,7 @@ namespace MDAlgorithms
    */
   Stitch1DMD::Stitch1DMD()
   {
+    this->useAlgorithm("Stitch1D");
   }
     
   //----------------------------------------------------------------------------------------------
diff --git a/Code/Mantid/Framework/Properties/Mantid.properties.template b/Code/Mantid/Framework/Properties/Mantid.properties.template
index ac2bfe7691a5815e264ea632212fe8481c8686ce..53da75d63cccbf7a82617ef5b16e03de0f7c10e2 100644
--- a/Code/Mantid/Framework/Properties/Mantid.properties.template
+++ b/Code/Mantid/Framework/Properties/Mantid.properties.template
@@ -13,7 +13,7 @@
 default.facility = ISIS
 
 # Set a default instrument
-default.instrument = 
+default.instrument =
 
 # Set of PyQt interfaces to add to the Interfaces menu, separated by a space.  Interfaces are seperated from their respective categories by a "/".
 mantidqt.python_interfaces = Direct/DGS_Reduction.py SANS/ORNL_SANS.py Reflectometry/REFL_Reduction.py Reflectometry/REFL_SF_Calculator.py Reflectometry/REFM_Reduction.py Utility/TofConverter.py Reflectometry/ISIS_Reflectometry.py Diffraction/Powder_Diffraction_Reduction.py
@@ -78,19 +78,22 @@ paraview.path = @PARAVIEW_APP_BIN_DIR@
 # Whether to look for ParaView (0 = try to use, 1 = don't use).
 paraview.ignore = @IGNORE_PARAVIEW@
 
+# Root of html documentation (kept as unix-style path)
+docs.html.root = @HTML_ROOT@
+
 # A semi-colon(;) separated list of directories to use to search for files other than data
 # Use forward slash / for all paths
-usersearch.directories = 
+usersearch.directories =
 
 # Setting this to On enables searching the facilitie's archive automatically
 datasearch.searcharchive = Off
 
 # A default directory to use for saving files
 # Use forward slash / for all paths
-defaultsave.directory = 
+defaultsave.directory =
 
 # ICat download directory
-icatDownload.directory = 
+icatDownload.directory =
 
 # The Number of algorithms properties to retain im memory for refence in scripts.
 algorithms.retained = 50
@@ -99,7 +102,7 @@ algorithms.retained = 50
 # For machine default set to 0
 MultiThreaded.MaxCores = 0
 
-# Defines the area (in FWHM) on both sides of the peak centre within which peaks are calculated. 
+# Defines the area (in FWHM) on both sides of the peak centre within which peaks are calculated.
 # Outside this area peak functions return zero.
 curvefitting.peakRadius = 5
 curvefitting.defaultPeak=Gaussian
@@ -117,7 +120,7 @@ MantidOptions.InvisibleWorkspaces=0
 MantidOptions.InstrumentView.UseOpenGL = On
 
 #Uncommenting the line below will enable algorithm chain re-running whenever a
-#workspace is replaced. Uncommenting and setting it to 0 will also turn it off 
+#workspace is replaced. Uncommenting and setting it to 0 will also turn it off
 #enabling this is currently discouraged as it could cause race conditions with python scripts
 #AlgorithmChaining.SwitchedOn = 1
 
@@ -156,12 +159,12 @@ workspace.sendto.name.SansView=0
 # Change this property to On to make Mantid case sensitive (ignored on Windows as file searching is always case insensitve)
 filefinder.casesensitive=On
 
-# Control which geometry the Instrument View window displays, valid values 
+# Control which geometry the Instrument View window displays, valid values
 # are "Default", "Neutronic" or "Physical".
 instrument.view.geometry=Default
 
 # Disabling multifile loading will allow users to load files with "," or "+"
-# in their path, but at the cost of no longer being able to load multiple 
+# in their path, but at the cost of no longer being able to load multiple
 # files with a single call to Load.
 loading.multifile=On
 
@@ -176,15 +179,15 @@ algorithms.categories.hidden=Workflow\\Inelastic\\UsesPropertyManager;Workflow\\
 # All interface categories are shown by default.
 interfaces.categories.hidden =
 
-# ScriptRepository Properties: 
+# ScriptRepository Properties:
 
 # Url for the WebServer that support the upload of the files that the users want to share
 UploaderWebServer = @MANTIDPUBLISHER@
 # Local system path for the script repository.
-ScriptLocalRepository = 
+ScriptLocalRepository =
 # Url for the remote script repository.
 ScriptRepository = http://download.mantidproject.org/scriptrepository/
-# Pattern given to ScriptRepository that is used to hide entries from repository to the users. It is a csv string separated with ';' 
+# Pattern given to ScriptRepository that is used to hide entries from repository to the users. It is a csv string separated with ';'
 ScriptRepositoryIgnore = *pyc;
 
 # The ability to send a job to a cluster form the reduction UIs is turned off. Set it to 'On' to enable it.
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py
index 291c6f35b3314e52f916597f8d93e3f785c60264..a826ca6de1faae91d6ca764ca187a4cb0017f1e1 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py
@@ -34,7 +34,7 @@ _LOGGING_ = False
 class LoadVesuvio(PythonAlgorithm):
     
     def summary(self):
-      return "A Workflow algorithm to load the data from the VESUVIO instrument at ISIS."
+      return "Loads raw data produced by the Vesuvio instrument at ISIS."
 
     def PyInit(self):
         self.declareProperty(RUN_PROP, "", StringMandatoryValidator(),
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Mean.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Mean.py
index 16342108b3a0139bb91560660da0a91bf0fba8c5..3c32a2c8df93385bea8e71359734a140eeeccfea 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Mean.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/Mean.py
@@ -11,7 +11,7 @@ class Mean(PythonAlgorithm):
         return "Mean"
 
     def summary(self):
-        return "Calculates the mean of the workspaces provided."
+        return "Calculates the arithemetic mean of the workspaces provided."
         
     def PyInit(self):
         mustHaveWorkspaceNames = StringMandatoryValidator()
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ReflectometryReductionOneBaseTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ReflectometryReductionOneBaseTest.py
index 9b7c6e6135f8f3fa8ff2015ec9e39129fbed7f78..f67af4ab9879cbb23e55e6fc85d79dc58fb93702 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ReflectometryReductionOneBaseTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/ReflectometryReductionOneBaseTest.py
@@ -36,8 +36,7 @@ class ReflectometryReductionOneBaseTest(object):
     def tearDown(self):
         DeleteWorkspace(self.__tof)
         DeleteWorkspace(self.__not_tof)
-    
-    
+        
     def test_check_input_workpace_not_tof_throws(self):
         alg = self.construct_standard_algorithm()
         alg.set_InputWorkspace(self.__not_tof)
@@ -262,13 +261,33 @@ class ReflectometryReductionOneBaseTest(object):
         self.assertAlmostEqual(0.70969419, theta, 4)
         
         DeleteWorkspace(real_run)
+           
+    def test_correct_positions_point_detector(self):
+        alg = self.construct_standard_algorithm()
+        real_run = Load('INTER00013460.nxs')
+        alg.set_InputWorkspace(real_run)
+        alg.set_ProcessingInstructions("3,4")
+        alg.set_FirstTransmissionRun(real_run) # Currently a requirement that one transmisson correction is provided.
+        alg.set_ThetaIn(0.4) # Low angle
+        alg.set_CorrectDetectorPositions(True)
+        out_ws_q1, out_ws_lam1, theta1 = alg.execute()
+        pos1 = out_ws_lam1.getInstrument().getComponentByName('point-detector').getPos()
+        
+        alg.set_ThetaIn(0.8) # Repeat with greater incident angle
+        out_ws_q2, out_ws_lam2, theta2 = alg.execute()
+        pos2 = out_ws_lam2.getInstrument().getComponentByName('point-detector').getPos()
+        
+        self.assertTrue(pos2.Y() > pos1.Y(), "Greater incident angle so greater height.")
+        self.assertEqual(pos2.X(), pos1.X())
+        self.assertEqual(pos2.Z(), pos1.Z())
+        DeleteWorkspace(real_run)
         
     def test_multidetector_run(self):
         alg = self.construct_standard_algorithm()
         real_run = Load('POLREF00004699.nxs')
         alg.set_InputWorkspace(real_run[0])
         alg.set_AnalysisMode("MultiDetectorAnalysis")
-        alg.set_DetectorComponentName('lineardetector')
+        alg.set_CorrectDetectorPositions(False)
         alg.set_ProcessingInstructions("3, 10") # Fictional values
         alg.set_RegionOfDirectBeam("20, 30") # Fictional values
         alg.set_ThetaIn(0.1) # Fictional values
@@ -281,3 +300,20 @@ class ReflectometryReductionOneBaseTest(object):
         self.assertTrue(isinstance(out_ws_q, mantid.api.MatrixWorkspace), "Should be a matrix workspace")
         self.assertEqual("MomentumTransfer", out_ws_q.getAxis(0).getUnit().unitID())
         
+    def test_correct_positions_multi_detector(self):
+        alg = self.construct_standard_algorithm()
+        real_run = Load('POLREF00004699.nxs')
+        alg.set_InputWorkspace(real_run[0])
+        alg.set_AnalysisMode("MultiDetectorAnalysis")
+        alg.set_CorrectDetectorPositions(True)
+        alg.set_ProcessingInstructions("73") 
+        alg.set_RegionOfDirectBeam("28,29") 
+        alg.set_ThetaIn(0.49/2) 
+        out_ws_q, out_ws_lam, theta =  alg.execute()
+        
+        pos = out_ws_lam.getInstrument().getComponentByName('lineardetector').getPos()
+        self.assertAlmostEqual(-0.05714, pos.Z(), 3, "Vertical correction is wrong. Recorded as: " + str(pos.Z()))
+        
+        
+        
+        
diff --git a/Code/Mantid/MantidPlot/mantidplot.py b/Code/Mantid/MantidPlot/mantidplot.py
index 663ac35bd24fbbda6e939a589ad5af69b91def65..76099c59359bbdd67be61e82113de015ce68c6f2 100644
--- a/Code/Mantid/MantidPlot/mantidplot.py
+++ b/Code/Mantid/MantidPlot/mantidplot.py
@@ -867,7 +867,6 @@ class Screenshot(QtCore.QObject):
         thread
         """
         # First save the screenshot
-        widget.show()
         widget.resize(widget.size())
         QtCore.QCoreApplication.processEvents()
         
diff --git a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
index 071663e8c05a5af4e40ee230dddfcc53dc71915e..daeef8476f9085e10fa47041990176317d3f537b 100644
--- a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
+++ b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
@@ -225,7 +225,7 @@ void file_uncompress(const char  *file);
 }
 
 ApplicationWindow::ApplicationWindow(bool factorySettings)
-: QMainWindow(), 
+: QMainWindow(),
 Scripted(ScriptingLangManager::newEnv(this)),
 blockWindowActivation(false),
 m_enableQtiPlotFitting(false),
@@ -241,7 +241,7 @@ m_exitCode(0),
 }
 
 ApplicationWindow::ApplicationWindow(bool factorySettings, const QStringList& args)
-: QMainWindow(), 
+: QMainWindow(),
 Scripted(ScriptingLangManager::newEnv(this)),
 blockWindowActivation(false),
 m_enableQtiPlotFitting(false),
@@ -344,7 +344,7 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args)
   resultsLog = new MessageDisplay(MessageDisplay::EnableLogLevelControl, logWindow);
   logWindow->setWidget(resultsLog);
   connect(resultsLog, SIGNAL(errorReceived(const QString &)), logWindow, SLOT(show()));
-  
+
 
   // Start Mantid
   // Set the Paraview path BEFORE libaries are loaded. Doing it here prevents
@@ -486,7 +486,7 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args)
       g_log.warning() << "Could not find interface script: " << scriptPath.ascii() << "\n";
     }
   }
-  
+
   MantidQt::API::InterfaceManager interfaceManager;
   // Add all interfaces inherited from UserSubWindow.
   foreach(const QString userSubWindowName, interfaceManager.getUserSubWindowKeys())
@@ -645,7 +645,7 @@ void ApplicationWindow::trySetParaviewPath(const QStringList& commandArguments,
         pv.exec();
       }
     }
-  
+
 #else
   UNUSED_ARG(commandArguments)
   UNUSED_ARG(noDialog)
@@ -818,7 +818,7 @@ void ApplicationWindow::initGlobalConstants()
   autoscale2DPlots = true;
   autoScaleFonts = true;
   autoResizeLayers = true;
-  antialiasing2DPlots = true; 
+  antialiasing2DPlots = true;
   fixedAspectRatio2DPlots = false; //Mantid
   d_scale_plots_on_print = false;
   d_print_cropmarks = false;
@@ -1280,7 +1280,7 @@ void ApplicationWindow::initMainMenu()
   ///The paraview action should only be available on windows
 #ifdef _WIN32
   help->addAction(actionSetupParaview);
-  help->insertSeparator(); 
+  help->insertSeparator();
 #endif
 
   help->addAction(actionAbout);
@@ -1467,7 +1467,7 @@ void ApplicationWindow::customMenu(MdiSubWindow* w)
       format->addAction(actionShowTitleDialog);
 
 
-  
+
     } else if (w->isA("Graph3D")) {
       disableActions();
 
@@ -1542,7 +1542,7 @@ void ApplicationWindow::customMenu(MdiSubWindow* w)
 
     } else if (!mantidUI->menuAboutToShow(w)) // Note that this call has a side-effect (it enables menus)
         disableActions();
-   
+
   } else
     disableActions();
 
@@ -1558,7 +1558,7 @@ void ApplicationWindow::customMenu(MdiSubWindow* w)
   }
 
   myMenuBar()->insertItem(tr("&Catalog"),icat);
-  
+
   // -- INTERFACE MENU --
   myMenuBar()->insertItem(tr("&Interfaces"), interfaceMenu);
   interfaceMenuAboutToShow();
@@ -2726,7 +2726,7 @@ MultiLayer* ApplicationWindow::newGraph(const QString& caption)
  * @param clearWindow   :: Whether to clear existing window before plotting. Ignored if window is NULL
  * @return Pointer to created window if window == NULL, otherwise - window.
  */
-MultiLayer* ApplicationWindow::prepareMultiLayer(bool& isNew, MultiLayer* window, const QString& newWindowName, bool clearWindow) 
+MultiLayer* ApplicationWindow::prepareMultiLayer(bool& isNew, MultiLayer* window, const QString& newWindowName, bool clearWindow)
 {
   isNew = false;
 
@@ -2735,9 +2735,9 @@ MultiLayer* ApplicationWindow::prepareMultiLayer(bool& isNew, MultiLayer* window
     window = multilayerPlot(generateUniqueName( newWindowName + "-"));
     window->setCloseOnEmpty(true);
     isNew = true;
-  } 
+  }
   else if(clearWindow)
-  { 
+  {
     window->setLayersNumber(0); // Clear by removing all the layers
   }
 
@@ -2759,7 +2759,7 @@ MultiLayer* ApplicationWindow::prepareMultiLayer(bool& isNew, MultiLayer* window
     g->setTitle( newWindowName );
   }
 
-  return window; 
+  return window;
 }
 
 MultiLayer* ApplicationWindow::multilayerPlot(Table* w, const QStringList& colList, int style, int startRow, int endRow)
@@ -3663,7 +3663,7 @@ MdiSubWindow *ApplicationWindow::activeWindow(WindowType type)
 }
 
 void ApplicationWindow::windowActivated(QMdiSubWindow *w)
-{	
+{
   if ( !w ) return;
 
   MdiSubWindow *qti_subwin = qobject_cast<MdiSubWindow*>(w->widget());
@@ -3703,7 +3703,7 @@ void ApplicationWindow::addErrorBars()
 
   ErrDialog* ed = new ErrDialog(this);
   ed->setAttribute(Qt::WA_DeleteOnClose);
-  connect (ed,SIGNAL(options(const QString&,int,const QString&,int,bool)),this,SLOT(defineErrorBars(const QString&,int,const QString&,int,bool))); 
+  connect (ed,SIGNAL(options(const QString&,int,const QString&,int,bool)),this,SLOT(defineErrorBars(const QString&,int,const QString&,int,bool)));
   connect (ed,SIGNAL(options(const QString&,const QString&,int)),this,SLOT(defineErrorBars(const QString&,const QString&,int)));
 
   ed->setCurveNames(g->analysableCurvesList());
@@ -4452,7 +4452,7 @@ void ApplicationWindow::openRecentProject(int index)
 }
 
 ApplicationWindow* ApplicationWindow::openProject(const QString& fn, bool factorySettings, bool newProject)
-{	
+{
   ApplicationWindow *app = this;
 
   //if the current project is not saved prompt to save and close all windows opened
@@ -4777,7 +4777,7 @@ bool ApplicationWindow::setScriptingLanguage(const QString &lang)
   if ( lang.isEmpty() ) return false;
   if( scriptingEnv() && lang == scriptingEnv()->name() ) return true;
 
-  if( m_bad_script_envs.contains(lang) ) 
+  if( m_bad_script_envs.contains(lang) )
   {
     using MantidQt::API::Message;
     writeToLogWindow(Message("Previous initialization of " + lang + " failed, cannot retry.",Message::Priority::PRIO_ERROR));
@@ -4795,7 +4795,7 @@ bool ApplicationWindow::setScriptingLanguage(const QString &lang)
     connect(newEnv, SIGNAL(print(const QString&)), resultsLog, SLOT(appendNotice(const QString&)));
 
     if( newEnv->initialize() )
-    {   
+    {
       m_script_envs.insert(lang, newEnv);
     }
     else
@@ -5143,12 +5143,12 @@ void ApplicationWindow::readSettings()
   /* --------------- end group Tables ------------------------ */
 
   /* --------------- group 2D Plots ----------------------------- */
-  
+
   settings.beginGroup("/2DPlots");
-   
+
   // Transform from the old setting for plot defaults, will only happen once.
   if ( !settings.contains("/UpdateForPlotImprovements1") )
-  {    
+  {
     settings.writeEntry("/UpdateForPlotImprovements1","true");
     settings.beginGroup("/General");
 
@@ -5166,7 +5166,7 @@ void ApplicationWindow::readSettings()
     settings.writeEntry("labels", "false");
     settings.endArray();
     settings.endGroup();
- 
+
     //ticks should be in
     settings.beginGroup("/Ticks");
     settings.writeEntry("/MajTicksStyle", ScaleDraw::In);
@@ -5175,12 +5175,12 @@ void ApplicationWindow::readSettings()
 
     //legend to opaque
     settings.beginGroup("/Legend");
-    settings.writeEntry("/Transparency", 255); 
+    settings.writeEntry("/Transparency", 255);
     settings.endGroup(); // Legend
   }
     // Transform from the old setting for plot defaults, will only happen once.
   if ( !settings.contains("/UpdateForPlotImprovements2") )
-  {    
+  {
     settings.writeEntry("/UpdateForPlotImprovements2","true");
     settings.beginGroup("/General");
 
@@ -5190,7 +5190,7 @@ void ApplicationWindow::readSettings()
     settings.writeEntry("/CanvasFrameWidth","1");
     settings.endGroup();
   }
-  
+
   settings.beginGroup("/General");
   titleOn = settings.value("/Title", true).toBool();
   canvasFrameWidth = settings.value("/CanvasFrameWidth", 0).toInt();
@@ -5376,7 +5376,7 @@ void ApplicationWindow::readSettings()
   // Mantid
 
   bool warning_shown = settings.value("/DuplicationDialogShown", false).toBool();
-  
+
   //Check for user defined scripts in settings and create menus for them
   //Top level scripts group
   settings.beginGroup("CustomScripts");
@@ -5396,7 +5396,7 @@ void ApplicationWindow::readSettings()
     // that we do not want used.
     if( menu == "Interfaces" || menu == "&Interfaces" )
       continue;
-  
+
     addUserMenu(menu);
     settings.beginGroup(menu);
     foreach(QString keyName, settings.childKeys())
@@ -6119,7 +6119,7 @@ bool ApplicationWindow::saveProject(bool compress)
     savingTimerId=startTimer(autoSaveTime*60000);
   } else
     savingTimerId=0;
-  
+
   // Back-up file to be removed because file has successfully saved.
   QFile::remove(projectname + "~");
 
@@ -6173,7 +6173,7 @@ void ApplicationWindow::loadDataFile()
   if(fn != "") {
      QFileInfo fnInfo(fn);
      AlgorithmInputHistory::Instance().setPreviousDirectory(fnInfo.absoluteDir().path());
-     if( fnInfo.suffix() == "py") 
+     if( fnInfo.suffix() == "py")
      { // We have a python file, just load it into script window
        loadScript( fn, true );
      }
@@ -6206,7 +6206,7 @@ void ApplicationWindow::saveProjectAs(const QString& fileName, bool compress)
     if(!tempFile.exists())
     {
       // Make the directory
-      QString dir(fn); 
+      QString dir(fn);
       if (fn.contains('.'))
         dir = fn.left(fn.find('.'));
       QDir().mkdir(dir);
@@ -6215,14 +6215,14 @@ void ApplicationWindow::saveProjectAs(const QString& fileName, bool compress)
       QString file("temp");
       for(int i=0; i<dir.size(); ++i)
       {
-        if(dir[i] == '/') 
+        if(dir[i] == '/')
           file = dir.right(dir.size() - i);
         else if(dir[i] == '\\')
           file = dir.right(i);
       }
       fn = dir + file;
     }
-    
+
     QFileInfo fi(fn);
     workingDir = fi.dirPath(true);
     QString baseName = fi.fileName();
@@ -7460,7 +7460,7 @@ void ApplicationWindow::showCurveWorksheet(Graph *g, int curveIndex)
   {
     g->createTable(dynamic_cast<PlotCurve*>(it));
   }
-  else 
+  else
   {
     showTable(it->title().text());
   }
@@ -7905,7 +7905,7 @@ void ApplicationWindow::showFitPolynomDialog()
 }
 
 void ApplicationWindow::updateLog(const QString& result)
-{	
+{
   if ( !result.isEmpty() ){
     current_folder->appendLogInfo(result);
     showResults(true);
@@ -8162,9 +8162,9 @@ void ApplicationWindow::addLabel()
     QMessageBox::warning(this,tr("MantidPlot - Warning"),//Mantid
         tr("<h4>There are no plot layers available in this window.</h4>"
             "<p><h4>Please add a layer and try again!</h4>"));
-    
+
     btnPointer->setChecked(true);
-    return;  
+    return;
   }
 
   Graph *g = dynamic_cast<Graph*>(plot->activeGraph());
@@ -8368,7 +8368,7 @@ void ApplicationWindow::clearSelection()
       if (g->activeTool()->rtti() == PlotToolInterface::Rtti_LabelTool)
         dynamic_cast<LabelTool*>(g->activeTool())->removeTextBox();
     }
-    
+
     else if (g->titleSelected())
       g->removeTitle();
     else if (g->markerSelected())
@@ -8424,7 +8424,7 @@ void ApplicationWindow::copySelection()
 
 void ApplicationWindow::cutSelection()
 {
-  
+
   MdiSubWindow* m = activeWindow();
   if (!m)
     return;
@@ -8483,7 +8483,7 @@ void ApplicationWindow::copyMarker()
 }
 
 void ApplicationWindow::pasteSelection()
-{  
+{
   MdiSubWindow* m = activeWindow();
   if (!m)
     return;
@@ -9234,7 +9234,7 @@ void ApplicationWindow::fileMenuAboutToShow()
   fileMenu->addAction(actionManageDirs);
   fileMenu->insertSeparator();
   fileMenu->addAction(actionLoadImage);
-  fileMenu->addAction(actionScriptRepo); 
+  fileMenu->addAction(actionScriptRepo);
 
   MdiSubWindow *w = activeWindow();
   if (w && w->isA("Matrix"))
@@ -9349,11 +9349,11 @@ void ApplicationWindow::windowsMenuAboutToShow()
   windowsMenu->insertItem(tr("&Hide Window"), this, SLOT(hideActiveWindow()));
 
   // Having the shorcut set here is neccessary on Windows, but
-  // leads to an error message elsewhere. Don't know why and don't 
+  // leads to an error message elsewhere. Don't know why and don't
   // have a better solution than this right now.
 #ifdef _WIN32
-  windowsMenu->insertItem(getQPixmap("close_xpm"), tr("Close &Window"),  
-                   this, SLOT(closeActiveWindow()), Qt::CTRL+Qt::Key_W );  
+  windowsMenu->insertItem(getQPixmap("close_xpm"), tr("Close &Window"),
+                   this, SLOT(closeActiveWindow()), Qt::CTRL+Qt::Key_W );
 #else
   windowsMenu->insertItem(getQPixmap("close_xpm"), tr("Close &Window"),
 			  this, SLOT(closeActiveWindow()) );
@@ -9417,7 +9417,7 @@ void ApplicationWindow::interfaceMenuAboutToShow()
   }
 
   // Show the interfaces in alphabetical order in their respective submenus.
-  qSort(m_interfaceNameDataPairs.begin(), m_interfaceNameDataPairs.end(), 
+  qSort(m_interfaceNameDataPairs.begin(), m_interfaceNameDataPairs.end(),
     interfaceNameComparator);
 
   // Turn the name/data pairs into QActions with which we populate the menus.
@@ -9524,7 +9524,7 @@ void ApplicationWindow::newProject()
 }
 
 void ApplicationWindow::savedProject()
-{	
+{
   QCoreApplication::processEvents();
   if(actionSaveFile) actionSaveFile->setEnabled(false);
   if(actionSaveProject)actionSaveProject->setEnabled(false);
@@ -9654,9 +9654,6 @@ void ApplicationWindow::closeEvent( QCloseEvent* ce )
   saveSettings();
   scriptingEnv()->finalize();
 
-  // Help window
-  HelpWindow::Instance().hostShuttingDown();
-
   ce->accept();
 
 }
@@ -11158,22 +11155,22 @@ Matrix* ApplicationWindow::openMatrix(ApplicationWindow* app, const QStringList
   return w;
 }
 void ApplicationWindow::openMantidMatrix(const QStringList &list)
-{ 	
+{
   QString s=list[0];
   QStringList qlist=s.split("\t");
   QString wsName=qlist[1];
   auto m=newMantidMatrix(wsName,-1,-1);//mantidUI->importMatrixWorkspace(wsName,-1,-1,false,false);
   //if(!m)throw std::runtime_error("Error on opening matrixworkspace ");
-  if(!m) 
+  if(!m)
     return;
   //adding the mantid matrix windows opened to a list.
   //this list is used for find the MantidMatrix window pointer to open a 3D/2DGraph
   m_mantidmatrixWindows << m;
   QStringList::const_iterator line = list.begin();
   for (line++; line!=list.end(); ++line)
-  {	
+  {
     QStringList fields = (*line).split("\t");
-    if (fields[0] == "geometry" || fields[0] == "tgeometry") 
+    if (fields[0] == "geometry" || fields[0] == "tgeometry")
     {
       //restoreWindowGeometry(this, m, *line);
     }
@@ -11185,14 +11182,14 @@ void ApplicationWindow::openInstrumentWindow(const QStringList &list)
   QStringList qlist=s.split("\t");
   QString wsName=qlist[1];
   InstrumentWindow *insWin = mantidUI->getInstrumentView(wsName);
-  if(!insWin) 
+  if(!insWin)
     return;
   //insWin->show();
   QStringList::const_iterator line = list.begin();
   for (line++; line!=list.end(); ++line)
-  {	
+  {
     QStringList fields = (*line).split("\t");
-    if (fields[0] == "geometry" || fields[0] == "tgeometry") 
+    if (fields[0] == "geometry" || fields[0] == "tgeometry")
     {
       //restoreWindowGeometry(this, insWin, *line);
     }
@@ -11202,9 +11199,9 @@ void ApplicationWindow::openInstrumentWindow(const QStringList &list)
 /** This method opens script window with a list of scripts loaded
  */
 void ApplicationWindow::openScriptWindow(const QStringList &list)
-{	
+{
   showScriptWindow();
-  if(!scriptingWindow) 
+  if(!scriptingWindow)
     return;
 
   scriptingWindow->setWindowTitle("MantidPlot: " + scriptingEnv()->languageName() + " Window");
@@ -11224,21 +11221,21 @@ void ApplicationWindow::openScriptWindow(const QStringList &list)
 }
 
 /** This method populates the mantid workspace tree when project file is loaded and
-*   then groups all the workspaces that belonged to a group when the project was saved. 
+*   then groups all the workspaces that belonged to a group when the project was saved.
 *
 *   @params &s :: A QString that contains all the names of workspaces and group workspaces
 *                 that the user is trying to load from a project.
 */
 void ApplicationWindow::populateMantidTreeWdiget(const QString &s)
-{	
+{
   QStringList list = s.split("\t");
   QStringList::const_iterator line = list.begin();
   for (++line; line!=list.end(); ++line)
-  {	
+  {
     if ((*line).contains(',')) // ...it is a group and more work needs to be done
     {
       // Format of string is "GroupName, Workspace, Workspace, Workspace, .... and so on "
-      QStringList groupWorkspaces = (*line).split(','); 
+      QStringList groupWorkspaces = (*line).split(',');
       std::string groupName = groupWorkspaces[0].toStdString();
       std::vector<std::string> inputWsVec;
       // Work through workspaces, load into Mantid and then push into vectorgroup (ignore group name, start at 1)
@@ -11247,10 +11244,10 @@ void ApplicationWindow::populateMantidTreeWdiget(const QString &s)
         std::string wsName = groupWorkspaces[i].toStdString();
         loadWsToMantidTree(wsName);
         inputWsVec.push_back(wsName);
-      }      
+      }
 
       try
-      { 
+      {
         bool smallGroup(inputWsVec.size() < 2);
         if (smallGroup) // if the group contains less than two items...
         {
@@ -11305,7 +11302,7 @@ void ApplicationWindow::populateMantidTreeWdiget(const QString &s)
   }
 }
 
-/** This method populates the mantid workspace tree when  project file is loaded 
+/** This method populates the mantid workspace tree when  project file is loaded
  */
 void ApplicationWindow::loadWsToMantidTree(const std::string & wsName)
 {
@@ -11324,10 +11321,10 @@ void ApplicationWindow::loadWsToMantidTree(const std::string & wsName)
   }
 }
 
-/** This method opens mantid matrix window when  project file is loaded 
+/** This method opens mantid matrix window when  project file is loaded
  */
 MantidMatrix* ApplicationWindow::newMantidMatrix(const QString& wsName,int lower,int upper)
-{	
+{
   MantidMatrix* m=mantidUI->openMatrixWorkspace(this,wsName,lower,upper);
   return m;
 }
@@ -12636,7 +12633,7 @@ void ApplicationWindow::createActions()
 {
   actionCustomActionDialog = new QAction(tr("Manage Custom Menus..."), this);
   connect(actionCustomActionDialog, SIGNAL(activated()), this, SLOT(showCustomActionDialog()));
-  
+
   actionManageDirs = new QAction(QIcon(getQPixmap("managefolders_xpm")), tr("Manage User Directories"), this);
   connect(actionManageDirs, SIGNAL(activated()), this, SLOT(showUserDirectoryDialog()));
 
@@ -12779,7 +12776,7 @@ void ApplicationWindow::createActions()
   actionCloseAllWindows = new QAction(QIcon(getQPixmap("quit_xpm")), tr("&Quit"), this);
   actionCloseAllWindows->setShortcut( tr("Ctrl+Q") );
   connect(actionCloseAllWindows, SIGNAL(activated()), qApp, SLOT(closeAllWindows()));
-  
+
   actionDeleteFitTables = new QAction(QIcon(getQPixmap("close_xpm")), tr("Delete &Fit Tables"), this);
   connect(actionDeleteFitTables, SIGNAL(activated()), this, SLOT(deleteFitTables()));
 
@@ -13380,7 +13377,7 @@ void ApplicationWindow::createActions()
 
   actionEditFunction = new QAction(tr("&Edit Function..."), this);
   connect(actionEditFunction, SIGNAL(activated()), this, SLOT(showFunctionDialog()));
-  
+
   actionFontBold = new QAction("B", this);
   actionFontBold->setToolTip(tr("Bold"));
   QFont font = appFont;
@@ -13517,7 +13514,7 @@ void ApplicationWindow::translateActionsStrings()
   actionLoadFile->setMenuText(tr("&File"));
   actionLoadFile->setShortcut(tr("Ctrl+Shift+F"));
   actionLoadFile->setToolTip(tr("Load Data File"));
- 
+
 
   actionLoadImage->setMenuText(tr("Open Image &File"));
   actionLoadImage->setShortcut(tr("Ctrl+I"));
@@ -13551,16 +13548,16 @@ void ApplicationWindow::translateActionsStrings()
   actionCutSelection->setMenuText(tr("Cu&t Selection"));
   actionCutSelection->setToolTip(tr("Cut selection"));
   actionCutSelection->setShortcut(tr("Ctrl+X"));
-  
+
   actionCopySelection->setMenuText(tr("&Copy Selection"));
   actionCopySelection->setToolTip(tr("Copy Selection"));
   actionCopySelection->setShortcut(tr("Ctrl+C"));
-  
+
 
   actionPasteSelection->setMenuText(tr("&Paste Selection"));
   actionPasteSelection->setToolTip(tr("Paste Selection"));
   actionPasteSelection->setShortcut(tr("Ctrl+V"));
-  
+
 
   actionClearSelection->setMenuText(tr("&Delete Selection"));
   actionClearSelection->setToolTip(tr("Delete selection"));
@@ -14150,7 +14147,7 @@ MultiLayer* ApplicationWindow::plotNoContourColorMap(Matrix *m)
   {
     ml =  mantidUI->plotSpectrogram(Graph::ColorMap);
   }
-  if( !ml ) 
+  if( !ml )
   {
     QApplication::restoreOverrideCursor();
     return 0;
@@ -14175,7 +14172,7 @@ MultiLayer* ApplicationWindow::plotImage(Matrix *m)
     setPreferences(plot);
 
     Spectrogram *s = plot->plotSpectrogram(m, Graph::GrayScale);
-    if( !s ) 
+    if( !s )
     {
       QApplication::restoreOverrideCursor();
       return 0;
@@ -14188,7 +14185,7 @@ MultiLayer* ApplicationWindow::plotImage(Matrix *m)
   else
   {
     g =  mantidUI->plotSpectrogram(Graph::GrayScale);
-    if( !g ) 
+    if( !g )
     {
       QApplication::restoreOverrideCursor();
       return 0;
@@ -14224,7 +14221,7 @@ MultiLayer* ApplicationWindow::plotSpectrogram(Matrix *m, Graph::CurveType type)
 
   plot->plotSpectrogram(m, type);
 
-  setSpectrogramTickStyle(plot);  
+  setSpectrogramTickStyle(plot);
 
   plot->setAutoScale();//Mantid
 
@@ -14616,8 +14613,7 @@ void ApplicationWindow::showMantidConcepts()
 }
 void ApplicationWindow::showalgorithmDescriptions()
 {
-  //std::string url("qthelp://org.mantidproject/doc/html/algorithms_index.html");
-  HelpWindow::Instance().showAlgorithm();
+  HelpWindow::showAlgorithm();
 }
 
 void ApplicationWindow::showSetupParaview()
@@ -14640,7 +14636,7 @@ void ApplicationWindow::showFirstTimeSetup()
  Show mantidplot help page
  */
 void ApplicationWindow::showmantidplotHelp()
-{  
+{
   // HelpWindow::Instance().showURL(); pull from the relese 2.5-> to return in relese 2.6
   QDesktopServices::openUrl(QUrl("http://www.mantidproject.org/MantidPlot"));
 }
@@ -16196,7 +16192,7 @@ void ApplicationWindow::showScriptWindow(bool forceVisible, bool quitting)
 {
   if( !scriptingWindow )
   {
-    // MG 09/02/2010 : Removed parent from scripting window. If it has one then it doesn't respect the always on top 
+    // MG 09/02/2010 : Removed parent from scripting window. If it has one then it doesn't respect the always on top
     // flag, it is treated as a sub window of its parent
     const bool capturePrint = !quitting;
     scriptingWindow = new ScriptingWindow(scriptingEnv(),capturePrint, NULL);
@@ -16222,7 +16218,7 @@ void ApplicationWindow::showScriptWindow(bool forceVisible, bool quitting)
     }
     scriptingWindow->setFocus();
   }
-  else 
+  else
   {
     saveScriptWindowGeometry();
     // Hide is connect to this function so block it temporarily
@@ -16245,7 +16241,7 @@ void ApplicationWindow::showScriptInterpreter()
     m_interpreterDock->hide();
   }
   else
-  { 
+  {
     m_interpreterDock->show();
     m_interpreterDock->setFocusPolicy(Qt::StrongFocus);
     m_interpreterDock->setFocusProxy(m_interpreterDock->widget());
@@ -17098,7 +17094,7 @@ if( QFileInfo(action_data).exists() )
     QMessageBox::information(this, "MantidPlot", "Error: There was a problem reading\n" + action_data);
     return;
   }
-  
+
   QTextStream stream(&script_file);
   QString scriptPath = QString("r'%1'").arg(QFileInfo(action_data).absolutePath());
   QString code = QString("sys.path.append(%1)\n").arg(scriptPath);
@@ -17133,7 +17129,7 @@ else
   if(user_interface)
   {
     setGeometry(usr_win,user_interface);
-    connect(user_interface, SIGNAL(runAsPythonScript(const QString&, bool)), 
+    connect(user_interface, SIGNAL(runAsPythonScript(const QString&, bool)),
                       this, SLOT(runPythonScript(const QString&, bool)), Qt::DirectConnection);
     // Update the used fit property browser
     connect(user_interface, SIGNAL(setFitPropertyBrowser(MantidQt::MantidWidgets::FitPropertyBrowser*)),
@@ -17212,7 +17208,7 @@ void ApplicationWindow::addUserMenuAction(const QString & parentMenu, const QStr
   foreach(topMenu, d_user_menus)
   {
     if( topMenu->title() == parentMenu ) break;
-  } 
+  }
 
   if( !topMenu ) return;
   foreach(QAction* userAction, topMenu->actions())
@@ -17221,7 +17217,7 @@ void ApplicationWindow::addUserMenuAction(const QString & parentMenu, const QStr
   }
 
   QAction* scriptAction = new QAction(tr(niceName), topMenu);
-  scriptAction->setData(itemData); 
+  scriptAction->setData(itemData);
   topMenu->addAction(scriptAction);
   d_user_actions.append(scriptAction);
 
@@ -17238,7 +17234,7 @@ void ApplicationWindow::removeUserMenu(const QString & parentMenu)
     if( menu->title() == parentMenu ) break;
     ++i;
   }
-  if( !menu ) return; 
+  if( !menu ) return;
 
   d_user_menus.removeAt(i);
   myMenuBar()->removeAction(menu->menuAction());
@@ -17272,7 +17268,7 @@ void ApplicationWindow::removeUserMenuAction(const QString & parentMenu, const Q
 const QList<QMenu*> & ApplicationWindow::getCustomMenus() const
 {
   return d_user_menus;
-} 
+}
 
 QList<QMenu *> ApplicationWindow::menusList()
 {
@@ -17342,7 +17338,7 @@ void ApplicationWindow::tileMdiWindows()
   // hack to redraw the graphs
   shakeViewport();
   // QMdiArea::tileSubWindows() aranges the windows and enables automatic tiling
-  // after subsequent resizing of the mdi area until a window is moved or resized 
+  // after subsequent resizing of the mdi area until a window is moved or resized
   // separatly. Unfortunately Graph behaves badly during this.
   // The following code disables automatic tiling.
   auto winList = d_workspace->subWindowList();
@@ -17436,7 +17432,7 @@ void ApplicationWindow::customMultilayerToolButtons(MultiLayer* w)
  *   @param fileName :: name of the ouput file.
  */
 void ApplicationWindow::savedatainNexusFormat(const std::string& wsName,const std::string& fileName)
-{		
+{
   //std::string s=workingDir.toStdString()+wsName+".nxs";
   // std::string fileName(s);
   if(fileName.empty()) return ;
@@ -17515,7 +17511,7 @@ void ApplicationWindow::CatalogLogout()
 }
 
 void ApplicationWindow::setGeometry(MdiSubWindow* usr_win,QWidget* user_interface)
-{   
+{
   QRect frame = QRect(usr_win->frameGeometry().topLeft() - usr_win->geometry().topLeft(),
       usr_win->geometry().bottomRight() - usr_win->geometry().bottomRight());
   usr_win->setWidget(user_interface);
@@ -17670,7 +17666,7 @@ QPoint ApplicationWindow::desktopTopLeft() const
   */
 QPoint ApplicationWindow::positionNewFloatingWindow(QSize sz) const
 {
-  const int yDelta = 40; 
+  const int yDelta = 40;
   const QPoint noPoint(-1,-1);
 
   static QPoint lastPoint(noPoint);
@@ -17690,7 +17686,7 @@ QPoint ApplicationWindow::positionNewFloatingWindow(QSize sz) const
       QPoint diff = lastWindow->pos() - lastPoint;
 
       if ( abs(diff.x()) < 20 && abs(diff.y()) < 20 )
-      { // If window was moved far enough from it's previous location - can use it 
+      { // If window was moved far enough from it's previous location - can use it
 
         // Get a screen space which we can use
         const QRect screen = QApplication::desktop()->availableGeometry(this);
@@ -17759,7 +17755,7 @@ void ApplicationWindow::changeToDocked(MdiSubWindow* w)
   if (!fw) return;
   fw->removeMdiSubWindow();
   removeFloatingWindow(fw);
-  // main window must be closed or application will freeze 
+  // main window must be closed or application will freeze
   fw->close();
   addMdiSubWindowAsDocked(w);
   //activateWindow(w);
@@ -17813,7 +17809,7 @@ bool ApplicationWindow::event(QEvent * e)
 
       QPoint cur_pos = this->mapFromGlobal(QCursor::pos());
       const QWidget* clickedWidget = NULL;
-      
+
       if (rect().contains(cur_pos))
       {
         clickedWidget = childAt(cur_pos);
@@ -17865,7 +17861,7 @@ void ApplicationWindow::activateNewWindow()
   MdiSubWindow* current = getActiveWindow();
   MdiSubWindow* newone = NULL;
   Folder* folder = currentFolder();
-  
+
   // try the docked windows first
   QList<QMdiSubWindow*> wl = d_workspace->subWindowList();
   foreach(QMdiSubWindow* w,wl)
@@ -17873,9 +17869,9 @@ void ApplicationWindow::activateNewWindow()
     if (w->widget() != static_cast<QWidget*>(current))
     {
       MdiSubWindow* sw = dynamic_cast<MdiSubWindow*>(w->widget());
-        if (sw && 
-            sw->status() != MdiSubWindow::Minimized && 
-            sw->status() != MdiSubWindow::Hidden && 
+        if (sw &&
+            sw->status() != MdiSubWindow::Minimized &&
+            sw->status() != MdiSubWindow::Hidden &&
             folder->hasWindow(sw))
       {
         newone = sw;
@@ -17892,9 +17888,9 @@ void ApplicationWindow::activateNewWindow()
       MdiSubWindow* sw = w->mdiSubWindow();
       if (sw != current)
       {
-        if (sw && 
-            sw->status() != MdiSubWindow::Minimized && 
-            sw->status() != MdiSubWindow::Hidden && 
+        if (sw &&
+            sw->status() != MdiSubWindow::Minimized &&
+            sw->status() != MdiSubWindow::Hidden &&
             folder->hasWindow(sw))
         {
           newone = sw;
@@ -17977,7 +17973,7 @@ void ApplicationWindow::validateWindowPos(MdiSubWindow* w, int& x, int& y)
     y = pos.y();
     return;
   }
-  else if ( x < 0 || y < 0 || 
+  else if ( x < 0 || y < 0 ||
     x + sz.width() > d_workspace->width() ||
     y + sz.height() > d_workspace->height() )
   {
@@ -17986,22 +17982,22 @@ void ApplicationWindow::validateWindowPos(MdiSubWindow* w, int& x, int& y)
 }
 
 /**
- * Here it is possible to add all the methods that should be triggered 
- * on MantidPlot initialization but which requires the eventloop to be 
- * processing. 
- * 
- * Currently: 
+ * Here it is possible to add all the methods that should be triggered
+ * on MantidPlot initialization but which requires the eventloop to be
+ * processing.
+ *
+ * Currently:
  *  - Update of Script Repository
  */
 void ApplicationWindow::about2Start(){
   // triggers the execution of UpdateScriptRepository Algorithm in a separated thread.
   // this was necessary because in order to log while in a separate thread, it is necessary to have
   // the postEvents available, so, we need to execute it here at about2Start.
-  std::string local_rep = Mantid::Kernel::ConfigService::Instance().getString("ScriptLocalRepository"); 
+  std::string local_rep = Mantid::Kernel::ConfigService::Instance().getString("ScriptLocalRepository");
   if (!local_rep.empty()){
     // there is no reason to trigger UpdataScriptRepository if it has never been installed
     Mantid::API::IAlgorithm_sptr update_script_repo = mantidUI->createAlgorithm("UpdateScriptRepository");
-    update_script_repo->initialize(); 
+    update_script_repo->initialize();
     update_script_repo->setLoggingOffset(1);
     mantidUI->executeAlgorithmAsync(update_script_repo);
   }
diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/HelpWindow.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/HelpWindow.h
index c2fbf6800a0f050945bf3b501f468e4ec594a856..6829bbcb6a0e247ef2126314a3bbd66bc35b3f02 100644
--- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/HelpWindow.h
+++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/HelpWindow.h
@@ -1,63 +1,50 @@
 #ifndef HELPWINDOW_H
 #define HELPWINDOW_H
-#include <boost/shared_ptr.hpp>
-#include <QProcess>
+
+#include "MantidQtAPI/DllOption.h"
 #include <QString>
 #include <string>
-#include "MantidKernel/SingletonHolder.h"
 
 namespace MantidQt
 {
 namespace API
 {
 
-class DLLExport HelpWindowImpl
-{
-public:
-    void showURL(const std::string & url=std::string());
-    void showWikiPage(const std::string &page=std::string());
-    void showAlgorithm(const std::string &name=std::string(), const int version=-1);
-    void showAlgorithm(const QString &name, const int version=-1);
-    void showFitFunction(const std::string &name=std::string());
-    void hostShuttingDown();
-
-private:
-    friend struct Mantid::Kernel::CreateUsingNew<HelpWindowImpl>;
-
-    /// Default constructor
-    HelpWindowImpl();
-    /// Destructor
-    virtual ~HelpWindowImpl();
-
-    void openWebpage(const std::string &url);
-
-    /// Shared pointer to the process running qt assistant.
-    boost::shared_ptr<QProcess> m_process;
-    /// The full path of the collection file.
-    std::string m_collectionFile;
-    /** The full path of the cache file. If it is not
-        determined this is an empty string. */
-    std::string m_cacheFile;
-    /// QT assistant executable.
-    std::string m_assistantExe;
-    /// Whether this is the very first startup of the helpwindow.
-    bool m_firstRun;
-
-    void start(const std::string &url);
-    bool isRunning();
-    void findCollectionFile(std::string & binDir);
-    void findQtAssistantExe(std::string & binDir);
-    void determineFileLocs();
-};
-
-/** Forward declaration of a specialisation of SingletonHolder for HelpWindowImpl
-    (needed for dllexport/dllimport) and a typedef for it. */
-#ifdef _WIN32
-// this breaks new namespace declaraion rules; need to find a better fix
-template class DLLExport Mantid::Kernel::SingletonHolder<HelpWindowImpl>; // MANTID_API_DLL was after class
-#endif /* _WIN32 */
-typedef DLLExport Mantid::Kernel::SingletonHolder<HelpWindowImpl> HelpWindow; // MANTID_API_DLL was after template
-
-} // namespace API
+  /**
+    Copyright &copy; 2013-14 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
+
+    This file is part of Mantid.
+
+    Mantid 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.
+
+    Mantid 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.  If not, see <http://www.gnu.org/licenses/>.
+
+    File change history is stored at: <https://github.com/mantidproject/mantid>.
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+   */
+   class EXPORT_OPT_MANTIDQT_API HelpWindow
+   {
+   public:
+     static void showURL(const std::string & url=std::string());
+     static void showWikiPage(const std::string &page=std::string());
+     static void showAlgorithm(const std::string &name=std::string(), const int version=-1);
+     static void showAlgorithm(const QString &name, const int version=-1);
+     static void showFitFunction(const std::string &name=std::string());
+
+   private:
+     static void openWebpage(const std::string &url);
+     static std::string htmlRoot();
+   };
+
+  } // namespace API
 } // namespace MantidQt
 #endif // HELPWINDOW_H
diff --git a/Code/Mantid/MantidQt/API/src/AlgorithmDialog.cpp b/Code/Mantid/MantidQt/API/src/AlgorithmDialog.cpp
index 20e80fd48bcdf189e8daa00df322c7b56e2c3757..4f45d2d64a0b351a6987826eedb4521955b9adbf 100644
--- a/Code/Mantid/MantidQt/API/src/AlgorithmDialog.cpp
+++ b/Code/Mantid/MantidQt/API/src/AlgorithmDialog.cpp
@@ -40,10 +40,10 @@ using Mantid::Kernel::DateAndTime;
 /**
  * Default Constructor
  */
-AlgorithmDialog::AlgorithmDialog(QWidget* parent) :  
-  QDialog(parent), m_algorithm(NULL), m_algName(""), m_algProperties(), 
-  m_propertyValueMap(), m_tied_properties(), m_forScript(false), m_python_arguments(), 
-  m_enabled(), m_disabled(), m_strMessage(""), m_msgAvailable(false), m_isInitialized(false), m_autoParseOnInit(true), 
+AlgorithmDialog::AlgorithmDialog(QWidget* parent) :
+  QDialog(parent), m_algorithm(NULL), m_algName(""), m_algProperties(),
+  m_propertyValueMap(), m_tied_properties(), m_forScript(false), m_python_arguments(),
+  m_enabled(), m_disabled(), m_strMessage(""), m_msgAvailable(false), m_isInitialized(false), m_autoParseOnInit(true),
   m_validators(), m_noValidation(), m_inputws_opts(), m_outputws_fields(), m_wsbtn_tracker()
 {
 }
@@ -66,7 +66,7 @@ void AlgorithmDialog::initializeLayout()
   setWindowTitle(QString::fromStdString(getAlgorithm()->name()) + " input dialog");
   //Set the icon
   setWindowIcon(QIcon(":/MantidPlot_Icon_32offset.png"));
-  
+
   // These containers are for ensuring the 'replace input workspace; button works correctly
   // Store all combo boxes that relate to an input workspace
   m_inputws_opts.clear();
@@ -82,7 +82,7 @@ void AlgorithmDialog::initializeLayout()
 
   if(m_autoParseOnInit)
   {
-    // Check if there is any default input 
+    // Check if there is any default input
     this->parse();
     // Unless told not to, try to set these values. This will validate the defaults and mark those that are invalid, if any.
     this->setPropertyValues();
@@ -96,8 +96,8 @@ void AlgorithmDialog::initializeLayout()
  *  @returns Whether initialzedLayout has been called yet
  */
 bool AlgorithmDialog::isInitialized() const
-{ 
-  return m_isInitialized; 
+{
+  return m_isInitialized;
 }
 
 
@@ -105,7 +105,7 @@ bool AlgorithmDialog::isInitialized() const
 // Protected member functions
 //------------------------------------------------------
 /**
- * Parse input from widgets on the dialog. This function does nothing in the 
+ * Parse input from widgets on the dialog. This function does nothing in the
  * base class
  */
 void AlgorithmDialog::parseInput()
@@ -152,10 +152,10 @@ void AlgorithmDialog::setAlgorithm(Mantid::API::IAlgorithm* alg)
     Mantid::Kernel::Property *p = *itr;
     if( dynamic_cast<Mantid::API::IWorkspaceProperty*>(p) || p->direction() != Mantid::Kernel::Direction::Output )
     {
-      m_algProperties.append(QString::fromStdString(p->name())); 
+      m_algProperties.append(QString::fromStdString(p->name()));
     }
   }
-  
+
   m_validators.clear();
   m_noValidation.clear();
 }
@@ -175,7 +175,7 @@ Mantid::API::IAlgorithm* AlgorithmDialog::getAlgorithm() const
  */
 Mantid::Kernel::Property* AlgorithmDialog::getAlgorithmProperty(const QString & propName) const
 {
-  if( m_algProperties.contains(propName) ) 
+  if( m_algProperties.contains(propName) )
   {
     return m_algorithm->getProperty(propName.toStdString());
   }
@@ -193,14 +193,14 @@ bool AlgorithmDialog::requiresUserInput(const QString & propName) const
 
 
 //-------------------------------------------------------------------------------------------------
-/** 
+/**
  * Get an input value from the form, dealing with blank inputs etc
  * @param propName :: The name of the property
  */
 QString AlgorithmDialog::getInputValue(const QString& propName) const
 {
   QString value = m_propertyValueMap.value(propName);
-  if( value.isEmpty() ) 
+  if( value.isEmpty() )
   {
     Mantid::Kernel::Property* prop = getAlgorithmProperty(propName);
     if( prop ) return QString::fromStdString(prop->getDefault());
@@ -441,7 +441,7 @@ bool AlgorithmDialog::isWidgetEnabled(const QString & propName) const
 {
   // To avoid errors
   if( propName.isEmpty() ) return true;
-  
+
   // Otherwise it must be disabled but only if it is valid
   Mantid::Kernel::Property *property = getAlgorithmProperty(propName);
   if (!property) return true;
@@ -484,7 +484,7 @@ bool AlgorithmDialog::isWidgetEnabled(const QString & propName) const
  * UnTie a property
  * @param property :: The name of the property to tie the given widget to
  */
-void AlgorithmDialog::untie(const QString & property) 
+void AlgorithmDialog::untie(const QString & property)
 {
   if( m_tied_properties.contains(property) )
   {
@@ -504,14 +504,14 @@ void AlgorithmDialog::untie(const QString & property)
  * @return A NULL pointer if a valid label was successfully add to a passed parent_layout otherwise it
  *          returns a pointer to the QLabel instance marking the validity
  */
-QWidget* AlgorithmDialog::tie(QWidget* widget, const QString & property, QLayout *parent_layout, 
+QWidget* AlgorithmDialog::tie(QWidget* widget, const QString & property, QLayout *parent_layout,
                   bool readHistory)
 {
   if( m_tied_properties.contains(property) )
     m_tied_properties.remove(property);
 
   Mantid::Kernel::Property * prop = getAlgorithmProperty(property);
-  if( prop ) 
+  if( prop )
   { //Set a few things on the widget
     widget->setToolTip(QString::fromStdString(prop->briefDocumentation()));
   }
@@ -583,7 +583,7 @@ QString AlgorithmDialog::openFileDialog(const QString & propName)
 
 //-------------------------------------------------------------------------------------------------
 /**
- * Takes a combobox and adds the allowed values of the given property to its list. 
+ * Takes a combobox and adds the allowed values of the given property to its list.
  * It also sets the displayed value to the correct one based on either the history
  * or a script input value
  * @param propName :: The name of the property
@@ -595,10 +595,10 @@ void AlgorithmDialog::fillAndSetComboBox(const QString & propName, QComboBox* op
   if( !optionsBox ) return;
   Mantid::Kernel::Property *property = getAlgorithmProperty(propName);
   if( !property ) return;
-  
+
   std::set<std::string> items = property->allowedValues();
   std::set<std::string>::const_iterator vend = items.end();
-  for(std::set<std::string>::const_iterator vitr = items.begin(); vitr != vend; 
+  for(std::set<std::string>::const_iterator vitr = items.begin(); vitr != vend;
       ++vitr)
   {
     optionsBox->addItem(QString::fromStdString(*vitr));
@@ -638,8 +638,8 @@ void AlgorithmDialog::fillLineEdit(const QString & propName, QLineEdit* textFiel
   else
   {
     Mantid::Kernel::Property *property = getAlgorithmProperty(propName);
-    if( property && property->isValid().empty() && 
-    ( m_python_arguments.contains(propName) || !property->isDefault() ) ) 
+    if( property && property->isValid().empty() &&
+    ( m_python_arguments.contains(propName) || !property->isDefault() ) )
     {
       textField->setText(QString::fromStdString(property->value()));
     }
@@ -667,7 +667,7 @@ AlgorithmDialog::createDefaultButtonLayout(const QString & helpText,
   buttonRowLayout->addStretch();
   buttonRowLayout->addWidget(okButton);
   buttonRowLayout->addWidget(exitButton);
-    
+
   return buttonRowLayout;
 }
 
@@ -687,7 +687,7 @@ QPushButton* AlgorithmDialog::createHelpButton(const QString & helpText) const
 
 
 
-/** 
+/**
  * Flag an input workspace widget
  * @param inputWidget :: A widget used to enter the input workspace
  */
@@ -707,8 +707,8 @@ void AlgorithmDialog::accept()
 {
   // Get property values
   parse();
-  
-  //Try and set and validate the properties and 
+
+  //Try and set and validate the properties and
   if( setPropertyValues() )
   {
     //Store input for next time
@@ -717,10 +717,10 @@ void AlgorithmDialog::accept()
   }
   else
   {
-    QMessageBox::critical(this, "", 
+    QMessageBox::critical(this, "",
               "One or more properties are invalid. The invalid properties are\n"
         "marked with a *, hold your mouse over the * for more information." );
-  } 
+  }
 }
 
 
@@ -736,7 +736,7 @@ void AlgorithmDialog::helpClicked()
     version = m_algorithm->version();
 
   // bring up the help window
-  HelpWindow::Instance().showAlgorithm(m_algName, version);
+  HelpWindow::showAlgorithm(m_algName, version);
 }
 
 //------------------------------------------------------
@@ -781,7 +781,7 @@ void AlgorithmDialog::setPresetValues(const QHash<QString,QString> & presetValue
 }
 
 //------------------------------------------------------------------------------------------------
-/** 
+/**
  * Set list of enabled and disabled parameter names
  * @param enabled:: A list of parameter names to keep enabled
  * @param disabled:: A list of parameter names whose widgets should be disabled
@@ -800,7 +800,7 @@ void AlgorithmDialog::addEnabledAndDisableLists(const QStringList & enabled, con
 bool AlgorithmDialog::requestedToKeepEnabled(const QString& propName) const
 {
   bool enabled(true);
-  if( m_disabled.contains(propName) ) 
+  if( m_disabled.contains(propName) )
   {
     enabled = false;
   }
@@ -874,8 +874,8 @@ QString AlgorithmDialog::getValue(QWidget *widget)
   }
   else
   {
-    QMessageBox::warning(this, windowTitle(), 
-             QString("Cannot parse input from ") + widget->metaObject()->className() + 
+    QMessageBox::warning(this, windowTitle(),
+             QString("Cannot parse input from ") + widget->metaObject()->className() +
              ". Update AlgorithmDialog::getValue() to cope with this widget.");
     return "";
   }
@@ -953,7 +953,7 @@ void AlgorithmDialog::setPreviousValue(QWidget* widget, const QString& propName)
 
   QLineEdit *textfield = qobject_cast<QLineEdit*>(widget);
   MantidWidget *mtdwidget = qobject_cast<MantidWidget*>(widget);
-  if( textfield || mtdwidget )	    
+  if( textfield || mtdwidget )
   {
     if( !isForScript() )
     {
@@ -971,17 +971,17 @@ void AlgorithmDialog::setPreviousValue(QWidget* widget, const QString& propName)
     }
     return;
   }
-  
+
   PropertyWidget * propWidget = qobject_cast<PropertyWidget*>(widget);
   if (propWidget)
   {
     propWidget->setPreviousValue(value);
-    
+
     return;
   }
 
   // Reaching here means we have a widget type we don't understand. Tell the developer
-  QMessageBox::warning(this, windowTitle(), 
-               QString("Cannot set value for ") + widget->metaObject()->className() + 
+  QMessageBox::warning(this, windowTitle(),
+               QString("Cannot set value for ") + widget->metaObject()->className() +
                ". Update AlgorithmDialog::setValue() to cope with this widget.");
 }
diff --git a/Code/Mantid/MantidQt/API/src/HelpWindow.cpp b/Code/Mantid/MantidQt/API/src/HelpWindow.cpp
index 0fc834934a24ef6f23b16bfa6d9ec8dcff3cead2..8a01a31d561927f0f934476d907e9bde445fe765 100644
--- a/Code/Mantid/MantidQt/API/src/HelpWindow.cpp
+++ b/Code/Mantid/MantidQt/API/src/HelpWindow.cpp
@@ -1,15 +1,11 @@
 #include "MantidQtAPI/HelpWindow.h"
 #include "MantidKernel/ConfigService.h"
+#include "MantidKernel/Exception.h"
 #include "MantidKernel/Logger.h"
-#include <boost/make_shared.hpp>
-#include <iostream>
-#include <Poco/File.h>
-#include <Poco/Path.h>
-#include <Poco/Thread.h>
-#include <QByteArray>
+
+#include <boost/lexical_cast.hpp>
 #include <QDesktopServices>
 #include <QUrl>
-#include <stdexcept>
 
 namespace MantidQt
 {
@@ -21,13 +17,19 @@ namespace API
     Mantid::Kernel::Logger g_log("HelpWindow");
   }
 
-
 using std::string;
 
-/// Base url for all of the files in the project.
-const string BASE_URL("qthelp://org.mantidproject/doc/");
-/// Url to display if nothing else is suggested.
-const string DEFAULT_URL(BASE_URL + "html/index.html");
+/**
+ * All paths used here are unix-style paths as they will be viewed
+ * with a browser
+ */
+
+/// Relative path to html docs directory from application directory
+const string DEFAULT_PACKAGE_HTML_RELPATH( "../share/doc/html");
+/// relative path from html root to algorithms directory
+const string ALGORITHMS_DIR("algorithms");
+/// relative path from html root to functions directory
+const string FUNCTIONS_DIR("functions");
 
 /// Base url for all of the wiki links
 const string WIKI_BASE_URL("http://mantidproject.org/");
@@ -35,127 +37,61 @@ const string WIKI_BASE_URL("http://mantidproject.org/");
 const string WIKI_DEFAULT_URL(WIKI_BASE_URL + "MantidPlot");
 
 /**
- * Default constructor shows the @link MantidQt::API::DEFAULT_URL @endlink.
- */
-HelpWindowImpl::HelpWindowImpl() :
-    m_collectionFile(""),
-    m_cacheFile(""),
-    m_assistantExe(""),
-    m_firstRun(true)
-{
-    this->determineFileLocs();
-}
-
-/// Destructor does nothing.
-HelpWindowImpl::~HelpWindowImpl()
-{
-    // do nothing
-}
-
-namespace { // ANONYMOUS NAMESPACE
-const string stateToStr(const int code)
-{
-    if (code == 0)
-        return "NotRunning";
-    else if (code == 1)
-        return "Starting";
-    else if (code == 2)
-        return "Running";
-    else
-        return "Unknown state";
-}
-} // ANONYMOUS NAMESPACE
-
-void HelpWindowImpl::openWebpage(const string &url)
-{
-    g_log.debug() << "open url \"" << url << "\"\n";
-    QDesktopServices::openUrl(QUrl(QLatin1String(url.c_str())));
-}
-
-/**
- * Have the help window show a specific url. If the url doesn't exist
+ * Show a specific url. If the url doesn't exist
  * this just pops up the default view for the help.
  *
- * @param url The url to open. This should start with @link MantidQt::API::BASE_URL @endlink.
+ * @param url The url to open.
  * If it is empty show the default page.
  */
-void HelpWindowImpl::showURL(const string &url)
+void HelpWindow::showURL(const string &url)
 {
-    if (m_collectionFile.empty()) // qt-assistant disabled
-    {
-        if (url.empty())
-            this->openWebpage(WIKI_DEFAULT_URL);
-        else
-            this->openWebpage(url);
-    }
-    else
-    {
-        std::string urlToShow(url);
-        if (urlToShow.empty())
-            urlToShow = DEFAULT_URL;
-
-        // make sure the process is going
-        this->start(url);
-        g_log.debug() << m_assistantExe << " "
-                      << " (state = \"" << stateToStr(m_process->state()) << "\")\n";
-
-        g_log.debug() << "open help url \"" << urlToShow << "\"\n";
-        string temp("setSource " + urlToShow + "\n");
-        QByteArray ba;
-        ba.append(QLatin1String(temp.c_str()));
-        m_process->write(ba);
-    }
+  if (url.empty())
+    openWebpage(WIKI_DEFAULT_URL);
+  else
+    openWebpage(url);
 }
 
-void HelpWindowImpl::showWikiPage(const string &page)
+void HelpWindow::showWikiPage(const string &page)
 {
-    if (page.empty())
-        this->openWebpage(WIKI_DEFAULT_URL);
-    else
-        this->openWebpage(WIKI_BASE_URL + page);
+  if (page.empty())
+    openWebpage(WIKI_DEFAULT_URL);
+  else
+    openWebpage(WIKI_BASE_URL + page);
 }
 
 /**
  * Show the help page for a particular algorithm. The page is picked
- * using matching naming conventions.
+ * using matching naming conventions. If version > 0, then the filename
+ * is formed as name-vX.html, otherwise it is formed as name.html.
  *
  * @param name The name of the algorithm to show. If this is empty show
  * the algorithm index.
  * @param version The version of the algorithm to jump do. The default
  * value (-1) will show the top of the page.
  */
-void HelpWindowImpl::showAlgorithm(const string &name, const int version)
+void HelpWindow::showAlgorithm(const string &name, const int version)
 {
-    // TODO jump to the version within the page
-    (void)version;
-
-    if (m_collectionFile.empty()) // qt-assistant disabled
-    {
-        if (name.empty())
-            this->showWikiPage("Category:Algorithms");
-        else
-            this->showWikiPage(name);
-    }
-    else
-    {
-        string url(BASE_URL + "html/Algo_" + name + ".html");
-        if (name.empty())
-            url = BASE_URL + "html/algorithms_index.html";
-        this->showURL(url);
-    }
+  if (name.empty())
+    openWebpage(htmlRoot() + "/categories/algorithms/Algorithms.html");
+  else
+  {
+    string url =  htmlRoot() + "/" + ALGORITHMS_DIR + "/" + name;
+    if (version > 0) url += "-v" + boost::lexical_cast<std::string>(version);
+    openWebpage(url + ".html");
+  }
 }
 
 /**
- * Convenience method for HelpWindowImpl::showAlgorithm(const string &, const int).
+ * Convenience method for HelpWindow::showAlgorithm(const string &, const int).
  *
  * @param name The name of the algorithm to show. If this is empty show
  * the algorithm index.
  * @param version The version of the algorithm to jump do. The default
  * value (-1) will show the top of the page.
  */
-void HelpWindowImpl::showAlgorithm(const QString &name, const int version)
+void HelpWindow::showAlgorithm(const QString &name, const int version)
 {
-    this->showAlgorithm(name.toStdString(), version);
+  showAlgorithm(name.toStdString(), version);
 }
 
 /**
@@ -165,282 +101,49 @@ void HelpWindowImpl::showAlgorithm(const QString &name, const int version)
  * @param name The name of the fit function to show. If it is empty show
  * the fit function index.
  */
-void HelpWindowImpl::showFitFunction(const std::string &name)
-{
-    if (m_collectionFile.empty()) // qt-assistant disabled
-    {
-        if (name.empty())
-            this->showWikiPage("Category:Fit_functions");
-        else
-            this->showWikiPage(name);
-    }
-    else
-    {
-        string url(BASE_URL + "html/FitFunc_" + name + ".html");
-        if (name.empty())
-        {
-            url = BASE_URL + "html/fitfunctions_index.html";
-        }
-        this->showURL(url);
-    }
-}
-
-/**
- * Can be called by the host process to indicate that it will
- * close soon. This closes the help window & releases the QProcess
- */
-void HelpWindowImpl::hostShuttingDown()
+void HelpWindow::showFitFunction(const std::string &name)
 {
-  if(m_process)
+  if (name.empty())
+    openWebpage(htmlRoot() + "/categories/functions/Functions.html");
+  else
   {
-    if(isRunning())
-    {
-      m_process->close();
-      m_process->waitForFinished(100); // 100ms
-    }
-    // Delete
-    m_process.reset();
+    std::string url = htmlRoot() + "/" + FUNCTIONS_DIR + "/" + name;
+    openWebpage(url + ".html");
   }
 }
 
+//------------------------------------------------------------------------------
+// Private methods
+//------------------------------------------------------------------------------
 
 /**
- * Start up the help browser in a separate process.
- *
- * This will only do something if the browser is not already
- * running. Due to a bug in qt 4.8.1 this will delete the
- * cache file every time the browser is started.
- *
- * @param url The url to show at startup. This is ignored if it is
- * already started.
- */
-void HelpWindowImpl::start(const std::string &url)
-{
-    // check if it is already started
-    if (this->isRunning())
-    {
-        g_log.debug() << "helpwindow process already running\n";
-        return;
-    }
-
-    // see if chache file exists and remove it - shouldn't be necessary, but it is
-    if ((!m_cacheFile.empty()) && (Poco::File(m_cacheFile).exists()))
-    {
-        g_log.debug() << "Removing help cache file \"" << m_cacheFile << "\"\n";
-        Poco::File(m_cacheFile).remove();
-    }
-
-    // don't start the process if qt-assistant disabled
-    if (m_collectionFile.empty())
-    {
-        return;
-    }
-
-    // determine the argument list
-    QStringList args;
-    args << QLatin1String("-collectionFile")
-         << QLatin1String(m_collectionFile.c_str())
-         << QLatin1String("-enableRemoteControl");
-    if (!url.empty())
-        args << QLatin1String("-showUrl")
-             << QLatin1String(url.c_str());
-
-
-    // start the process
-    m_process = boost::make_shared<QProcess>();
-    g_log.debug() << m_assistantExe
-                  << " " << args.join(QString(" ")).toStdString()
-                  << " (state = \"" << stateToStr(m_process->state()) << "\")\n";
-    m_process->start(QLatin1String(m_assistantExe.c_str()), args);
-
-    // wait for it to start before returning
-    if (!m_process->waitForStarted())
-    {
-        g_log.warning() << "Failed to start qt assistant process\n";
-        return;
-    }
-    if (m_firstRun)
-    {
-        m_firstRun = false;
-        g_log.debug() << "Very first run of qt assistant comes up slowly (2.5 sec pause)\n";
-        Poco::Thread::sleep(2500); // 2.5 seconds
-    }
-}
-
-/**
- * @return True if the browser is running.
- */
-bool HelpWindowImpl::isRunning()
-{
-    // NULL pointer definitely isn't running
-    if (!m_process)
-        return false;
-
-    // ask the process for its state
-    if (m_process->state() == QProcess::NotRunning)
-        return false;
-    else
-        return true;
-}
-
-/**
- * Determine the location of the collection file, "mantid.qhc". This
- * checks in multiple locations and can throw an exception.
- *
- * @param binDir The location of the mantid executable.
+ * Opens a webpage using the QDesktopServices
+ * @param url A string containing a url to view
  */
-void HelpWindowImpl::findCollectionFile(std::string &binDir)
+void HelpWindow::openWebpage(const string &url)
 {
-    // this being empty notes the feature being disabled
-    m_collectionFile = "";
-
-    // name of the collection file itself
-    const std::string COLLECTION("mantid.qhc");
-
-    // try next to the executable
-    Poco::Path path(binDir, COLLECTION);
-    g_log.debug() << "Trying \"" << path.absolute().toString() << "\"\n";
-    if (Poco::File(path).exists())
-    {
-        m_collectionFile =path.absolute().toString();
-        return;
-    }
-
-    // try where the builds will put it
-    path = Poco::Path(binDir, "qtassistant/"+COLLECTION);
-    g_log.debug() << "Trying \"" << path.absolute().toString() << "\"\n";
-    if (Poco::File(path).exists())
-    {
-        m_collectionFile = path.absolute().toString();
-        return;
-    }
-
-    // try in a good linux install location
-    path = Poco::Path(binDir, "../share/doc/" + COLLECTION);
-    g_log.debug() << "Trying \"" << path.absolute().toString() << "\"\n";
-    if (Poco::File(path).exists())
-    {
-        m_collectionFile = path.absolute().toString();
-        return;
-    }
-
-    // try a special place for mac/osx
-    path = Poco::Path(binDir, "../../share/doc/" + COLLECTION);
-    if (Poco::File(path).exists())
-    {
-        m_collectionFile = path.absolute().toString();
-        return;
-    }
-
-    // all tries have failed
-    g_log.information("Failed to find help system collection file \"" + COLLECTION + "\"");
+  g_log.debug() << "Opening url: \"" << url << "\"\n";
+  QDesktopServices::openUrl(QUrl(QLatin1String(url.c_str())));
 }
 
 /**
- * Determine the location of qt-assistant executable. This
- * checks in multiple locations.
- *
- * @param binDir The location of the mantid executable.
- */
-void HelpWindowImpl::findQtAssistantExe(std::string &binDir)
-{
-#ifdef __linux__
-    // not needed in linux since qt-assistant is
-    // assumed system-level installed
-    UNUSED_ARG(binDir);
-
-    // check system locations
-    m_assistantExe = "/usr/local/bin/assistant-qt4";
-    if (Poco::File(m_assistantExe).exists())
-        return;
-    g_log.debug() << "File \"" << m_assistantExe << "\" does not exist\n";
-
-    m_assistantExe = "/usr/bin/assistant-qt4";
-    if (Poco::File(m_assistantExe).exists())
-        return;
-    g_log.debug() << "File \"" << m_assistantExe << "\" does not exist\n";
-
-    m_assistantExe = "/usr/local/bin/assistant";
-    if (Poco::File(m_assistantExe).exists())
-        return;
-    g_log.debug() << "File \"" << m_assistantExe << "\" does not exist\n";
-
-    m_assistantExe = "/usr/bin/assistant";
-    if (Poco::File(m_assistantExe).exists())
-        return;
-    g_log.debug() << "File \"" << m_assistantExe << "\" does not exist\n";
-
-    // give up and hope it is in the path
-    g_log.debug() << "Assuming qt-assistant is elsewhere in the path.\n";
-    m_assistantExe = "assistant";
-#else
-    // windows it is next to MantidPlot
-    m_assistantExe = Poco::Path(binDir, "assistant").absolute().toString();
-    if (Poco::File(m_assistantExe).exists())
-        return;
-    g_log.debug() << "File \"" << m_assistantExe << "\" does not exist\n";
-
-    m_assistantExe = Poco::Path(binDir, "assistant.exe").absolute().toString();
-    if (Poco::File(m_assistantExe).exists())
-        return;
-    g_log.debug() << "File \"" << m_assistantExe << "\" does not exist\n";
-
-    // give up and hope it is in the path
-    g_log.debug() << "Assuming qt-assistant is elsewhere in the path.\n";
-    m_assistantExe = "assistant.exe";
-#endif
-}
-
-/**
- * Determine the location of the collection and cache files.
+ * Return the root of the html documentation path
  */
-void HelpWindowImpl::determineFileLocs()
+std::string HelpWindow::htmlRoot()
 {
-    // determine collection file location
-    string binDir = Mantid::Kernel::ConfigService::Instance().getDirectoryOfExecutable();
-    this->findCollectionFile(binDir);
-    if (m_collectionFile.empty())
-    {
-        // clear out the other filenames
-        m_assistantExe = "";
-        m_cacheFile = "";
-        return;
-    }
-    g_log.debug() << "Using collection file \"" << m_collectionFile << "\"\n";
-
-    // location for qtassistant
-    this->findQtAssistantExe(binDir);
-    if (m_assistantExe.empty())
-    {
-        // clear out the other filenames
-        m_collectionFile = "";
-        m_cacheFile = "";
-        return;
-    }
-    g_log.debug() << "Using \"" << m_assistantExe << "\" for viewing help\n";
+  using namespace Mantid::Kernel;
 
-    // determine cache file location
-    m_cacheFile = "mantid.qhc";
-    QString dataLoc = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
-    if (dataLoc.endsWith("mantidproject"))
-    {
-        Poco::Path path (dataLoc.toStdString(), m_cacheFile);
-        m_cacheFile = path.absolute().toString();
-    }
-    else if (dataLoc.endsWith("MantidPlot")) // understood to end in "Mantid/MantidPlot"
-    {
-        Poco::Path path(dataLoc.toStdString());
-        path = path.parent(); // drop off "MantidPlot"
-        path = path.parent(); // drop off "Mantid"
-        path = Poco::Path(path, "mantidproject");
-        path = Poco::Path(path, m_cacheFile);
-        m_cacheFile = path.absolute().toString();
-    }
-    else
-    {
-        g_log.debug() << "Failed to determine help cache file location\n"; // REMOVE
-        m_cacheFile = "";
-    }
+  string root;
+  try
+  {
+    root = ConfigService::Instance().getString("docs.html.root");
+  }
+  catch(Exception::NotFoundError &)
+  {
+    // Try default package root
+    root = DEFAULT_PACKAGE_HTML_RELPATH;
+  }
+  return root;
 }
 
 } // namespace API
diff --git a/Code/Mantid/MantidQt/API/src/SignalRange.cpp b/Code/Mantid/MantidQt/API/src/SignalRange.cpp
index d03a33d9c0870c53692e6cc5667666c16ff0e416..54731b2507fbc3890c24b0bf754e0d86e9a3a3ca 100644
--- a/Code/Mantid/MantidQt/API/src/SignalRange.cpp
+++ b/Code/Mantid/MantidQt/API/src/SignalRange.cpp
@@ -90,7 +90,7 @@ namespace MantidQt
 
         double signal;
         signal = intervals[i].minValue();
-        if (signal != inf && signal > 0 && signal < minSignal) minSignal = signal;
+        if (signal != inf && signal < minSignal) minSignal = signal;
 
         signal = intervals[i].maxValue();
         if (signal != inf && signal > maxSignal) maxSignal = signal;
@@ -136,7 +136,7 @@ namespace MantidQt
         // Skip any 'infs' as it screws up the color scale
         if (signal != inf)
         {
-          if (signal > 0 && signal < minSignal) minSignal = signal;
+          if (signal < minSignal) minSignal = signal;
           if (signal > maxSignal) maxSignal = signal;
         }
       } while (it->next());
diff --git a/Code/Mantid/MantidQt/API/test/SignalRangeTest.h b/Code/Mantid/MantidQt/API/test/SignalRangeTest.h
index a7e44e697d0834f47fb77a345281baafdaf06dbc..11f4dbd84dea7d5d997ee4e23818ac0bf4166e2a 100644
--- a/Code/Mantid/MantidQt/API/test/SignalRangeTest.h
+++ b/Code/Mantid/MantidQt/API/test/SignalRangeTest.h
@@ -90,7 +90,7 @@ public:
       auto * iterator = new MockMDIterator; // deleted by call to SignalRange below
       EXPECT_CALL(*iterator, valid()).WillRepeatedly(Return(true));
       EXPECT_CALL(*iterator, next()).WillOnce(Return(true)).WillRepeatedly(Return(false));
-      EXPECT_CALL(*iterator, getNormalizedSignal()).WillOnce(Return(1.5)).WillRepeatedly(Return(10.0));
+      EXPECT_CALL(*iterator, getNormalizedSignal()).WillOnce(Return(-1.5)).WillRepeatedly(Return(10.0));
       iterators[i] = iterator;
     }
 
@@ -104,7 +104,7 @@ public:
 
     TS_ASSERT(Mock::VerifyAndClearExpectations(&data));
 
-    TS_ASSERT_DELTA(1.5, range.minValue(), 1e-10);
+    TS_ASSERT_DELTA(-1.5, range.minValue(), 1e-10);
     TS_ASSERT_DELTA(10.0, range.maxValue(), 1e-10);
   }
 
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp
index 5677c037c350545b30c71e4e8d6303d91626f38e..53a8efc5d7b32e482fbf1b861853457cc31ee766 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp
@@ -48,7 +48,7 @@ namespace MantidQt
     //---------------------------------------------------------------------------
 
     /// Default constructor
-    LoadDialog:: LoadDialog(QWidget *parent) 
+    LoadDialog:: LoadDialog(QWidget *parent)
       : API::AlgorithmDialog(parent), m_form(), m_currentFiles(), m_initialHeight(0),
         m_populating(false)
     {
@@ -77,7 +77,7 @@ namespace MantidQt
     {
       const std::string & loaderName = getAlgorithm()->getPropertyValue("LoaderName");
       QString helpPage = (loaderName.empty()) ? QString("Load") : QString::fromStdString(loaderName);
-      MantidQt::API::HelpWindow::Instance().showAlgorithm(helpPage);
+      MantidQt::API::HelpWindow::showAlgorithm(helpPage);
     }
 
     /**
@@ -174,7 +174,7 @@ namespace MantidQt
       m_form.fileWidget->saveSettings("Mantid/Algorithms/Load");
       AlgorithmDialog::saveInput();
       //Ensure the filename is store as the full file
-      API::AlgorithmInputHistory::Instance().storeNewValue("Load", 
+      API::AlgorithmInputHistory::Instance().storeNewValue("Load",
 							   QPair<QString, QString>("Filename", m_currentFiles));
     }
 
@@ -253,7 +253,7 @@ namespace MantidQt
         m_form.propertyLayout->setEnabled(true);
         m_form.propertyLayout->activate();
         this->resize(this->width(), m_initialHeight + 15);
-        
+
         // Reset the algorithm pointer so that the base class re-reads the properties and drops links from
         // old widgets meaning they are safe to remove
         setAlgorithm(loadAlg);
@@ -332,7 +332,7 @@ namespace MantidQt
           QCheckBox *checkBox = new QCheckBox(parent);
           inputWidget = checkBox;
           addValidator = false;
-        } 
+        }
         // Options box
         else if( !prop->allowedValues().empty() )
         {
@@ -340,7 +340,7 @@ namespace MantidQt
           inputWidget = optionsBox;
           std::set<std::string> items = prop->allowedValues();
           std::set<std::string>::const_iterator vend = items.end();
-          for(std::set<std::string>::const_iterator vitr = items.begin(); vitr != vend; 
+          for(std::set<std::string>::const_iterator vitr = items.begin(); vitr != vend;
             ++vitr)
           {
             optionsBox->addItem(QString::fromStdString(*vitr));
diff --git a/Code/Mantid/docs/CMakeLists.txt b/Code/Mantid/docs/CMakeLists.txt
index aa074d79122f1ccd9af665b5df60b123ebe5eb25..d98ce79a0f492ecb83167ff99ee6e607c859f554 100644
--- a/Code/Mantid/docs/CMakeLists.txt
+++ b/Code/Mantid/docs/CMakeLists.txt
@@ -5,13 +5,17 @@ find_package ( Sphinx )
 
 if ( SPHINX_FOUND )
   # We generate a target per build type, i.e docs-html, docs-test
-  set ( SPHINX_BUILD_DIR ${CMAKE_BINARY_DIR}/docs )
+  set ( SPHINX_BUILD_DIR ${DOCS_BUILDDIR} )
   set ( SCREENSHOTS_DIR ${SPHINX_BUILD_DIR}/screenshots )
 
   # targets
   set ( TARGET_PREFIX docs)
   # runner
-  set ( DOCS_RUNNER_EXE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/MantidPlot )
+  if ( APPLE )
+    set ( DOCS_RUNNER_EXE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${BIN_DIR}/MantidPlot )
+  else ()
+    set ( DOCS_RUNNER_EXE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/MantidPlot )
+  endif()
 
   # HTML target
   set ( BUILDER html )
@@ -38,18 +42,19 @@ if ( SPHINX_FOUND )
   set_target_properties ( ${TARGET_PREFIX}-test PROPERTIES FOLDER "Documentation"
                                                 EXCLUDE_FROM_DEFAULT_BUILD 1
                                                 EXCLUDE_FROM_ALL 1)
-endif ()
 
+  ###############################################################################
+  # Installation settings
+  ###############################################################################
+  # Allow control over whether the documentation is packaged
+  set ( PACKAGE_DOCS False CACHE BOOL
+        "If true the html documentation is installed in the share/doc directory of the package" )
 
-###############################################################################
-# QtAssistant
-###############################################################################
-if ( APPLE )
-  set ( ENABLE_QTASSISTANT False CACHE BOOL "Build qt-assistant documentation" )
+  if ( PACKAGE_DOCS )
+    set ( HTML_DOCS_DEST share/doc )
+    install ( DIRECTORY ${SPHINX_BUILD_DIR}/html
+              DESTINATION ${HTML_DOCS_DEST} )
+  endif ()
 else ()
-  set ( ENABLE_QTASSISTANT False CACHE BOOL "Build qt-assistant documentation" FORCE )
-endif ( APPLE )
-
-if (ENABLE_QTASSISTANT)
-  add_subdirectory ( qtassistant )
-endif (ENABLE_QTASSISTANT)
+  message ( WARNING "Sphinx package not found, unable to build documentation." )
+endif ()
diff --git a/Code/Mantid/docs/qtassistant/CMakeLists.txt b/Code/Mantid/docs/qtassistant/CMakeLists.txt
deleted file mode 100644
index 02ea3023599c13f9d3ec6901724e524fdc23f584..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/CMakeLists.txt
+++ /dev/null
@@ -1,184 +0,0 @@
-######################################################################
-# QT assistant documentation generator
-######################################################################
-#QT_QCOLLECTIONGENERATOR_EXECUTABLE
-if (QT_QCOLLECTIONGENERATOR_EXECUTABLE)
-   # set directories to follow structure of qt4 on linux
-   set (HELP_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/qtassistant)
-   set (HELP_QCH_DIR ${HELP_OUT_DIR}/qch)
-   set (HELP_HTML_DIR ${HELP_OUT_DIR}/html)
-   set (HELP_HTML_IMG_DIR ${HELP_HTML_DIR}/img)
-   set (HELP_IMG_DIR ${HELP_OUT_DIR}/src/images)
-   
-   # Dowload the Dialog images as part of the build for Qt Assistant
-   set ( QT_ASSISTANT_FETCH_IMAGES OFF CACHE BOOL "Download algorithm dialog images for qt assistant as part of the build.")
-   MARK_AS_ADVANCED(QT_ASSISTANT_FETCH_IMAGES)
-   set ( fetch_images "")
-   if ( ${QT_ASSISTANT_FETCH_IMAGES} )
-     set ( fetch_images "-g")
-   endif ( ${QT_ASSISTANT_FETCH_IMAGES} )
-
-   message (STATUS "Adding information for qtassistant")
-   set (HELP_QHCP_SOURCE 
-         ${HELP_OUT_DIR}/mantid.qhcp
-         ${HELP_IMG_DIR}/Mantid_Logo_Transparent.png
-         ${HELP_IMG_DIR}/MantidPlot_Icon_32offset.png
-         ${HELP_OUT_DIR}/about.txt
-         ${HELP_OUT_DIR}/mantidgeneral.qhp
-	 ${HELP_HTML_DIR}/index.html
-         ${HELP_HTML_DIR}/mantidplot.html
-         ${HELP_HTML_DIR}/userui.html
-         ${HELP_HTML_DIR}/mantidpython.html
-         ${HELP_HTML_DIR}/developers.html
-        )
-
-   # find the programs that generate the equation png
-find_program ( LATEX_EXE latex )
-find_program ( DVIPNG_EXE dvipng )
-   if (LATEX_EXE AND DVIPNG_EXE)
-     set (EXTRA_QHP_GEN_ARGS --latex ${LATEX_EXE} --dvipng ${DVIPNG_EXE})
-   endif()
-
-   # copy over images
-   set ( IMAGES
-         AbsorptionFlow.png
-         BackToBackExponentialWithConstBackground.png
-         BinMD_Coordinate_Transforms_withLine.png
-         Box.png
-         ChopDataIntegrationExplanation.png
-         ConvertToEnergyInfoTable.png
-         Convolution.png
-         FFTGaussian1FFT.png
-         FFTGaussian1.png
-         FFTGaussian2FFT.png
-         FFTGaussian2.png
-         Gaussian2Fit.jpg
-         Gaussian2Fit_Ties.jpg
-         GaussianFit.jpg
-         GaussianFit_Ties.jpg
-         GaussianWithConstBackground.png
-         GEM_Focused.png
-         IkedaCarpenterPVwithBackground.png
-         ImageNotFound.png
-         InstrumentTree.jpg
-         IntegrateEllipsoids.png
-         IntegratePeaksMD_graph1.png
-         IntegratePeaksMD_graph2.png
-         LorentzianWithConstBackground.png
-         Monitorspect_getei.jpg
-         PeakIntensityVsRadius_fig.png
-         PlotPeakByLogValue_Output.png
-         ReadFromFile-Grouping.png
-         RebinByPulseTime.png
-         SassenaFFTexample.jpg
-         SliceViewer-DetectorFace.png
-         UnwrapSNS_inst.png
-         UserFunction1D.gif
-         Wav_Q_bins.png
-       )
-   #message ( "QTASSISTANT_IMAGES ${IMAGES}")
-   copy_python_files_to_dir("${IMAGES}" "${CMAKE_CURRENT_SOURCE_DIR}/../source/images" ${HELP_HTML_IMG_DIR} INSTALL_IMAGES)
-
-   # copy the other generic stuff
-   add_custom_command( OUTPUT ${HELP_IMG_DIR}/Mantid_Logo_Transparent.png
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_SOURCE_DIR}/Images/Mantid_Logo_Transparent.png
-                               ${HELP_IMG_DIR}/Mantid_Logo_Transparent.png
-                       DEPENDS ${CMAKE_SOURCE_DIR}/Images/Mantid_Logo_Transparent.png )
-   add_custom_command( OUTPUT ${HELP_IMG_DIR}/MantidPlot_Icon_32offset.png
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_SOURCE_DIR}/Images/MantidPlot_Icon_32offset.png
-                               ${HELP_IMG_DIR}/MantidPlot_Icon_32offset.png
-                       DEPENDS ${CMAKE_SOURCE_DIR}/Images/MantidPlot_Icon_32offset.png )
-   add_custom_command( OUTPUT ${HELP_OUT_DIR}/mantidgeneral.qhp
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/mantidgeneral.qhp
-                               ${HELP_OUT_DIR}/mantidgeneral.qhp
-                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/mantidgeneral.qhp )
-   add_custom_command( OUTPUT ${HELP_OUT_DIR}/about.txt
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/about.txt
-                               ${HELP_OUT_DIR}/about.txt
-                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/about.txt )
-
-   add_custom_command( OUTPUT ${HELP_OUT_DIR}/mantid.qhcp
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/mantid.qhcp
-                               ${HELP_OUT_DIR}/mantid.qhcp
-                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/mantid.qhcp )
-
-   add_custom_command( OUTPUT ${HELP_HTML_DIR}/index.html
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/index.html
-                               ${HELP_HTML_DIR}/index.html
-                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/index.html )
-   add_custom_command( OUTPUT ${HELP_HTML_DIR}/mantidplot.html
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/mantidplot.html
-                               ${HELP_HTML_DIR}/mantidplot.html
-                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/mantidplot.html )
-   add_custom_command( OUTPUT ${HELP_HTML_DIR}/userui.html
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/userui.html
-                               ${HELP_HTML_DIR}/userui.html
-                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/userui.html )
-   add_custom_command( OUTPUT ${HELP_HTML_DIR}/mantidpython.html
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/mantidpython.html
-                               ${HELP_HTML_DIR}/mantidpython.html
-                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/mantidpython.html )
-   add_custom_command( OUTPUT ${HELP_HTML_DIR}/developers.html
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/developers.html
-                               ${HELP_HTML_DIR}/developers.html
-                       DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/developers.html )
-
-   if (WIN32) # copy the assistant executable for windows 32 and 64
-      set (QTASSISTANT_EXE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/assistant.exe)
-      add_custom_command( OUTPUT ${QTASSISTANT_EXE}
-                          COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${CMAKE_LIBRARY_PATH}/assistant.exe
-                                  ${QTASSISTANT_EXE} )
-
-   endif (WIN32)
-
-   set ( HELP_ALGO_OUT
-         ${HELP_OUT_DIR}/algorithms.qhp
-         ${HELP_HTML_DIR}/algorithms_index.html )
-
-   set ( HELP_FIT_OUT
-         ${HELP_OUT_DIR}/fitfunctions.qhp
-         ${HELP_HTML_DIR}/fitfunctions_index.html )
-
-   add_custom_command(OUTPUT ${HELP_ALGO_OUT}
-                      DEPENDS make_algorithms_help.py qhpfile.py algorithm_help.py htmlwriter.py parseLinks.py mediawiki.py eqnparser.py ${INSTALL_IMAGES} Algorithms
-                      COMMAND ${PYTHON_EXE_WRAPPER} ${CMAKE_CURRENT_SOURCE_DIR}/make_algorithms_help.py 
-                              ${EXTRA_QHP_GEN_ARGS} -m ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} -o ${HELP_OUT_DIR} ${fetch_images}
-                      )
-
-   add_custom_command(OUTPUT ${HELP_FIT_OUT}
-                      DEPENDS make_fitfunctions_help.py qhpfile.py fitfunctions_help.py htmlwriter.py parseLinks.py mediawiki.py eqnparser.py ${INSTALL_IMAGES} CurveFitting
-                      COMMAND ${PYTHON_EXE_WRAPPER} ${CMAKE_CURRENT_SOURCE_DIR}/make_fitfunctions_help.py 
-                              ${EXTRA_QHP_GEN_ARGS} -m ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} -o ${HELP_OUT_DIR}
-                     )
-
-   add_custom_command(OUTPUT  ${HELP_OUT_DIR}/mantid.qhc ${HELP_QCH_DIR}/algorithms.qch ${HELP_QCH_DIR}/fitfunctions.qch ${HELP_QCH_DIR}/mantidgeneral.qch
-                      DEPENDS ${HELP_ALGO_OUT} ${HELP_FIT_OUT} ${HELP_QHCP_SOURCE}
-		      COMMAND ${QT_QCOLLECTIONGENERATOR_EXECUTABLE} ${HELP_OUT_DIR}/mantid.qhcp
-		      )
-              
-   add_custom_target ( qtassistant 
-                       DEPENDS Framework ${HELP_OUT_DIR}/mantid.qhc
-		               ${QTASSISTANT_EXE}
-                       )
-
-   # Copy to correct location in bin
-   set (HELP_BIN_OUT_DIR  ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/qtassistant )
-   add_custom_command( TARGET qtassistant
-                       POST_BUILD
-                       COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory ${HELP_OUT_DIR} ${HELP_BIN_OUT_DIR} 
-   )
-   set_property ( TARGET qtassistant PROPERTY FOLDER "Documentation" )
-
-   ###########################################################################################
-   # Installation settings
-   ###########################################################################################
-   set ( GUI_HELP_DEST share/doc )
-   # must "make qtassistant" before "make package" otherwise there will be a build failure
-   install ( DIRECTORY   ${HELP_QCH_DIR} ${HELP_HTML_DIR} ${HELP_IMG_DIR}
-             DESTINATION ${GUI_HELP_DEST} )
-   install (FILES ${HELP_OUT_DIR}/mantid.qhc
-             DESTINATION ${GUI_HELP_DEST} )
-
-else (QT_QCOLLECTIONGENERATOR_EXECUTABLE)
-   message (FATAL_ERROR " Did not find qcollectiongenerator - cannot create qtassistant files")
-endif()
diff --git a/Code/Mantid/docs/qtassistant/README.md b/Code/Mantid/docs/qtassistant/README.md
deleted file mode 100644
index c64617d57daff5a436060378eb81ff6b2d6901cf..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-mycollection.qhcp        - main collection file that has generic about information
-myapplication-manual.qhp - information about an individual manual
-mycollection.qhc         - final output file to use
-myapplication-manual.qch - cache file for the applications help info
-
-To generate the help run
-
- qcollectiongenerator mycollection.qhcp -o mycollection.qhc
-
-To view use
-
- assistant-qt4 -collectionFile mycollection.qhc
diff --git a/Code/Mantid/docs/qtassistant/WikiLinks.txt b/Code/Mantid/docs/qtassistant/WikiLinks.txt
deleted file mode 100644
index 18b08d2be580da5c40168b63eac6ec1f64403ce1..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/WikiLinks.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-Algorithm
-Analysis_Data_Service
-BinMD_Coordinate_Transformations
-CalFile
-Create_Ikeda_Carpenter_Parameters
-Error_Values
-Event_Workspace
-Fit_Constraint
-Geometry
-Grouping_Workspace
-How_To_Define_Geometric_Shape
-IDetector
-IDF
-IFunction1D
-IFunctionMD
-IMDWorkspace
-IPeak
-Instrument
-Instrument_Definition_File
-LiveListener
-Logging
-Make_Diffraction_MDEventWorkspace
-MantidPlot:_Data_Analysis_and_Curve_Fitting
-MantidPlot:_Help
-Mask_Workspace
-Matrix_Workspace
-MD_Event_Workspace
-MD_Histo_Workspace
-MD_Transformation_factory
-MD_Workspace
-Nearest_Neighbours
-OffsetsWorkspace
-PeaksWorkspace
-Properties
-Properties_File
-PropertiesFile
-Python_Algorithm
-Ragged_Workspace
-RAW_File
-RectangularDetector
-RectangularDetectors
-RockingCurve
-Run
-Sample
-SliceViewer
-SpecialWorkspace2D
-SpectraToDetectorMap
-SplittingInterval
-SplittersWorkspace
-UnitFactory
-Workspace
-Workspace2D
-Workspace_Algebra
-WorkspaceGroup
-TableWorkspace
-TimeSeriesProperty
-Unit_Factory
-Units
-V3D
-Writing_custom_ConvertTo_MD_transformation
diff --git a/Code/Mantid/docs/qtassistant/algorithm_help.py b/Code/Mantid/docs/qtassistant/algorithm_help.py
deleted file mode 100644
index 180456485c03f6952ca163cac089fdd361f4489f..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/algorithm_help.py
+++ /dev/null
@@ -1,176 +0,0 @@
-from assistant_common import WEB_BASE, HTML_DIR
-from htmlwriter import HtmlWriter
-import mantid
-from mediawiki import MediaWiki
-import os
-import wiki_tools
-from parseLinks import fixLinks
-from fixQuotes import fixQuotes
-
-DIRECTION = {
-    0:"input",
-    1:"output",
-    2:"input/output"
-}
-from assistant_common import WEB_BASE, HTML_DIR
-
-def writeCatLink(htmlfile, category):
-    category = category.replace('\\', '/')
-    category = category.split('/')
-    filename = 'AlgoCat_' + category[0] + '.html'
-    url = filename
-    
-    if len(category) > 1:
-        text = '/'.join(category[:-1]) + '/'
-        url += '#' + '_'.join(category[1:])
-        htmlfile.write(text)
-    htmlfile.link(category[-1], url)
-
-def propToList(property, number):
-    # order
-    result = [str(number+1)]
-    # name
-    result.append(property.name)
-    # direction
-    result.append(DIRECTION[property.direction])
-    # type
-    result.append(property.type)
-    # default
-    if (property.direction == 1) and (not isinstance(property, mantid.api.IWorkspaceProperty)): # 1=direction[output]
-        # Nothing to show under the default section for an output properties that are not workspace properties.
-        result.append("&nbsp;")
-    elif (property.isValid == ""): #Nothing was set, but it's still valid = NOT  mandatory
-      defaultstr = wiki_tools.create_property_default_string(property)
-      result.append(defaultstr)
-    else:
-      result.append("mandatory")
-    # description
-    text = property.documentation
-    if len(text) <= 0:
-        text = "&nbsp;"
-    else:
-        text = text.replace("\n", "<br/>")
-    text=fixQuotes(text)
-    #fix links
-    fixer=fixLinks(text)
-    text = fixer.parse()
-    result.append(text)
-    return result
-
-def process_algorithm(name, versions, qhp, outputdir, fetchimages, **kwargs): # was (args, algo):
-    categories = []
-    outfile = "Algo_%s.html" % (name)
-    qhp.addFile(os.path.join(HTML_DIR, outfile), name)
-
-    # put newest first
-    versions = list(versions)
-    versions.reverse()
-
-    htmlfile = HtmlWriter(os.path.join(outputdir, outfile), name)
-    htmlfile.openTag("center")
-    htmlfile.h1(name, newline=False)
-    htmlfile.closeTag(True)
-
-    htmlfile.openTag("p")
-    htmlfile.link("wiki help", WEB_BASE+name)
-    htmlfile.closeTag(True)
-    htmlfile.nl()
-    htmlfile.hr()
-    
-    imgpath = ""
-    IMG = "img"
-    imagefile = '%s_dlg.png' %name
-    
-    if fetchimages:
-        # os.environ['http_proxy']="http://wwwcache.rl.ac.uk:8080"  #TODO should be cmake variable
-        try:
-            # Download image
-            import urllib
-            fileurl = "http://download.mantidproject.org/algorithm_screenshots/ScreenShotImages/%s" % imagefile #TODO location should be cmake variable
-            imgpath = os.path.join(HTML_DIR, IMG, imagefile)
-            destname = os.path.join(outputdir, IMG, imagefile)
-            urllib.urlretrieve(fileurl, filename=destname)   
-            
-            # Now link to image
-            sourcepath = "%s/%s" % (IMG, imagefile)
-    
-            htmlfile.openTag("img", {"src": sourcepath, "style":"position:relative; z-index:1000; padding-left:5px;", "width":"400", "align":"right"})
-            htmlfile.closeTag(True)
-            if imgpath != "":
-                qhp.addFile(imgpath)
-            
-        except IOError:
-            pass    
-    
-    num_versions = len(versions)
-    for version in versions:
-        htmlfile.openTag("div", {"id":"version_"+str(version)})
-        htmlfile.nl()
-        if num_versions > 0:
-            htmlfile.h2("Version %d" % version)
-
-        alg = mantid.AlgorithmManager.create(name, version)
-        categories.extend(alg.categories())
-        
-        htmlfile.h3("Summary")
-        #htmlfile.p(alg.getWikiSummary())
-        wiki = MediaWiki(htmlfile, HTML_DIR, latex=kwargs["latex"], dvipng=kwargs["dvipng"])
-        wiki.parse(alg.summary(), qhp)
-
-        htmlfile.h3("Usage")
-        include_signature, custom_usage = wiki_tools.get_wiki_usage(name, version)
-        text=''
-        if include_signature:
-            text += wiki_tools.create_function_signature(alg, name)
-            text = text.split("\n")
-            if len(text) > 1:
-                text[0] = text[0] + "<pre>"
-                text[-1] = text[-1] + "</pre>"
-            text = "\n".join(text)
-        text+= "<br clear=all>\n\n" 
-        text+="<pre>"+custom_usage+ "</pre>"
-        htmlfile.openTag("p")
-        htmlfile.addTxtEle("code", text)
-        htmlfile.closeTag(True)
-
-        alias = alg.alias().strip()
-        if len(alias) > 0:
-            htmlfile.h3("Alias")
-            htmlfile.p("This algorithm is also called '%s'" % alias)
-            qhp.addFile(os.path.join(HTML_DIR, outfile), alias)
-
-        htmlfile.h3("Properties")
-        htmlfile.openTag("table", {"border":"1", "cellpadding":"5", "cellspacing":"0"})
-        htmlfile.writeRow(["Order", "Name", "Direction", "Type", "Default", "Description"], True)
-        properties = alg.getProperties()
-        mandatory = alg.mandatoryProperties()
-        for (i, property) in zip(range(len(properties)), properties):
-            htmlfile.writeRow(propToList(property, i))
-        htmlfile.closeTag(True)
-
-        wiki = MediaWiki(htmlfile, HTML_DIR, latex=kwargs["latex"], dvipng=kwargs["dvipng"])
-        text = wiki_tools.get_custom_wiki_section(name, version, "*WIKI*", True, False)
-        if len(text.strip()) > 0:
-            htmlfile.h3("Description")
-            wiki.parse(text, qhp)
-
-        htmlfile.closeTag(True)
-
-        if version > 1:
-            htmlfile.hr()
-
-    # add index for categories
-    htmlfile.hr()
-    categories = list(set(categories)) # remove duplicates
-    htmlfile.openTag("p")
-    htmlfile.write("Categories: ")
-    for i in range(len(categories)):
-        writeCatLink(htmlfile, categories[i])
-        if i + 1 < len(categories):
-            htmlfile.write(', ')
-
-    # cleanup the file
-    htmlfile.nl()
-    htmlfile.closeTag(True)
-    htmlfile.closeTag(True)
-    htmlfile.closeTag(True)
diff --git a/Code/Mantid/docs/qtassistant/assistant_common.py b/Code/Mantid/docs/qtassistant/assistant_common.py
deleted file mode 100644
index f884d6461cb4b37bc6db39ba0b10f3c4d0f28baf..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/assistant_common.py
+++ /dev/null
@@ -1,54 +0,0 @@
-HTML_DIR = "html"
-QCH_DIR = "qch"
-IMG_DIR = "src/images"
-WEB_BASE  = "http://www.mantidproject.org/"
-
-def getParser(description):
-    import optparse
-    parser = optparse.OptionParser(description=description)
-    defaultmantidpath = ""
-    parser.add_option('-m', '--mantidpath', dest='mantidpath',
-                      default=defaultmantidpath,
-                      help="Full path to the Mantid compiled binary folder. Default: '%s'. This will be saved to an .ini file" % defaultmantidpath)
-    parser.add_option('-o', '--output', dest='helpoutdir',
-                      help="Full path to where the output files should go.")
-    parser.add_option('--latex', dest='latex',
-                      help="Full path to latex executable")
-    parser.add_option('--dvipng', dest='dvipng',
-                      help="Full path to dvi executable")
-
-    return parser
-
-def assertDirs(outputdir, verbose=False):
-    import os
-
-    for direc in (HTML_DIR, QCH_DIR, IMG_DIR):
-        direc = os.path.join(outputdir, direc)
-        direc = os.path.abspath(direc)
-        if not os.path.exists(direc):
-            if verbose:
-                print "creating '%s'" % direc
-            try:
-                os.makedirs(direc)
-            except OSError, e:
-                # EEXIST says that the file already exists
-                if e.errno != os.errno.EEXIST:
-                    raise e
-
-def addEle(doc, tag, parent=None, attrs={}):
-    """Assumes that the 'doc' that comes in is a xml.dom.minidom.Document
-    """
-    ele = doc.createElement(tag)
-    for key in attrs.keys():
-        ele.setAttribute(key, attrs[key])
-    if parent is not None:
-        parent.appendChild(ele)
-    return ele
-
-def addTxtEle(doc, tag, text, parent=None, attrs={}):
-    """Assumes that the 'doc' that comes in is a xml.dom.minidom.Document
-    """
-    ele = addEle(doc, tag, parent, attrs)
-    text = doc.createTextNode(text)
-    ele.appendChild(text)
-    return ele
diff --git a/Code/Mantid/docs/qtassistant/checkmissingimg.py b/Code/Mantid/docs/qtassistant/checkmissingimg.py
deleted file mode 100755
index bbcd8678e56c7747077b258a1b3bfda2ca9ed8c6..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/checkmissingimg.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/env python
-import logging
-import os
-import re
-from fetchimg import Fetcher
-
-from mediawiki import IMG_NOT_FOUND
-
-def getHtml(htmldir):
-    """
-    Recursively find all html files in the supplied directory.
-    @param htmldir The base directory for the html site.
-    @returns All html files with full path.
-    """
-    candidates = os.listdir(htmldir)
-    results = []
-    for candidate in candidates:
-        if os.path.isdir(candidate):
-            results.extend(getHtml(os.path.join(htmldir, candidate)))
-        elif candidate.endswith('.html'):
-            results.append(os.path.join(htmldir, candidate))
-    return results
-
-def processHtml(htmldir, filename):
-    """
-    @param htmldir The base directory for the html site.
-    @param filename The html file to parse and look for missing images in.
-    @returns All Missing image files.
-    """
-    logger = logging.getLogger("processHtml")
-    logger.info("processHtml(%s, %s)" % (htmldir, filename))
-
-    # read in the entire html file
-    handle = file(filename, 'r')
-    text = handle.read()
-    handle.close()
-
-    ##### determine all the requested images
-    # that aren't set to IMG_NOT_FOUND
-    candidates = re.findall(r"img(.+)/>", text, flags=re.MULTILINE)
-    if len(candidates) <= 0:
-        return []
-    options = []
-    for candidate in candidates:
-        start = candidate.find("src=")
-        if start <= 0:
-            continue
-        candidate = candidate[start+5:]
-        end = candidate.find('"')
-        if end <= start:
-            end = candidate.find("'")
-        if end <= start:
-            continue
-        options.append(candidate[:end])
-    # that are set to IMG_NOT_FOUND
-    if IMG_NOT_FOUND in text:
-        logger.info("IMAGE_NOT_FOUND in '%s'" % filename)
-        candidates = []
-        index = 0
-        while index >= 0:
-            index = text.find(IMG_NOT_FOUND, index)
-            end = text.find("</figure>", index)
-            if end < index or index < 0:
-                break
-            figs = re.findall(r'Missing image:\s+(.+)</figcaption>',
-                              text[index:end])
-            candidates.extend(figs)
-            index += len(IMG_NOT_FOUND)
-            logger.info("CANDIDATES: %s" % str(candidates))
-        options.extend(candidates)
-
-    # add them to the list of missing images if not found
-    results = []
-    for candidate in options:
-        candidate = os.path.join(htmldir, candidate)
-        logger.info("looking for '%s'" % candidate)
-        if not os.path.exists(candidate):
-            logger.info("candidate = '%s' not found" % candidate)
-            results.append(candidate)
-
-    # return everything that isn't found
-    return results
-
-
-if __name__ == "__main__":
-    # set up the command line option parser
-    import optparse
-    parser = optparse.OptionParser(usage="usage: %prog [options] <htmldir>",
-                                   description="Determine if there are images missing from the built documentation.")
-    parser.add_option('', '--shortnames', dest='shortnames',
-                      default=False, action="store_true",
-                      help="Only print the names of missing images rather than full path")
-    parser.add_option('', '--nosummary', dest='summary',
-                      default=True, action="store_false",
-                      help="Turn off the summary information")
-    parser.add_option('', '--download', dest="downloadarea",
-                      default=None,
-                      help="Download the missing images from the mantid wiki to the specified directory")
-    parser.add_option('', '--loglevel', dest="loglevel",
-                      default="warn",
-                      help="Set the logging level (options are 'debug', 'info', 'warn', 'error')")
-    parser.add_option('', '--logfile', dest="logfile",
-                      default=None,
-                      help="Set filename to log to")
-    (options, args) = parser.parse_args()
-
-    # get the html base directory
-    if len(args) <= 0:
-        parser.error("Failed to specify a html directory to parse")
-    htmldir = os.path.abspath(args[0])
-    if not os.path.exists(htmldir):
-        parser.error("Must specify an existing html directory")
-
-    # configure the logger
-    if options.loglevel.startswith('debug'):
-        options.loglevel=logging.DEBUG
-    elif options.loglevel.startswith('info'):
-        options.loglevel=logging.INFO
-    elif options.loglevel.startswith('warn'):
-        options.loglevel=logging.WARNING
-    elif options.loglevel.startswith('error'):
-        options.loglevel=logging.ERROR
-    else:
-        parser.error("Failed to specify valid log level: '%s'" % options.loglevel)
-    logging.basicConfig(filename=options.logfile, level=options.loglevel)
-
-    # get the list of html files
-    htmlfiles = getHtml(htmldir)
-    if options.summary:
-        print "Verifying %d html files in '%s'" % (len(htmlfiles), htmldir)
-
-    # determine what images are missing
-    missing = []
-    for filename in htmlfiles:
-        missing.extend(processHtml(htmldir, filename))
-
-    # remove repeated filenames
-    missing = list(set(missing))
-    missing.sort()
-
-    # print the results
-    if options.summary:
-        print "Missing %d image files" % len(missing)
-    for filename in missing:
-        if options.shortnames:
-            print os.path.split(filename)[-1]
-        else:
-            print filename
-
-    if options.downloadarea is not None:
-        for filename in missing:
-            fetcher = Fetcher(filename)
-            fetcher.download(options.downloadarea)
diff --git a/Code/Mantid/docs/qtassistant/eqnparser.py b/Code/Mantid/docs/qtassistant/eqnparser.py
deleted file mode 100644
index 73d357793973da8227628234abe98e98bb50a8db..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/eqnparser.py
+++ /dev/null
@@ -1,323 +0,0 @@
-"""
-This was taken from https://github.com/constantAmateur/scihtmlatex
-and modified to be used for generating equations in mantid.
-"""
-#from BeautifulSoup import BeautifulSoup
-import hashlib
-import logging
-import os
-import subprocess
-import tempfile
-
-# Trading size for time-to-generate is a only a good idea when using memcache
-TYPES = {'div':'eq', 'div':'numeq', 'div':'alignedeq', 'div':'numalignedeq', 'span':'eq', 'div':'matrix', 'div':'det'}
-
-bad_tags = ["include", "def", "command", "loop", "repeat", "open", "toks", "output",
-"input", "catcode", "name", "\\^\\^", "\\every", "\\errhelp", "\\errorstopmode",
-"\\scrollmode","\\nonstopmode", "\\batchmode", "\\read", "\\write", "csname",
-"\\newhelp", "\\uppercase", "\\lowercase", "\\relax", "\\aftergroup", "\\afterassignment",
-"\\expandafter", "\\noexpand", "\\special"]
-
-
-# Include your favourite LaTeX packages and commands here
-# ------ NOTE: please leave \usepackage{preview} as the last package
-# ------       it plays a role with dvipng in generating to correct
-# ------       offset for inline equations
-PREAMBLE = r'''
-\documentclass[12pt]{standalone} 
-\usepackage{amsmath}
-\usepackage{amsthm}
-\usepackage{amssymb}
-\usepackage{mathrsfs}
-\usepackage{gensymb}
-\usepackage{preview}
-\usepackage{standalone}
-\pagestyle{empty} 
-\batchmode
-\begin{document} 
-'''
-
-PREAMBLE = r'''
-\documentclass[12pt]{article} 
-\usepackage{amsmath}
-\usepackage{amsthm}
-\usepackage{amssymb}
-\usepackage{mathrsfs}
-\usepackage{gensymb}
-\usepackage{preview}
-\pagestyle{empty} 
-\batchmode
-\begin{document} 
-'''
-
-class Equation:
-    def __init__(self, equation, outdir="/tmp", tmpdir="/tmp", urlprefix="img",
-                 debug=True, latex=None, dvipng=None):
-        """
-        When an Equation object is initialized, it checks the filesystem
-	indiciated by IMGDIR to see if a file with the same name as its
-        key is stored; if the key-named file exists, an <img src> tag
-        referring to the filesystem is inserted into Equation.contents.
-
-        If it isn't found, the equation's latex source is sanitized, compiled
-        to a DVI, turned into a PNG, saved to IMGDIR, and stored in 
-	Equation.contents
-        """
-        # generate a logger
-        self._logger = logging.getLogger(__name__+'.'+self.__class__.__name__)
-        #logging.basicConfig(level=logging.DEBUG)
-
-        # cache latex and dvipng locations
-        self._latex = latex
-        self._dvipng = dvipng
-
-        # trim out extraneous whitespace
-        splitted = equation.strip().split("\n")
-        sanitized = []
-        for item in splitted:
-            item = item.strip()
-            if len(item) > 0:
-                sanitized.append(item)
-        self.contents = "\n".join(sanitized)
-
-        # cache some of the other bits of information
-        self._debug = debug
-        self.tmpdir = tmpdir
-        self._filestodelete = []
-
-        # generate the md5 sum
-        key = hashlib.md5()
-        key.update(self.contents)
-        self._key = key.hexdigest()
-
-        # name of the png file and html tag
-        self.pngfile = os.path.join(outdir, "eqn_" + self._key + '.png')
-        self.contentshtml = '<img src="img/%s"/>' % (os.path.split(self.pngfile)[-1])
-
-        self.cached = os.path.isfile(self.pngfile)
-        if not self.cached:
-            self._logger.info("Cache file '%s' not found. Generating it." % self.pngfile)
-            self._addToTex()
-            self._compileDVI()
-            self._createPNG()
-
-    def __del__(self):
-        if self._debug:
-            return
-        # cleanup
-        for filename in self._filestodelete:
-            if os.path.exists(filename):
-                self._logger.debug("deleting '%s'" % filename)
-                os.remove(filename)
-        
-    def __repr__(self):
-        return self.contents
-        
-    def _addToTex(self):
-        """
-        Creates a Tex file, writes the preamble and the equation, closed the Tex file.
-        
-        Calls _translateToTex
-        """
-        #self._translateToTex() # could be reworked to do this
-        if "\n" in self.contents:
-            self.eqstring = "\\begin{equation*}\n%s\n\\end{equation*}" % self.contents
-        elif "\\frac" in self.contents:
-            self.eqstring = "\\begin{equation*}\n%s\n\\end{equation*}" % self.contents
-        elif "\\begin\{array" in self.contents:
-            self.eqstring = "\\begin{equation*}\n%s\n\\end{equation*}" % self.contents
-        else:
-            self.eqstring = "$\\textstyle %s$" % self.contents
-        self._sanitize()
-
-        # generate the temp file and write out the tex
-        (fd, self.texfile) = tempfile.mkstemp(suffix='.tex', prefix='eqn_', dir=self.tmpdir, text=True)
-        self._logger.info("Generating tex file '%s')" % self.texfile)
-        handle = os.fdopen(fd, 'w+')
-        handle.write(PREAMBLE)
-        handle.write(self.eqstring)
-        handle.write("\n \\end{document}\n")
-        handle.close()
-
-    def _translateToTex(self):
-        """
-        Translates the HTML into equivalent latex.
-        FIXME: This is getting a little unwieldly
-        
-        Calls _sanitize
-        """
-        if self.contents.name == 'span':
-            if self.contents.attrs[0][1] == 'eq':
-                self.eqstring = "$ %s $ \\newpage" % self.contents.string.strip()
-                self._sanitize()
-            elif self.contents.attrs[0][1] == 'det':
-                self.eqstring = "\\begin{equation*} \\left| \\begin{matrix} %s \\end{matrix} \\right| \\end{equation*}" % \
-                    self.contents.string.strip()
-            elif self.contents.attrs[0][1] == 'matrix':
-                self.eqstring = "\\begin{equation*} \\left[ \\begin{matrix} %s \\end{matrix} \\right] \\end{equation*}" % \
-                    self.contents.string.strip()
-            elif self._debug:
-                assert False, 'Unhandled span:  %s at %s' % (self.eqstring)
-        elif self.contents.name == 'div':
-            if self.contents.attrs[0][1] == 'matrix':
-                self.eqstring = "\\begin{equation*} \\left[ \\begin{matrix} %s \\end{matrix} \\right] \\end{equation*}" % \
-                    self.contents.string.strip()
-            elif self.contents.attrs[0][1] == 'det':
-                self.eqstring = "\\begin{equation*} \\left| \\begin{matrix} %s \\end{matrix} \\right| \\end{equation*}" % \
-                    self.contents.string.strip()
-            elif self.contents.attrs[0][1] == 'alignedeq':
-                self.eqstring = "\\begin{align*} %s \\end{align*}" % \
-                    self.contents.string.strip()
-            elif self.contents.attrs[0][1] == 'numalignedeq':
-                self.eqstring = "\\begin{align} %s \\end{align}" % \
-                    self.contents.string.strip()
-            elif self.contents.attrs[0][1] == 'numeq':
-                self.eqstring = "\\begin{equation} %s \\end{equation}" % \
-                    self.contents.string.strip()
-            else:
-                self.eqstring = "\\begin{equation*} %s \\end{equation*}" % \
-                    self.contents.string.strip()
-            self._sanitize()
-
-    def _sanitize(self):
-        """
-        Removes potentially dangerous latex code, replacing it with
-        a 'LaTeX sanitized' message
-        """
-        # fix bad percent signs
-        if '%' in self.eqstring:
-            if self.eqstring[0] == '%':
-                self.eqstring = "\\" + self.eqstring
-            index = self.eqstring.find('%', 1)
-            while index > 0:
-                if self.eqstring[index-1] == "\\": # it is already escaped
-                    index = self.eqstring.find('%', index+1)
-                else:
-                    print "automatically fixing un-escaped percent signs"
-                    self.eqstring = self.eqstring[:index] + "\\" + self.eqstring[index:]
-                    index = self.eqstring.find('%', index+2) # added a character
-
-        # fix prime
-        if "'" in self.eqstring:
-            print "automatically fixing prime characters"
-            self.eqstring = self.eqstring.replace("'", "\prime")
-
-        # turn everything else bad to junky mbox
-        lowercase = self.eqstring.lower()
-        for tag in bad_tags:
-            if tag in lowercase:
-                self.eqstring = "$ \\mbox{\\LaTeX sanitized} $ \\newpage"
-        return 
-
-
-    def _compileDVI(self):
-        """
-        Compiles the Tex file into a DVI.  If there's an error, raise it.
-        """
-        self._logger.info("Generating dvi file")
-        if self._latex is None:
-            raise RuntimeError("Failed to specify latex executable")
-        if not os.path.exists(self._latex):
-            raise RuntimeError("latex executable ('%s') does not exist" % self._latex)
-
-        # run latex
-        cmd = [self._latex, self.texfile]
-        self._logger.debug("cmd: '%s'" % " ".join(cmd))
-        proc = subprocess.Popen(cmd, cwd=self.tmpdir,
-                                stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-        output = proc.communicate()[0]
-        retcode = proc.wait()
-        if retcode != 0:
-            print ' '.join(cmd)
-            print output
-            print 'RAW EQUATION "%s"' % self.contents
-            print 'TEX EQUATION "%s"' % self.eqstring
-            raise RuntimeError("'%s' returned %d" % (" ".join(cmd), retcode))
-
-        # names of generated files
-	self.dvifile=self.texfile[:-3]+'dvi'
-        auxfile = self.texfile[:-3] + 'aux'
-        logfile = self.texfile[:-3] + 'log'
-
-        # verify the dvi file exists
-        if not os.path.exists(self.dvifile):
-            print ' '.join(cmd)
-            print output
-            print 'RAW EQUATION "%s"' % self.contents
-            print 'TEX EQUATION "%s"' % self.eqstring
-            raise RuntimeError("Failed to create dvi file '%s'" % self.dvifile)
-
-	#Open the log file and see if anything went wrong
-	handle=open(logfile)
-	for line in handle:
-		if line[0]=="!":
-			raise SyntaxError(line)
-	handle.close()
-
-        # register files to delete
-        self._filestodelete.append(self.texfile)
-        self._filestodelete.append(auxfile)
-        self._filestodelete.append(logfile)
-
-    def _createPNG(self):
-        """
-        Runs dvipng on the DVI file.
-        Encodes the original latex as an HTML comment.
-        """
-        self._logger.info("Generating png file")
-        if self._dvipng is None:
-            raise RuntimeError("Failed to specify dvipng executable")
-        if not os.path.exists(self._dvipng):
-            raise RuntimeError("dvipng executable ('%s') does not exist" % self._dvipng)
-
-        # this command works on RHEL6
-        cmd = [self._dvipng, '-Ttight','-D120','-z9','-bg Transparent','--strict',
-                '-o%s' % self.pngfile,
-                self.dvifile]
-        self._logger.debug("cmd: '%s'" % " ".join(cmd))
-        proc = subprocess.Popen(cmd, cwd=self.tmpdir, #shell=True,
-                                stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-        output = proc.communicate()[0]
-        retcode = proc.wait()
-        if retcode != 0:
-            print ' '.join(cmd)
-            print output
-            raise RuntimeError("'%s' returned %d" % (" ".join(cmd), retcode))
-
-        # verify the png file exists
-        if not os.path.exists(self.pngfile):
-            print ' '.join(cmd)
-            print output
-            raise RuntimeError("Failed to create png file '%s'" % self.pngfile)
-
-        # register files to delete
-        self._filestodelete.append(self.dvifile)
-
-if __name__ == "__main__":
-    import sys
-    infile = sys.argv[1]
-    outfile = infile + ".new"
-    print infile, "->", outfile
-
-    #logging.basicConfig(level=logging.DEBUG)
-
-    text = file(infile,'r').read()
-
-    start = 0
-    while start >= 0:
-        start = text.find("<math>", start)
-        if start < 0:
-            break
-        stop = text.find("</math>", start)
-        if stop < start:
-            break
-        orig = text[start+6:stop]
-        start = stop
-        eqn = Equation(orig)
-        text = text.replace("<math>" + orig + "</math>", eqn.contentshtml)
-
-    print "******************************"
-    handle = open(outfile, 'w')
-    handle.write(text)
-    handle.close()
-    
diff --git a/Code/Mantid/docs/qtassistant/fetchimg.py b/Code/Mantid/docs/qtassistant/fetchimg.py
deleted file mode 100644
index 047838192579b38644ab0bae25485334e2a9ade4..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/fetchimg.py
+++ /dev/null
@@ -1,94 +0,0 @@
-import logging
-import os
-import re
-import urllib
-
-WIKI_BASE_URL = "http://www.mantidproject.org"
-DOWN_BASE_URL = "http://download.mantidproject.org/"
-ALGO_BASE_URL = DOWN_BASE_URL + "algorithm_screenshots/ScreenShotImages"
-
-def wiki_fig_key(stuff):
-    filename = os.path.split(stuff)[-1]
-    # aaa will come first for things that aren't thumbnails
-    prefix = "aaa/"
-    # thumnails are bad
-    if stuff.startswith('/images/thumb/'):
-        prefix = "zzz/"
-        index = filename.find('px-')
-        if index > 0:
-            resolution = int(filename[:index])
-            filename = filename[index+3:]
-        else:
-            resolution = 0
-        prefix += "%06d/" % resolution
-    stuff = prefix + filename
-    #print stuff
-    return stuff
-
-class Fetcher:
-    def __init__(self, filename, shrinkname=True):
-        self._logger = logging.getLogger(__name__+'.'+self.__class__.__name__)
-        self.filename = filename
-        shortfilename = str(os.path.split(self.filename)[-1])
-        if shrinkname:
-            self.filename = shortfilename
-        self._logger.info(self.filename)
-
-        # download wiki page name
-        url = WIKI_BASE_URL + "/File:" + self.filename
-        handle = urllib.urlopen(url)
-        text = handle.read()
-        handle.close()
-        text_len = len(text)
-
-        candidates = []
-
-        # find the location of the file from the image tags
-        candidates.extend(self._getWikiCandidates(shortfilename, text, "<img alt=", "/>"))
-
-        # find the location of the file from the image tags
-        candidates.extend(self._getWikiCandidates(shortfilename, text, '<a href="/images/', '">'))
-
-        # sort them according to favorites and remove duplicates
-        candidates = list(set(candidates))
-        candidates.sort(key=wiki_fig_key)
-        self._logger.info("candidates:" + str(candidates))
-
-        # always choose the first one
-        if len(candidates) <= 0:
-            raise RuntimeError("Failed to find any candidates")
-        rel_link = candidates[0]
-        self._logger.debug("rel_link = '%s'" % rel_link)
-        self.url = WIKI_BASE_URL + rel_link
-
-    def _getWikiCandidates(self, shortname, text, starttag, endtag):
-        candidates = []
-        text_len = len(text)
-        index = 0
-        while index >= 0 and index < text_len:
-            index = text.find(starttag, index)
-            end = text.find(endtag, index)
-            self._logger.debug("indices: %d to %d" % (index, end))
-            if end < index or index < 0:
-                break
-            stuff = text[index:end]
-            index = end
-            self._logger.debug(stuff)
-            #if not shortfilename in stuff:
-            #    continue
-            attrs = stuff.split()
-            for attr in attrs:
-                if '/images/' in attr:
-                    rel_link = attr.split('=')[-1][1:]
-                    if rel_link.endswith('"') or rel_link.endswith("'"):
-                        rel_link = rel_link[:-1]
-                    if not "archive" in rel_link:
-                        if not rel_link.startswith('/images/thumb'):
-                            candidates.append(rel_link)
-        return candidates
-        
-
-    def download(self, destdir):
-        destname = os.path.join(destdir, self.filename)
-        print "Downloading %s from %s" % (destname, self.url)
-        urllib.urlretrieve(self.url, filename=destname)
diff --git a/Code/Mantid/docs/qtassistant/fitfunctions_help.py b/Code/Mantid/docs/qtassistant/fitfunctions_help.py
deleted file mode 100644
index 0f72e180fb11546f20a28c476c907c9595017c5a..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/fitfunctions_help.py
+++ /dev/null
@@ -1,78 +0,0 @@
-from assistant_common import WEB_BASE, HTML_DIR, addEle, addTxtEle
-import os
-from htmlwriter import HtmlWriter
-import mantid.api
-from mediawiki import MediaWiki
-import wiki_tools
-from xml.dom.minidom import Document
-from parseLinks import fixLinks
-from fixQuotes import fixQuotes
-
-def propToList(func, number):
-    #htmlfile.writeRow(["Order", "Name", "Default", "Description"], True)
-    # order
-    result = [str(number+1)]
-    # name
-    result.append(func.getParamName(number))
-    # default
-    default = func.getParamValue(number)
-    result.append(str(default))
-    # description
-    text = func.getParamDescr(number)
-    if len(text) <= 0:
-        text = "&nbsp;"
-    else:
-        text = text.replace("\n", "<br/>")
-    text=fixQuotes(text)
-    #fix links
-    fixer=fixLinks(text)
-    text = fixer.parse()
-    result.append(text)
-    return result
-
-def process_function(name, qhp, outputdir, **kwargs): # was (args, algo):
-    outfile = "FitFunc_%s.html" % name
-    qhp.addFile(os.path.join(HTML_DIR, outfile), name)
-
-    func = mantid.api.FunctionFactory.createFunction(name)
-    #print "***", func, dir(func)
-
-    htmlfile = HtmlWriter(os.path.join(outputdir, outfile), name)
-    htmlfile.openTag("center")
-    htmlfile.h1(name + " Fit Function", newline=False)
-    htmlfile.closeTag(True)
-
-    htmlfile.openTag("p")
-    htmlfile.link("wiki help", WEB_BASE+name)
-    htmlfile.closeTag(True)
-    htmlfile.nl()
-    htmlfile.hr()
-
-    htmlfile.h3("Summary")
-    wiki = MediaWiki(htmlfile, HTML_DIR, latex=kwargs["latex"], dvipng=kwargs["dvipng"])
-    wiki.parse(wiki_tools.get_fitfunc_summary(name, False), qhp)
-
-    if func.numParams() <= 0:
-        htmlfile.h3("No Parameters")
-    else:
-        htmlfile.h3("Parameters")
-        htmlfile.openTag("table", {"border":"1", "cellpadding":"5", "cellspacing":"0"})
-        htmlfile.writeRow(["Order", "Name", "Default", "Description"], True)
-        for i in range(func.numParams()):
-            htmlfile.writeRow(propToList(func, i))#[str(i+1), '&nbsp;', '&nbsp;', '&nbsp;'])
-        htmlfile.closeTag(True) # close the table
-
-    htmlfile.hr()
-    cats = func.categories()
-    if len(cats):
-        htmlfile.openTag("p")
-        htmlfile.write("Categories: ")
-        for category in cats:
-            ref = "fitfunctions_index.html#%s" % (category)
-            htmlfile.write("<a href='%s'>%s</a>" % (ref, category))
-        htmlfile.nl()
-
-    # cleanup the file
-    htmlfile.closeTag(True)
-    htmlfile.closeTag(True)
-    htmlfile.closeTag(True)
diff --git a/Code/Mantid/docs/qtassistant/fixQuotes.py b/Code/Mantid/docs/qtassistant/fixQuotes.py
deleted file mode 100644
index 56c3f4ef8ddfda6ba23528209ba208093cf0e3c2..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/fixQuotes.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import re
-
-def fixQuotes(text):
-  text=fixBoldItalic(text)
-  text=fixBold(text)
-  text=fixItalic(text)
-  return text
-  
-def fixBoldItalic(text):
-  results=re.findall(r"\'\'\'\'\'(.+?)\'\'\'\'\'",text)
-  for item in results:
-    text = text.replace("'''''"+item+"'''''", "<b><i>"+item+"</i></b>")
-  return text
-  
-def fixBold(text):
-  results=re.findall(r"\'\'\'(.+?)\'\'\'",text)
-  for item in results:
-    text = text.replace("'''"+item+"'''", "<b>"+item+"</b>")
-  return text
-  
-def fixItalic(text):
-  results=re.findall(r"\'\'(.+?)\'\'",text)
-  for item in results:
-    text = text.replace("''"+item+"''", "<i>"+item+"</i>")
-  return text
diff --git a/Code/Mantid/docs/qtassistant/htmlwriter.py b/Code/Mantid/docs/qtassistant/htmlwriter.py
deleted file mode 100644
index 1618f8b4081665fc0917288c1303fb674d2c5bea..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/htmlwriter.py
+++ /dev/null
@@ -1,80 +0,0 @@
-class HtmlWriter:
-    def __init__(self, filename, title=None):
-        self.name = filename
-        self.__handle = open(filename, 'w')
-        self.__tagstack = []
-        self.openTag("html")
-        if title is not None:
-            self.nl()
-            self.openTag("head")
-            self.openTag("title")
-            self.write(title)
-            self.closeTag()
-            self.closeTag()
-        self.nl()
-        self.openTag("body")
-
-    def write(self, text):
-        self.__handle.write(text)
-
-    def nl(self):
-        """Write out a new line"""
-        self.write("\n" + (len(self.__tagstack)*"  "))
-
-    def emptyTag(self, tag, attrs={}, newline=False):
-        self.write("<" + tag)
-        for key in attrs.keys():
-            self.write(" " + key + "=\"" + attrs[key] + "\"")
-        self.write("/>")
-        if newline:
-            self.nl()
-
-    def openTag(self, tag, attrs={}):
-        self.__tagstack.append(tag)
-        self.write("<" + tag)
-        for key in attrs.keys():
-            self.write(" " + key + "=\"" + attrs[key] + "\"")
-        self.write(">")
-
-    def closeTag(self, newline=False):
-        tag = self.__tagstack.pop()
-        self.write("</" + tag + ">")
-        if newline:
-            self.nl()
-
-    def addTxtEle(self, tag, text, attrs={}, newline=False):
-        self.openTag(tag, attrs)
-        self.write(text)
-        self.closeTag(newline)
-
-    def hr(self):
-        self.emptyTag("hr", newline=True)
-
-    def h1(self, text, newline=True):
-        self.addTxtEle("h1", text, newline=newline)
-
-    def h2(self, text, newline=True):
-        self.addTxtEle("h2", text, newline=newline)
-
-    def h3(self, text, newline=True):
-        self.addTxtEle("h3", text, newline=newline)
-
-    def link(self, text, href):
-        self.openTag("a", {"href":href})
-        self.write(text)
-        self.closeTag()
-
-    def writeRow(self, cells, header=False):
-        tag = "td"
-        if header:
-            tag = "th"
-
-        self.openTag("tr")
-        for cell in cells:
-            self.openTag(tag)
-            self.write(cell)
-            self.closeTag()
-        self.closeTag(True)
-
-    def p(self, text, newline=True):
-        self.addTxtEle("p", text, newline=newline)
diff --git a/Code/Mantid/docs/qtassistant/make_algorithms_help.py b/Code/Mantid/docs/qtassistant/make_algorithms_help.py
deleted file mode 100755
index c2e6d86ff41eecfd8923867a61d3488416643330..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/make_algorithms_help.py
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/usr/bin/env python
-from xml.dom.minidom import Document
-import os
-from qhpfile import QHPFile
-from string import split,join
-import sys
-from assistant_common import *
-
-def addWikiDir(helpsrcdir):
-    """
-    Add the location of the wiki tools to the python path.
-    """
-    wikitoolsloc = os.path.join(helpsrcdir, "../../Build")
-    wikitoolsloc = os.path.abspath(wikitoolsloc)
-    sys.path.append(wikitoolsloc)
-
-def addLetterIndex(doc, div, letters):
-    para = addEle(doc, "p", div)
-    for letter in map(chr, range(65, 91)):
-        if letter in letters:
-            addTxtEle(doc, "a", letter, para, {"href":'#algo%s' % letter})
-            text = doc.createTextNode(" ")
-            para.appendChild(text)
-        else:
-            text = doc.createTextNode(letter+" ")
-            para.appendChild(text)
-
-
-def appendCatElement(doc, ul, category):
-    category = category.split('/')
-    filename = 'AlgoCat_' + category[0] + '.html'
-    url = filename
-    
-    li = addEle(doc, "li", ul)
-
-    if len(category) > 1:
-        text = '/'.join(category[:-1]) + '/'
-        url += '#' + '_'.join(category[1:])
-        text = doc.createTextNode(text)
-        li.appendChild(text)
-    addTxtEle(doc, "a", category[-1], li, {"href":url})
-
-def appendAlgoElement(doc, ul, name, versions):
-    li = addEle(doc, "li", ul)
-    writeVersions = True
-    try:
-        url = 'Algo_%s.html' % (name)
-        text = "%s v%d" % (name, versions[-1])
-    except TypeError, e:
-        if versions.startswith("ALIAS:"):
-            (temp, real) = versions.split(":")
-            text = name
-            url = 'Algo_%s.html' % (real)
-            writeVersions = False
-        else:
-            raise e
-    addTxtEle(doc, "a", text, li, {'href':url})
-
-    if writeVersions and len(versions) > 1:
-        text = ''
-        text += ', ' + ', '.join(['v'+str(version) for version in versions[:-1]])
-        text = doc.createTextNode(text)
-        li.appendChild(text)
-
-def processCategories(categories, qhp, outputdir):
-    # determine the list of html pages
-    grouped_categories = {}
-    for key in categories.keys():
-        shortkey = key.split('/')[0]
-        if not shortkey in grouped_categories:
-            grouped_categories[shortkey] = []
-        grouped_categories[shortkey].append(key)
-    pages = grouped_categories.keys()
-    pages.sort()
-
-    for page_name in pages:
-        doc = Document()
-        root = addEle(doc, "html", doc)
-        head = addEle(doc, "head", root)
-        addTxtEle(doc, "title", page_name + " Algorithm Category", head)
-        body = addEle(doc, "body", root)
-        temp = addEle(doc, "center", body)
-        addTxtEle(doc, "h1", page_name, temp)
-
-        subcategories = grouped_categories[page_name]
-        subcategories.sort()
-        for subcategory in subcategories:
-            anchor = subcategory.split('/')
-            anchor = '_'.join(anchor[1:])
-            addTxtEle(doc, "h2", subcategory, body)
-            addEle(doc, 'a', body, {"name":anchor})
-            ul = addEle(doc, "ul", body)
-            for (name, versions) in categories[subcategory]:
-                appendAlgoElement(doc, ul, name, versions)
-
-        filename = "AlgoCat_%s.html" % page_name
-        qhp.addFile(os.path.join(HTML_DIR, filename), page_name)
-        filename = os.path.join(outputdir, filename)
-        handle = open(filename, 'w')
-        handle.write(doc.toxml(encoding="utf-8"))
-
-def process(algos, qhp, outputdir, options):
-    import mantid
-
-    # sort algorithms into categories
-    categories = {}
-    for name in algos.keys():
-        versions = algos[name]
-
-        alg = mantid.AlgorithmManager.create(name, versions[-1])
-        alias = alg.alias().strip()
-        alg_categories = alg.categories()
-        try:
-            alg_categories = alg_categories.split(';')
-        except AttributeError, e:
-            pass # the categories are already a list
-        for category in alg_categories:
-            category = category.replace('\\', '/')
-            if not categories.has_key(category):
-                categories[category] = []
-            categories[category].append((name, versions))
-            if len(alias) > 0:
-                categories[category].append((alias, "ALIAS:"+name))
-    categories_list = categories.keys()
-    categories_list.sort()
-
-    # sort algorithms into letter based groups
-    letter_groups = {}
-    for name in algos.keys():
-        versions = algos[name]
-        letter = str(name)[0].upper()
-        if not letter_groups.has_key(letter):
-            letter_groups[letter] = []
-        letter_groups[letter].append((str(name), versions))
-
-        # add in the alias
-        alias = mantid.AlgorithmManager.create(name, versions[-1]).alias().strip()
-        if len(alias) > 0:
-            letter = str(name)[0].upper()
-            if not letter_groups.has_key(letter):
-                letter_groups[letter] = []
-            letter_groups[letter].append((alias, "ALIAS:"+name))
-
-    ##### put together the top of the html document
-    doc = Document()
-    root = addEle(doc, "html", doc)
-    head = addEle(doc, "head", root)
-    addTxtEle(doc, "title", "Algorithms Index", head)
-    body = addEle(doc, "body", root)
-    temp = addEle(doc, "center", body)
-    addTxtEle(doc, "h1", "Algorithms Index", temp)
-
-    ##### section for categories 
-    div_cat = addEle(doc, "div", body, {"id":"alg_cats"})
-    addTxtEle(doc, "h2", "Subcategories", div_cat)
-    above = None
-    ul = addEle(doc, "ul", div_cat)
-    for category in categories_list:
-        appendCatElement(doc, ul, category)
-
-    ##### section for alphabetical 
-    div_alpha = addEle(doc, "div", body, {"id":"alg_alpha"})
-    addTxtEle(doc, "h2", "Alphabetical", div_alpha)
-
-    letters = letter_groups.keys()
-    letters.sort()
-
-    # print an index within the page
-    addLetterIndex(doc, div_alpha, letters)
-
-    # print the list of algorithms by name
-    for letter in letters:
-        addTxtEle(doc, 'h3', letter, div_alpha)
-        addEle(doc, 'a', div_alpha, {"name":'algo'+letter})
-        ul = addEle(doc, "ul", div_alpha)
-        group = letter_groups[letter]
-        group.sort()
-        for (name, versions) in group:
-            appendAlgoElement(doc, ul, name, versions)
-
-    # print an index within the page
-    addLetterIndex(doc, div_alpha, letters)
-
-    filename = os.path.join(outputdir, "algorithms_index.html")
-    handle = open(filename, 'w')
-    handle.write(doc.toxml(encoding="utf-8"))
-
-    shortname = os.path.split(filename)[1]
-    qhp.addFile(os.path.join(HTML_DIR, shortname), "Algorithms Index")
-
-    # create all of the category pages
-    processCategories(categories, qhp, outputdir)
-
-    # create individual html pages
-    from algorithm_help import process_algorithm
-    for name in algos.keys():
-        versions = algos[name]
-        process_algorithm(name, versions, qhp, outputdir, latex=options.latex, dvipng=options.dvipng, fetchimages=options.fetchimages)
-
-if __name__ == "__main__":
-    parser = getParser("Generate qtassistant docs for the algorithms")
-    parser.add_option("-g", '--getimages', help="Download algorithm dialog images", default=False, action="store_true", dest="fetchimages")
-    (options, args) = parser.parse_args()
-
-    # where to put the generated files
-    helpsrcdir = os.path.dirname(os.path.abspath(__file__))
-    if options.helpoutdir is not None:
-        helpoutdir = os.path.abspath(options.helpoutdir)
-    else:
-        raise RuntimeError("need to specify output directory")
-    print "Writing algorithm web pages to '%s'" % helpoutdir
-    assertDirs(helpoutdir)
-    addWikiDir(helpsrcdir)
-
-    # initialize mantid
-    sys.path.insert(0, options.mantidpath)
-    os.environ['MANTIDPATH'] = options.mantidpath
-    import mantid.api
-    algos = mantid.api.AlgorithmFactory.getRegisteredAlgorithms(True)
-
-    # setup the qhp file
-    qhp = QHPFile("org.mantidproject.algorithms")
-
-    process(algos, qhp, os.path.join(helpoutdir, HTML_DIR), options)
-    qhp.write(os.path.join(helpoutdir, "algorithms.qhp"))
diff --git a/Code/Mantid/docs/qtassistant/make_fitfunctions_help.py b/Code/Mantid/docs/qtassistant/make_fitfunctions_help.py
deleted file mode 100755
index 8bf303b44389c7e2e8bb216d62012f6338cadc70..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/make_fitfunctions_help.py
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env python
-from xml.dom.minidom import Document
-import os
-from qhpfile import QHPFile
-from string import split,join
-import sys
-from assistant_common import *
-
-def addWikiDir(helpsrcdir):
-    """
-    Add the location of the wiki tools to the python path.
-    """
-    wikitoolsloc = os.path.join(helpsrcdir, "../../Build")
-    wikitoolsloc = os.path.abspath(wikitoolsloc)
-    sys.path.append(wikitoolsloc)
-
-def appendFuncElement(doc, div, name):
-    li = addEle(doc, "li", div)
-    addTxtEle(doc, "a", name, li, {"href":"FitFunc_%s.html" % name})
-
-def process(functions, qhp, outputdir, options):
-    import mantid.api
-
-    # sort fit functions into categories
-    categories = {}
-    for name in functions:
-        func = mantid.api.FunctionFactory.createFunction(name)
-        for category in func.categories():
-            category = category.replace('\\', '/')
-            if not categories.has_key(category):
-                categories[category] = []
-            categories[category].append(name)
-    categories_list = categories.keys()
-    categories_list.sort()
-
-    ##### put together the top of the html document
-    doc = Document()
-    root = addEle(doc, "html", doc)
-    head = addEle(doc, "head", root)
-    addTxtEle(doc, "title", "Fit Functions Index", head)
-    body = addEle(doc, "body", root)
-    temp = addEle(doc, "center", body)
-    addTxtEle(doc, "h1", "Fit Functions Index", temp)
-
-    ##### section for categories 
-    div_cat = addEle(doc, "div", body, {"id":"function_cats"})
-    for category in categories_list:
-        addTxtEle(doc, "h2", category + " Category", div_cat)
-        addEle(doc, "a", div_cat, {"name":category})
-        ul = addEle(doc, "ul", div_cat)
-        funcs = categories[category]
-        for func in funcs:
-            appendFuncElement(doc, ul, func)
-
-    filename = os.path.join(outputdir, "fitfunctions_index.html")
-    handle = open(filename, 'w')
-    handle.write(doc.toprettyxml(indent="  ", encoding="utf-8"))
-
-    shortname = os.path.split(filename)[1]
-    qhp.addFile(os.path.join(HTML_DIR, shortname), "Fit Functions Index")
-
-    # create individual html pages
-    from fitfunctions_help import process_function
-    for func in functions:
-        process_function(func, qhp, outputdir, latex=options.latex, dvipng=options.dvipng)
-
-if __name__ == "__main__":
-    parser = getParser("Generate qtassistant docs for the fit functions")
-    (options, args) = parser.parse_args()
-
-    # where to put the generated files
-    helpsrcdir = os.path.dirname(os.path.abspath(__file__))
-    if options.helpoutdir is not None:
-        helpoutdir = os.path.abspath(options.helpoutdir)
-    else:
-        raise RuntimeError("need to specify output directory")
-    print "Writing fit function web pages to '%s'" % helpoutdir
-    assertDirs(helpoutdir)
-    addWikiDir(helpsrcdir)
-
-    # initialize mantid
-    sys.path.insert(0, options.mantidpath)
-    os.environ['MANTIDPATH'] = options.mantidpath
-    import mantid.api
-    functions = mantid.api.FunctionFactory.getFunctionNames()
-
-    # setup the qhp file
-    qhp = QHPFile("org.mantidproject.fitfunctions")
-
-    process(functions, qhp, os.path.join(helpoutdir, HTML_DIR), options)
-    qhp.write(os.path.join(helpoutdir, "fitfunctions.qhp"))
diff --git a/Code/Mantid/docs/qtassistant/mantid.qhcp b/Code/Mantid/docs/qtassistant/mantid.qhcp
deleted file mode 100644
index 431389545453b1bdc5790297451377a4f0319744..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/mantid.qhcp
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<QHelpCollectionProject version="1.0">
-     <assistant>
-         <title>Mantid Help</title>
-         <startPage>qthelp://org.mantidproject/doc/html/index.html</startPage>
-         <homePage>qthelp://org.mantidproject/doc/html/index.html</homePage>
-         <applicationIcon>src/images/MantidPlot_Icon_32offset.png</applicationIcon>
-         <enableFilterFunctionality>true</enableFilterFunctionality>
-         <enableDocumentationManager>true</enableDocumentationManager>
-         <enableAddressBar visible="false">true</enableAddressBar>
-         <cacheDirectory>mantidproject</cacheDirectory>
-         <aboutMenuText>
-             <text>About Mantid</text>
-         </aboutMenuText>
-         <aboutDialog>
-             <file>about.txt</file>
-             <icon>src/images/Mantid_Logo_Transparent.png</icon>
-         </aboutDialog>
-     </assistant>
-     <docFiles>
-         <generate>
-             <file>
-                 <input>mantidgeneral.qhp</input>
-                 <output>qch/mantidgeneral.qch</output>
-             </file>
-             <file>
-                 <input>algorithms.qhp</input>
-                 <output>qch/algorithms.qch</output>
-             </file>
-             <file>
-                 <input>fitfunctions.qhp</input>
-                 <output>qch/fitfunctions.qch</output>
-             </file>
-         </generate>
-         <register>
-             <file>qch/mantidgeneral.qch</file>
-             <file>qch/algorithms.qch</file>
-             <file>qch/fitfunctions.qch</file>
-         </register>
-     </docFiles>
-</QHelpCollectionProject>
diff --git a/Code/Mantid/docs/qtassistant/mediawiki.py b/Code/Mantid/docs/qtassistant/mediawiki.py
deleted file mode 100644
index 9435fa555f54a74867716b61498ef9d9b5c7dea7..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/mediawiki.py
+++ /dev/null
@@ -1,309 +0,0 @@
-from assistant_common import WEB_BASE, HTML_DIR, addEle, addTxtEle
-from eqnparser import Equation
-import os
-import re
-from parseLinks import fixLinks
-from fixQuotes import fixQuotes
-
-IMG_NOT_FOUND = "ImageNotFound.png"
-
-def formatImgHtml(raw):
-    #print "RAW:", raw
-
-    # cleanup the tag from the text
-    index = raw.index(':') # look for first ':'
-    if index < 0:
-        index = 0
-    else:
-        index += 1
-    raw = raw[index:-2]
-    
-    #print "RAW:", raw
-
-    # chop tag into something more workable
-    components = raw.split('|')
-    img = components[0] # image filename is always first
-    #print "IMG:", img
-
-    # get the other bits of meta-data
-    align = None
-    alt = None
-    caption = None
-    width = None
-    height = None
-    for item in components[1:]:
-        item_low = item.lower()
-        if item_low == "thumb":
-            pass
-        elif item.endswith('px'):
-            item = item[:-2]
-            if item.startswith('x'):
-                height = int(item[1:])
-            elif 'x' in item:
-                (width, height) = item.split('x')
-                width = int(width)
-                height = int(height)
-            else:
-                width = int(item)
-        elif item_low == "right" or item_low == "center" or item_low == "left":
-            align = item_low
-        elif item_low.startswith("alt"):
-            alt = '='.join(item.split('=')[1:])
-        else:
-            caption = item
-
-    fullname = os.path.abspath(os.path.join(os.path.curdir, 'qtassistant', 'html', 'img', img))
-    if not os.path.exists(fullname):
-        print "Did not find image '%s' setting to '%s'" % (fullname, IMG_NOT_FOUND)
-        if caption is None:
-            caption = "Missing image: %s" % img
-        else:
-            caption += "\nMissing image: %s" % img
-        img = IMG_NOT_FOUND
-
-    html = "<figure>"
-    html += "<img src='img/" + img + "'"
-    if alt is not None:
-        html += " alt='%s'" % alt
-    if align is not None:
-        html += " align='%s'" % align
-    if width is not None:
-        html += " width='%d'" % width
-    if height is not None:
-        html += " height='%d'" % height
-    html += "/>"
-    if caption is not None:
-        html += "\n<figcaption>%s</figcaption>\n" % caption
-    html += "</figure>\n"
-    #print "HTML:", html
-    return (img, html)
-
-class MediaWiki:
-    def __init__(self, htmlfile, direc, **kwargs):
-        self.__file = htmlfile
-        self.__direc = direc
-        self.__types = []
-        self.images = []
-        self.__latex= kwargs["latex"]
-        self.__dvipng = kwargs["dvipng"]
-
-    def __parseImgs(self, text):
-        # Get all of the raw image links
-        raw_img = re.findall(r'\[\[Image:.*\]\]', text, flags=re.MULTILINE)
-        raw = re.findall(r'\[\[File:.*\]\]', text, flags=re.MULTILINE)
-        raw.extend(raw_img)
-
-        # generate the html
-        html = []
-        for src in raw:
-            (imagefile, newtxt) = formatImgHtml(src)
-            self.images.append(imagefile)
-            #print "IM2:", imagefile, len(self.images)
-            html.append(newtxt)
-
-        for (orig, repl) in zip(raw, html):
-            #print ">>>", orig
-            #print "<<<", repl
-            text = text.replace(orig, repl)
-
-        return text.strip()
-
-    def __parseEqns(self, text):
-        if self.__latex is None:
-            print "Failed to find latex: not converting equations to png"
-            return text
-
-        if self.__dvipng is None:
-            print "Failed to find dvipng: not converting equations to png"
-            return text
-
-        # find all of the possible equations
-        start = 0
-        htmlroot = os.path.split(self.__file.name)[0]
-        outdir = os.path.join(htmlroot, "img")
-        while start >= 0:
-            start = text.find("<math>", start)
-            if start < 0:
-                break
-            stop = text.find("</math>", start)
-            if stop < start:
-                break
-            orig = text[start+6:stop]
-            start += 1
-            eqn = Equation(orig, outdir=outdir, tmpdir=outdir,
-                                     latex=self.__latex, dvipng=self.__dvipng)
-            text = text.replace("<math>" + orig + "</math>", eqn.contentshtml)
-            self.images.append(os.path.split(eqn.pngfile)[-1])
-        return text
-
-    def __clearEmpty(self, text):
-        result = []
-        for line in text.split("\n"):
-            if len(line.strip()) <= 0:
-                result.append("")
-            else:
-                result.append(line)
-        return "\n".join(result)
-        
-
-    def __fixUL(self, text):
-        if text.find('*') < 0:
-            return text # no candidates
-
-        # lines that start with a single '*'
-        starts = []
-        text = text.split("\n")
-
-        for (i, line) in zip(range(len(text)), text):
-            if line.strip().startswith("*") and not line.strip().startswith("**"):
-                starts.append(i)
-
-        # none of the stars were at the start of a line
-        if len(starts) <= 0:
-            return "\n".join(text)
-
-        # lines where the list item ends
-        text.append("")
-        stops = starts[:]
-        for i in range(len(starts)):
-            # next line is the next item
-            if starts[i]+1 <= len(starts) \
-                    and starts[i]+1 == starts[i+1]:
-                continue
-
-            # look for next blank line
-            index = text.index("", stops[i])
-            if index > stops[i]:
-                if i+1 < len(starts) and index < starts[i+1]:
-                    stops[i] = index
-
-        # compress each list item into a single line
-        starts.reverse()
-        stops.reverse()
-        for (start, stop) in zip(starts,stops):
-            if start == stop:
-                continue
-            #print "--->", start, "->", stop, "XXX".join(text[start:stop])
-            text[start] = " ".join(text[start:stop])
-            del text[start+1:stop]
-
-        del text[-1] # we added in a tiny bit of text
-        return "\n".join(text)
-
-    def __fixHEADERS(self, text):
-        results = re.findall(r'\s+==.*==\s+', text)
-        for item in results:
-            text = text.replace(item, "\n\n"+item.strip()+"\n\n")
-        results = re.findall(r'^=====.*=====$', text, flags=re.MULTILINE)
-        for item in results:
-            formatted = "<h4>" + item[5:-5] + "</h4>"
-            text = text.replace(item, formatted)
-        results = re.findall(r'^====.*====$', text, flags=re.MULTILINE)
-        for item in results:
-            formatted = "<h3>" + item[4:-4] + "</h3>"
-            text = text.replace(item, formatted)
-        results = re.findall(r'^===.*===$', text, flags=re.MULTILINE)
-        for item in results:
-            formatted = "<h2>" + item[3:-3] + "</h2>"
-            text = text.replace(item, formatted)
-        results = re.findall(r'^==.*==$', text, flags=re.MULTILINE)
-        for item in results:
-            formatted = "<h1>" + item[2:-2] + "</h1>"
-            text = text.replace(item, formatted)
-        return text
-
-    def __fixSource(self,text):
-        if re.findall('<source lang=".*?">',text)!=[]:
-            text=re.sub('<source lang="xml">','<pre>',text)
-            text=re.sub('<source lang="python">','<pre>',text)
-            text=re.sub('</source>','</pre>',text)
-        return text
-        
-    def __fixPre(self,text):
-        start = 0
-        while start >= 0:
-          start = text.find("<pre>", start)
-          if start < 0:
-            break
-          stop = text.find("</pre>", start)
-          if stop < start:
-            break
-          orig = text[start+5:stop]
-          start = stop
-          text = text.replace("<pre>" + orig + "</pre>", "<pre>"+orig.replace("<","&lt;").replace(">","&gt;")+"</pre>")
-        return text            
-
-    def __annotate(self, text):
-        for line in text:
-            stripped = line.strip()
-            if len(stripped) <= 0:
-                #self.__types.append(None)
-                self.__types.append("blank")
-            elif stripped.startswith('*'):
-                stuff = stripped.split()[0]
-                stuff = stuff.replace("*", "U")
-                stuff = stuff.replace("#", "O")
-                self.__types.append(stuff)
-            else:
-                self.__types.append(None)
-
-    def parse(self, text, qhp):
-        #print "00>>>", text, "<<<"
-        text = text.strip()
-        if len(text) <= 0:
-            return # don't bother if it is empty
-        text = self.__parseImgs(text)
-        text = self.__parseEqns(text)
-        #if len(self.images) > 0:
-        #    print "----->", self.images
-        for img in self.images:
-            img = os.path.join(self.__direc, "img", img)
-            qhp.addFile(img)
-        #print "01>>>", text, "<<<"
-        if text.startswith("== Deprecation notice =="):
-            stuff = "== Deprecation notice =="
-            text = text.replace(stuff, stuff+"\n")
-        #print "02>>>", text, "<<<"
-        text = self.__clearEmpty(text)
-        #print "03>>>", text, "<<<"
-        text = self.__fixHEADERS(text)
-        #print "04>>>", text, "<<<"
-        text = self.__fixSource(text)
-        text = self.__fixUL(text)
-        text = self.__fixPre(text)
-        
-        text=fixQuotes(text)
-
-        #fix links
-        fixer=fixLinks(text)
-        text = fixer.parse()
-        
-        text = text.split("\n")
-
-        self.__annotate(text)
-
-        self.__file.openTag('p')
-        list_stack = ""
-        num_lines = len(text)
-        for i in range(num_lines):
-            annotate = self.__types[i]
-            line = text[i]
-            if annotate is not None:
-                if annotate.startswith("U") or annotate.startswith("O"):
-                    if list_stack != annotate:
-                        self.__file.write("<ul>\n")  # TODO
-                        list_stack = annotate        # TODO
-                    line = ' '.join(line.split()[1:])
-                    line = "<li>"+line+"</li>" 
-                else:
-                    if len(list_stack) > 0:
-                        self.__file.write("</ul>\n") # TODO
-                    if annotate == "blank":
-                        if not text[i-1].startswith("<h"):
-                            self.__file.write("</p>\n")
-                        if i+1 < num_lines and not text[i+1].startswith("<h"):
-                            self.__file.write("<p>")
-                    else:
-                        self.__file.write(annotate)
-            self.__file.write(line + "\n")
-        self.__file.closeTag()
diff --git a/Code/Mantid/docs/qtassistant/parseLinks.py b/Code/Mantid/docs/qtassistant/parseLinks.py
deleted file mode 100644
index cbe6fb5a54b2a0cd608a8683816fdf625a7c0c24..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/parseLinks.py
+++ /dev/null
@@ -1,111 +0,0 @@
-import mantid,re,sys,os    
-from assistant_common import WEB_BASE
-
-class fixLinks:
-    def __init__(self,text): 
-        self.text=text
-        self.results = re.findall(r'\[\[(.*?)\]\]', text)
-        self.explicitLinks=re.findall(r'\[(.*?)\]', text)
-        wikilinksfile=open(os.path.split(sys.argv[0])[0]+'/WikiLinks.txt')
-        lines=wikilinksfile.readlines()
-        wikilinksfile.close()
-        self.wikilinks=[l.strip() for l in lines]
-        for l in lines:
-          if l.count("_")!=0:
-            self.wikilinks.append(l.replace("_","").strip())      
-        
-    def linkAlgorithms(self):
-        for item in self.results:
-          #check for |
-          if item.count("|")==1:
-              link,name=item.split("|")
-          else:
-              name=item
-              link=item    
-          if (link[0].upper()+link[1:]).split("#")[0] in mantid.AlgorithmFactory.getRegisteredAlgorithms(True).keys():
-            formatted="<a href=\"Algo_"+link+".html\">"+name+"</a>"
-            self.text=self.text.replace("[["+item+"]]",formatted)
-
-    def linkFitFunctions(self):
-        for item in self.results:
-          #check for |
-          if item.count("|")==1:
-              link,name=item.split("|")
-          else:
-              name=item
-              link=item
-          link=link.strip()  
-          if (link[0].upper()+link[1:]).split("#")[0] in mantid.FunctionFactory.getFunctionNames():
-            formatted="<a href=\"FitFunc_"+link+".html\">"+name+"</a>"
-            self.text=self.text.replace("[["+item+"]]",formatted)
-
-    def linkMantidWiki(self):
-        for item in self.results:
-          #check for |
-          if item.count("|")==1:
-              link,name=item.split("|")
-          else:
-              name=item
-              link=item
-          #split on #
-          linkPieces=link.split("#")
-          for i in range(len(linkPieces)):
-              linkPieces[i]=linkPieces[i].lstrip().rstrip().replace(' ','_')
-          linkPieces[0]=linkPieces[0][0].upper()+ linkPieces[0][1:] 
-          link="#".join(linkPieces)
-          if linkPieces[0] in self.wikilinks:
-              formatted="<a href=\""+WEB_BASE+link+"\">"+name+"</a>"
-              self.text=self.text.replace("[["+item+"]]",formatted)
-
-    def linkExplicit(self):
-        for item in self.explicitLinks:
-          if item.strip()[:4]=='http':
-              target=item.strip().split(' ')
-              if len(target)>1:
-                label=" ".join(target[1:])
-                link=target[0]
-              else:
-                label=item
-                link=item
-              formatted="<a href=\""+link+"\">"+label+"</a>"
-              self.text=self.text.replace("["+item+"]",formatted)
-              
-    def linkCategories(self):
-        for item in self.results:
-              #check for |
-          if item.count("|")==1:
-              link,name=item.split("|")
-          else:
-              name=item
-              link=item   
-          if link==":Category:Fit_functions":
-              formatted="<a href=\"fitfunctions_index.html\">"+name+"</a>"  
-              self.text=self.text.replace("[["+item+"]]",formatted) 
-          elif link==":Category:Algorithms":
-              formatted="<a href=\"algorithms_index.html\">"+name+"</a>"  
-              self.text=self.text.replace("[["+item+"]]",formatted)   
-          elif link.count("ategory:")==1:
-              linkpiece=link.split("ategory:")[1].strip(":")
-              formatted="<a href=\"AlgoCat_"+linkpiece+".html\">"+name+"</a>"  
-              self.text=self.text.replace("[["+item+"]]",formatted) 
-                
-    def linkMedia(self):
-        for item in self.results:
-          #check for |
-          if item.count("|")==1:
-              link,name=item.split("|")
-          else:
-              name=item
-              link=item  
-          if link.find('Media:')!=-1:
-              formatted= "<a href=\""+WEB_BASE+link.replace("Media:","File:").strip()+"\">"+name+"</a>"   
-              self.text=self.text.replace("[["+item+"]]",formatted)                                   
-      
-    def parse(self):
-        self.linkAlgorithms()
-        self.linkFitFunctions()
-        self.linkMantidWiki()
-        self.linkExplicit()
-        self.linkCategories()
-        self.linkMedia()
-        return self.text
diff --git a/Code/Mantid/docs/qtassistant/qhpfile.py b/Code/Mantid/docs/qtassistant/qhpfile.py
deleted file mode 100755
index 5e9ae93af592f28fc8b05a5f2417c1882466a900..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/qhpfile.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-from xml.dom.minidom import Document
-from assistant_common import addEle, addTxtEle
-
-class QHPFile:
-    def __init__(self, namespace, folder="doc", prettyxml=False, withImgNotFound=True):
-        self.__doc = Document()
-        self.__root = addEle(self.__doc,"QtHelpProject", self.__doc,
-                             {"version":"1.0"})
-        self.__prettyxml = prettyxml
-
-        addTxtEle(self.__doc, "namespace", namespace, self.__root)
-        addTxtEle(self.__doc, "virtualFolder", folder, self.__root)
-
-
-        self.__filterSect =  addEle(self.__doc, "filterSection", self.__root)
-
-        self.__keywordsEle = None # should have 'keywords' section
-        self.__keywords = []
-        self.__filesEle = None # should have 'files' section
-        self.__files = []
-
-        if withImgNotFound: # html prefix is not strictly correct
-            self.addFile("html/img/ImageNotFound.png")
-
-    def addTOC(self, contents):
-        """
-        The contents must all be specified at once. They should be in the
-        form of [(title1, ref1), (title2, ref2), ...].
-        """
-        toc = le.SubElement(self.__filterSect, "toc")
-        for (title, ref) in contents:
-            le.SubElement(toc, "section",
-                          **{"title":title, "ref":ref})
-
-    def addFile(self, filename, keyword=None):
-        if not keyword is None:
-            if self.__keywordsEle is None:
-                self.__keywordsEle = addEle(self.__doc, "keywords",
-                                            self.__filterSect)
-            if not keyword in self.__keywords:
-                addEle(self.__doc, "keyword", self.__keywordsEle,
-                       {"name":keyword, "ref":filename})
-                self.__keywords.append(keyword)
-        if self.__filesEle is None:
-            self.__filesEle = addEle(self.__doc, "files", self.__filterSect)
-        if not filename in self.__files:
-            addTxtEle(self.__doc, "file", filename, self.__filesEle)
-            self.__files.append(filename)
-
-    def __str__(self):
-        if self.__prettyxml:
-            return self.__doc.toprettyxml(indent="  ")
-        else:
-            return self.__doc.toxml()
-
-    def write(self, filename):
-        """
-        Write the help configuration to the given filename.
-        """
-        handle = open(filename, 'w')
-        handle.write(str(self))
diff --git a/Code/Mantid/docs/qtassistant/src/about.txt b/Code/Mantid/docs/qtassistant/src/about.txt
deleted file mode 100644
index 5b8d69c59f9af53e5a813c1cc24e0442b538972d..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/src/about.txt
+++ /dev/null
@@ -1 +0,0 @@
-Lots of really helpful information about mantid.
diff --git a/Code/Mantid/docs/qtassistant/src/developers.html b/Code/Mantid/docs/qtassistant/src/developers.html
deleted file mode 100644
index 9cde4337c3fc28b2732154a6b3b3d0d75d858c4a..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/src/developers.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<html>
-  <head>
-    <title>Developer Information</title>
-  </head>
-  <body>
-    <center><h1>Developer Information</h1></center>
-
-    <h2>Useful links</h2>
-    <ul>
-      <li><a href="http://doxygen.mantidproject.org/">C++ documentation</a> (doxygen)</li>
-      <li><a href="http://download.mantidproject.org/docs/current-release/python/html/index.html">Python documentation</a> (sphinx)</li>
-      <li><a href="http://github.com/mantidproject/mantid">Source code</a> (github)</li>
-      <li>Issue tracking (<a href="http://trac.mantidproject.org">trac</a>)</li>
-      <li>Build servers at <a href="http://download.mantidproject.org/jenkins">ISIS</a> and <a href="http://builds.sns.gov/">ORNL</a></li>
-    </ul>
-  </body>
-</html>
diff --git a/Code/Mantid/docs/qtassistant/src/index.html b/Code/Mantid/docs/qtassistant/src/index.html
deleted file mode 100644
index 5fa626f9f2981d86e1742fad3cb26ede6cb31f75..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/src/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-  <head>
-    <title>Mantid Overview</title>
-  </head>
-  <body>
-    <center><h1>Mantid Overview</h1></center>
-
-    <p>The Mantid project provides a framework that supports high-performance 
-      computing and visualisation of scientific data.</p>
-
-    <p>Mantid has been created to manipulate and analyse Neutron and Muon 
-      scattering data, but could be applied to many other techniques.</p>
-
-    <p>The framework is <a href="http://www.mantidproject.org/MantidProject:About#License_and_Distribution">open source</a>
-      and supported on <a href="http://www.mantidproject.org/Supported_Operating_Systems">multiple target platforms</a>
-      (Windows, Linux, Mac).</p>
-
-    <h2>Useful links</h2>
-    <ul>
-      <li><a href="http://www.mantidproject.org/">http://www.mantidproject.org</a> (wiki homepage)</li>
-      <li><a href="http://www.mantidproject.org/MantidPlot">http://www.mantidproject.org/MantidPlot</a> (wiki help main page)</li>
-    </ul>
-  </body>
-</html>
diff --git a/Code/Mantid/docs/qtassistant/src/mantidgeneral.qhp b/Code/Mantid/docs/qtassistant/src/mantidgeneral.qhp
deleted file mode 100644
index 7ec8060e93e93fd917ac0a06c1460598d9d269c8..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/src/mantidgeneral.qhp
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<QtHelpProject version="1.0">
-     <namespace>org.mantidproject</namespace>
-     <virtualFolder>doc</virtualFolder>
-     <filterSection>
-         <toc>
-             <section title="Mantid overview" ref="html/index.html"/>
-             <section title="MantidPlot" ref="html/mantidplot.html">
-	       <section title="User Interfaces" ref="html/userui.html"/>
-	       <section title="Algorithms" ref="html/algorithms_index.html"/>
-	       <section title="Fitting Functions" ref="html/fitfunctions_index.html"/>
-	     </section>
-             <section title="Mantid Python" ref="html/mantidpython.html"/>
-	     <section title="Developer information" ref="html/developers.html"/>
-         </toc>
-         <keywords>
-             <keyword name="Mantid overview" ref="html/index.html"/>
-             <keyword name="MantidPlot" ref="html/mantidplot.html"/>
-             <keyword name="User Interfaces" ref="html/userui.html"/>
-             <keyword name="Mantid Python" ref="html/mantidpython.html"/>
-             <keyword name="Developer information" ref="html/developers.html"/>
-         </keywords>
-         <files>
-           <file>html/index.html</file>
-           <file>html/mantidplot.html</file>
-           <file>html/userui.html</file>
-           <file>html/mantidpython.html</file>
-           <file>html/developers.html</file>
-         </files>
-     </filterSection>
-</QtHelpProject>
diff --git a/Code/Mantid/docs/qtassistant/src/mantidplot.html b/Code/Mantid/docs/qtassistant/src/mantidplot.html
deleted file mode 100644
index 8d1d33668538d0c47c2e38fb8cbc9c3d8647510b..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/src/mantidplot.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<html>
-  <head>
-    <title>MantidPlot</title>
-  </head>
-  <body>
-    <center><h1>MantidPlot</h1></center>
-
-    <ul>
-      <li><a href="algorithms_index.html">List of algorithms</a></li>
-      <li><a href="fitfunctions_index.html">List of fitting functions</a></li>
-    </ul>
-
-    <h2>Useful links</h2>
-    <ul>
-      <li><a href="http://www.mantidproject.org/">http://www.mantidproject.org</a> (wiki homepage)</li>
-      <li><a href="http://www.mantidproject.org/MantidPlot">http://www.mantidproject.org/MantidPlot</a> (wiki help main page)</li>
-    </ul>
-  </body>
-</html>
diff --git a/Code/Mantid/docs/qtassistant/src/mantidpython.html b/Code/Mantid/docs/qtassistant/src/mantidpython.html
deleted file mode 100644
index 74c74e649b31cb9eb535836681d98f7e2a46ae6d..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/src/mantidpython.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>
-  <head>
-    <title>Mantid Python</title>
-  </head>
-  <body>
-    <center><h1>Mantid Python</h1></center>
-
-    <h2>Useful links</h2>
-    <ul>
-      <li><a href="http://download.mantidproject.org/docs/current-release/python/html/index.html">Python documentation</a> (sphinx)</li>
-    </ul>
-  </body>
-</html>
diff --git a/Code/Mantid/docs/qtassistant/src/userui.html b/Code/Mantid/docs/qtassistant/src/userui.html
deleted file mode 100644
index 5d4f7444c91fa1b481cd76f3284ad92a05372939..0000000000000000000000000000000000000000
--- a/Code/Mantid/docs/qtassistant/src/userui.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-  <head>
-    <title>User Interfaces</title>
-  </head>
-  <body>
-    <center><h1>User Interfaces</h1></center>
-  </body>
-</html>
diff --git a/Code/Mantid/docs/source/_static/custom.css b/Code/Mantid/docs/source/_static/custom.css
index 8875353691a0baa56187afd54fdb6e49a24f4acf..b53877393584ba83a33244b334c7147153979f43 100644
--- a/Code/Mantid/docs/source/_static/custom.css
+++ b/Code/Mantid/docs/source/_static/custom.css
@@ -24,18 +24,33 @@ body { font-size: 1.6em; } /* 16px */
 dl dd { margin: .5em 0 .5em 1.6em; }
 h1,h2 { margin-bottom: .5em; }
 
-/*-------------------- $IMAGES --------------------*/
+/*-------------------- $MATH ----------------------*/
 
-.caption {
-  text-align: center;
-  font-size: 0.8em;
+img.math {
+    vertical-align: middle;
+}
+
+div.math p {
+    text-align: center;
+}
+
+span.eqno {
+    float: right;
 }
 
+/*-------------------- $IMAGES --------------------*/
+
 .screenshot {
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
   padding-bottom: 0.1em;
 }
 
-.figure { margin: 0; }
+.caption {
+  text-align: center;
+  font-size: 0.9em;
+}
 
 /*-------------------- $TABLES --------------------*/
 
@@ -61,6 +76,10 @@ td, th {
   text-align: left;
 }
 
+/*-------------------- $SPHINX-OVERRIDES --------------------*/
+
+.warning { overflow: hidden; }
+
 /*-------------------- $MEDIA-QUERIES --------------------*/
 
 @media (min-width: 1200px) {
diff --git a/Code/Mantid/docs/source/algorithms/AddSampleLog-v1.rst b/Code/Mantid/docs/source/algorithms/AddSampleLog-v1.rst
index 023fafba3a5180a7f22e50138f2ba152c0f8f042..6d86b5e2db5715eee8c01bea0faba28119e884a9 100644
--- a/Code/Mantid/docs/source/algorithms/AddSampleLog-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/AddSampleLog-v1.rst
@@ -21,4 +21,41 @@ If the LogText contains a numeric value, the created log will be of
 integer type if an integer is passed and floating point (double)
 otherwise. This applies to both the Number & Number Series options.
 
-.. categories::
+To add logs that vary over time (Time Series Logs) use :ref:`algm-AddTimeSeriesLog`.
+
+Usage
+-----
+
+**Example - Add Sample Logs in different ways**
+
+.. testcode:: AddSampleLogExample
+
+   # Create a host workspace
+   demo_ws = CreateWorkspace(DataX=range(0,3), DataY=(0,2))
+
+   # Add sample logs
+   AddSampleLog(Workspace=demo_ws, LogName='x', LogText='hello world', LogType='String')
+   AddSampleLog(Workspace=demo_ws, LogName='y', LogText='1', LogType='Number')
+   AddSampleLog(Workspace=demo_ws, LogName='z', LogText='2', LogType='Number Series')
+
+   # Fetch the generated logs
+   run = demo_ws.getRun()
+   log_x = run.getLogData('x')
+   log_y = run.getLogData('y')
+   log_z = run.getLogData('z')
+
+   # Print the log values
+   print log_x.value
+   print log_y.value
+   print log_z.value
+
+Output:
+
+.. testoutput:: AddSampleLogExample 
+
+  hello world
+  1
+  [2]
+
+
+.. categories::
\ No newline at end of file
diff --git a/Code/Mantid/docs/source/algorithms/AlphaCalc-v1.rst b/Code/Mantid/docs/source/algorithms/AlphaCalc-v1.rst
index f53230c482b91e4df833c3c625a1829bbd0057a3..8da688956ff42cbc76ed8b6cccf45df40a429337 100644
--- a/Code/Mantid/docs/source/algorithms/AlphaCalc-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/AlphaCalc-v1.rst
@@ -10,10 +10,53 @@ Description
 -----------
 
 Returns the relative efficiency of the forward detector group compared
-to the backward detector group. If Alpha is larger than 1 more counts
+to the backward detector group. If *Alpha* is larger than 1 more counts
 has been collected in the forward group.
 
-This algorithm leave the input workspace unchanged. To group detectors
-in a workspace use :ref:`algm-GroupDetectors`.
+.. note::
+
+   This algorithm leaves the input workspace unchanged. To group detectors
+   in a workspace use :ref:`algm-MuonGroupDetectors`.
+
+Usage
+-----
+
+**Example - Calculating Alpha:**
+
+.. testcode:: ExSimple
+
+   y = [1,1,1,1,1] + [2,2,2,2,2]
+   x = [1,2,3,4,5,6] * 2
+   input = CreateWorkspace(x,y, NSpec=2)
+
+   alpha = AlphaCalc(input)
+
+   print 'Alpha value: {0:.3f}'.format(alpha)
+
+Output:
+
+.. testoutput:: ExSimple
+
+   Alpha value: 0.500
+
+**Example - Calculating Alpha, reversing forward and backward spectra:**
+
+.. testcode:: ExReversed
+
+   y = [1,1,1,1,1] + [2,2,2,2,2]
+   x = [1,2,3,4,5,6] * 2
+   input = CreateWorkspace(x,y, NSpec=2)
+
+   alpha = AlphaCalc(input,
+                     ForwardSpectra=[2],
+                     BackwardSpectra=[1])
+
+   print 'Alpha value: {0:.3f}'.format(alpha)
+
+Output:
+
+.. testoutput:: ExReversed
+
+   Alpha value: 2.000
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/ApplyDeadTimeCorr-v1.rst b/Code/Mantid/docs/source/algorithms/ApplyDeadTimeCorr-v1.rst
index 566974857eb2eeea487f054f388b7c81731caa36..080c9e8ec2d1b6ac3ac060b90a8e0c684c680297 100644
--- a/Code/Mantid/docs/source/algorithms/ApplyDeadTimeCorr-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/ApplyDeadTimeCorr-v1.rst
@@ -9,18 +9,94 @@
 Description
 -----------
 
-Apply deadtime correction to each spectra of a workspace. Define:
+Assuming that the *InputWorkspace* contains measured
+counts as a function of TOF, the algorithm returns a workspace
+containing true counts as a function of the same TOF binning
+according to
 
-| `` ``\ :math:`{\displaystyle{N}}`\ `` = true count``
-| `` ``\ :math:`{\displaystyle{M}}`\ `` = measured count``
-| `` ``\ :math:`{\displaystyle{t_{dead}}}`\ `` = dead-time``
-| `` ``\ :math:`{\displaystyle{t_{bin}}}`\ `` = time bin width``
-| `` ``\ :math:`{\displaystyle{F}}`\ `` = Number of good frames``
+.. math:: N = \frac{M}{(1-M*(\frac{t_{dead}}{t_{bin}*F}))}
 
-Then this algorithm assumes that the InputWorkspace contains measured
-counts as a function of TOF and returns a workspace containing true
-counts as a function of the same TOF binning according to
+where
 
-.. math:: N = \frac{M}{(1-M*(\frac{t_{dead}}{t_{bin}*F}))}
+| :math:`N` = true count
+| :math:`M` = measured count
+| :math:`t_{dead}` = dead-time
+| :math:`t_{bin}` = time bin width
+| :math:`F` = number of good frames
+
+*DeadTimeTable* is expected to have 2 columns:
+
+1. Integer type, containing spectrum number (not index)
+2. Double type, containing :math:`t_{dead}` value of the spectrum
+
+Usage
+-----
+
+.. include:: ../usagedata-note.txt
+
+**Example - Applying the correction using custom dead times:**
+
+.. testcode:: ExCustomDeadTimes
+
+   # Load single period of a MUSR run
+   input = LoadMuonNexus('MUSR0015189.nxs', EntryNumber=1)
+
+   # Remove uninteresting bins
+   input = CropWorkspace('input', XMin=0.55, XMax=12)
+
+   # Create a table with some arbitrary dead times
+   dead_times = CreateEmptyTableWorkspace()
+   dead_times.addColumn('int', 'Spectrum no.')
+   dead_times.addColumn('double', 'Deadtime')
+
+   for i in range(1,65):
+     dead_times.addRow([i, 0.1])
+
+   output = ApplyDeadTimeCorr('input','dead_times')
+
+   original = Integration('input')
+   corrected = Integration('output')
+
+   format_str = 'Spectrum: {0:d}; original: {1:.3f}; corrected: {2:.3f}'
+
+   for s in [0,32,63]:
+      print format_str.format(s, original.readY(s)[0], corrected.readY(s)[0])
+
+Output:
+
+.. testoutput:: ExCustomDeadTimes
+
+   Spectrum: 0; original: 6643.000; corrected: 6861.714
+   Spectrum: 32; original: 10384.000; corrected: 10928.727
+   Spectrum: 63; original: 8875.000; corrected: 9273.499
+
+**Example - Applying the correction using dead times stored in the Nexus file:**
+
+.. testcode:: ExLoadedDeadTimes
+
+   # Load a MUSR run
+   input = LoadMuonNexus('MUSR0015189.nxs', DeadTimeTable='dead_times')
+
+   # Remove uninteresting bins
+   input = CropWorkspace('input', XMin=0.55, XMax=12)
+
+   # Apply the loaded dead times
+   output = ApplyDeadTimeCorr('input','dead_times')
+
+   original = Integration(input.getItem(0))
+   corrected = Integration(output.getItem(0))
+
+   format_str = 'Spectrum: {0:d}; original: {1:.3f}; corrected: {2:.3f}'
+
+   for s in [0,32,63]:
+      print format_str.format(s, original.readY(s)[0], corrected.readY(s)[0])
+
+Output:
+
+.. testoutput:: ExLoadedDeadTimes
+
+   Spectrum: 0; original: 6643.000; corrected: 6670.079
+   Spectrum: 32; original: 10384.000; corrected: 10451.664
+   Spectrum: 63; original: 8875.000; corrected: 8922.105
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/AsymmetryCalc-v1.rst b/Code/Mantid/docs/source/algorithms/AsymmetryCalc-v1.rst
index 1ef76c89838ba10dd7ca6844d68c7166afe4d76f..4129abaddfde5f8b6b41baa6043e4dfc77e85e12 100644
--- a/Code/Mantid/docs/source/algorithms/AsymmetryCalc-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/AsymmetryCalc-v1.rst
@@ -9,23 +9,52 @@
 Description
 -----------
 
-This algorithm is used to calculate the asymmetry for a muon workspace.
+This algorithm is used to calculate the asymmetry for a Muon workspace.
 The asymmetry is given by:
 
 .. math:: Asymmetry = \frac{F-\alpha B}{F+\alpha B}
 
-where F is the front spectra, B is the back spectra and a is alpha.
+, where :math:`F` is the front spectra, :math:`B` is the back spectra
+and :math:`\alpha` is the balance parameter [1]_.
 
-The errors in F-aB and F+aB are calculated by adding the errors in F and
-B in quadrature; any errors in alpha are ignored. The errors for the
-asymmetry are then calculated using the fractional error method with the
-values for the errors in F-aB and F+aB.
+The errors in :math:`F-\alpha B` and :math:`F+\alpha B` are calculated
+by adding the errors in :math:`F` and :math:`B` in quadrature; any
+errors in :math:`\alpha` are ignored. The errors for the asymmetry are
+then calculated using the fractional error method with the values for
+the errors in :math:`F-\alpha B` and :math:`F+\alpha B`.
 
-The output workspace contains one set of data for the time of flight,
+The output workspace contains one set of data for the time of flight:
 the asymmetry and the asymmetry errors.
 
-Note: this algorithm does not perform any grouping; the grouping must be
-done via the GroupDetectors algorithm or when the NeXus file is loaded
-auto\_group must be set to true.
+.. note::
+   This algorithm does not perform any grouping. The grouping must be
+   done using :ref:`algm-MuonGroupDetectors` or *AutoGroup* option
+   of :ref:`algm-LoadMuonNexus`.
+
+.. [1] See :ref:`algm-AlphaCalc`
+
+Usage
+-----
+
+**Example - Calculating asymmetry:**
+
+.. testcode:: ExSimple
+
+   y = [1,2,3] + [3,1,12]
+   x = [1,2,3,4] * 2
+   e = [1,1,1] * 2
+   input = CreateWorkspace(x, y, e, NSpec=2)
+
+   asymmetry = AsymmetryCalc(input, Alpha=0.5)
+
+   print 'Asymmetry:', asymmetry.readY(0)
+   print 'Errors:', asymmetry.readE(0)
+
+Output:
+
+.. testoutput:: ExSimple
+
+   Asymmetry: [-0.2         0.6        -0.33333333]
+   Errors: [ 0.5396295   0.69971423  0.28688766]
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/BinMD-v1.rst b/Code/Mantid/docs/source/algorithms/BinMD-v1.rst
index d22abfbead4b85300b22545013c29a5fecc2ca7d..711f93d8f2c35426e9d6bdee08f933d1bf0ffedc 100644
--- a/Code/Mantid/docs/source/algorithms/BinMD-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/BinMD-v1.rst
@@ -10,10 +10,10 @@ Description
 -----------
 
 This algorithm performs dense binning of the events in multiple
-dimensions of an input `MDEventWorkspace <MDEventWorkspace>`__ and
-places them into a dense MDHistoWorkspace with 1-4 dimensions.
+dimensions of an input `MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__ and
+places them into a dense `MDHistoWorkspace <http://www.mantidproject.org/MDHistoWorkspace>`__ with 1-4 dimensions.
 
-The input MDEventWorkspace may have more dimensions than the number of
+The input `MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__ may have more dimensions than the number of
 output dimensions. The names of the dimensions in the DimX, etc.
 parameters are used to find the corresponding dimensions that will be
 created in the output.
@@ -89,11 +89,11 @@ dimensions!
 Binning a MDHistoWorkspace
 ##########################
 
-It is possible to rebin a `MDHistoWorkspace <MDHistoWorkspace>`__. Each
-MDHistoWorkspace holds a reference to the
-`MDEventWorkspace <MDEventWorkspace>`__ that created it, as well as the
+It is possible to rebin a `MDHistoWorkspace <http://www.mantidproject.org/MDHistoWorkspace>`__. Each
+`MDHistoWorkspace <http://www.mantidproject.org/MDHistoWorkspace>`__ holds a reference to the
+`MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__ that created it, as well as the
 coordinate transformation that was used. In this case, the rebinning is
-actually performed on the original MDEventWorkspace, after suitably
+actually performed on the original `MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__, after suitably
 transforming the basis vectors.
 
 Only the non-axis aligned binning method can be performed on a
@@ -102,11 +102,9 @@ dimensions, which is equivalent.
 
 For more details on the coordinate transformations applied in this case,
 please see `BinMD Coordinate
-Transformations <BinMD Coordinate Transformations>`__.
+Transformations <http://www.mantidproject.org/BinMD_Coordinate_Transformations>`__.
 
 .. figure:: /images/BinMD_Coordinate_Transforms_withLine.png
    :alt: BinMD_Coordinate_Transforms_withLine.png
 
-   BinMD\_Coordinate\_Transforms\_withLine.png
-
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/BinaryOperateMasks-v1.rst b/Code/Mantid/docs/source/algorithms/BinaryOperateMasks-v1.rst
index 55e09f71f70b32cc98f62ebf7a820778df031691..b87ce6f3db24d477af7f1f76c3b10ec0c3558e49 100644
--- a/Code/Mantid/docs/source/algorithms/BinaryOperateMasks-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/BinaryOperateMasks-v1.rst
@@ -26,4 +26,38 @@ Output
 A SpecialWorkspace2D with the same dimension and geometry as the input
 two SpecialWorkspace2D.
 
+Usage
+-----
+
+*Example - Binary Operation Usage*
+
+.. testcode:: BinaryOperateMasksExample
+
+   # Create some masked workspaces
+   ws1 = CreateSampleWorkspace(NumBanks=1,BankPixelWidth=1)
+   ws2 = CreateSampleWorkspace(NumBanks=1,BankPixelWidth=1)
+   MaskDetectors(ws1, WorkspaceIndexList=0)
+   MaskDetectors(ws2, WorkspaceIndexList=0)
+   a, list = ExtractMask(ws1)
+   b, list = ExtractMask(ws2)
+   
+   # Run using AND
+   _and = BinaryOperateMasks(a, b, OperationType='AND')
+   # Run using OR
+   _or = BinaryOperateMasks(a, b, OperationType='OR')
+   # Run using XOR
+   _xor = BinaryOperateMasks(a, b, OperationType='XOR')
+   
+   print _and.readY(0)
+   print _or.readY(0)
+   print _xor.readY(0)
+   
+Output:
+
+.. testoutput::  BinaryOperateMasksExample
+
+   [ 2.]
+   [ 1.]
+   [ 0.]
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/CalculateFlatBackground-v1.rst b/Code/Mantid/docs/source/algorithms/CalculateFlatBackground-v1.rst
index d382f3bb9765ce01f62777a1bf91944e1e24a464..11c86ed66f655c341f1ff56d6ce1fcef8bb716b2 100644
--- a/Code/Mantid/docs/source/algorithms/CalculateFlatBackground-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CalculateFlatBackground-v1.rst
@@ -17,21 +17,65 @@ negative value as bins with count rates less than the background are set
 to zero (and their error is set to the backgound value).
 
 The average background count rate is estimated in one of two ways. When
-Mode is set to 'Mean' it is the sum of the values in the bins in the
-background region divided by the width of the X range. Selecting 'Linear
-Fit' sets the background value to the height in the centre of the
+*Mode* is set to "Mean" it is the sum of the values in the bins in the
+background region divided by the width of the X range. Selecting "Linear
+Fit" sets the background value to the height in the centre of the
 background region of a line of best fit through that region.
 
-The error on the background value is only calculated when 'Mean' is
+The error on the background value is only calculated when "Mean" is
 used. It is the errors in all the bins in the background region summed
 in quadrature divided by the number of bins. This background error value
 is added in quadrature to the errors in each bin.
 
-ChildAlgorithms used
-####################
+Usage
+-----
 
-The `Linear <Linear>`__ algorithm is used when the Mode = Linear Fit.
-From the resulting line of best fit a constant value taken as the value
-of the line at the centre of the fitted range.
+**Example - Subtracting background using Linear Fit:**
+
+.. testcode:: ExSubLinFit
+
+   import numpy as np
+
+   y = [3, 1, 1, 1, 7, -3]
+   x = [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5]
+   input = CreateWorkspace(x,y)
+
+   output = CalculateFlatBackground('input',
+                                    StartX=2,
+                                    EndX=4,
+                                    Mode='Linear Fit',
+                                    OutputMode='Subtract Background')
+
+   print 'Values with subtracted background:', np.around(output.readY(0))
+
+Output:
+
+.. testoutput:: ExSubLinFit
+
+   Values with subtracted background: [ 2.  0.  0.  0.  6.  0.]
+
+**Example - Returning background using Mean:**
+
+.. testcode:: ExReturnMean
+
+   import numpy as np
+
+   y = [3, 4, 2, 3, -3]
+   x = [0.5, 1.5, 2.5, 3.5, 4.5, 5.5]
+   input = CreateWorkspace(x,y)
+
+   output = CalculateFlatBackground('input',
+                                    StartX=1,
+                                    EndX=3,
+                                    Mode='Mean',
+                                    OutputMode='Return Background')
+
+   print 'Calculated Mean background:', np.around(output.readY(0))
+
+Output:
+
+.. testoutput:: ExReturnMean
+
+   Calculated Mean background: [ 3.  3.  3.  3.  3.]
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/CalculateGammaBackground-v1.rst b/Code/Mantid/docs/source/algorithms/CalculateGammaBackground-v1.rst
index 332effe383e1456199f4abe8459a21d4e53e7f78..959a84fce701c9e989b52999d05d4790455b314a 100644
--- a/Code/Mantid/docs/source/algorithms/CalculateGammaBackground-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CalculateGammaBackground-v1.rst
@@ -9,10 +9,10 @@
 Description
 -----------
 
-This algorithm is currently used by the Vesuvio spectrometer at ISIS to
-correct for background produced by photons that are produced when the
+This algorithm is currently designed to be used by the Vesuvio spectrometer at ISIS to
+correct for background produced by photons that are created when the
 neutrons are absorbed by the shielding on the instrument. It only
-corrects the forward scattering detector banks.
+corrects the forward scattering detector banks - spectrum numbers 135-198.
 
 Two workspaces are produced: the calculated background and a corrected
 workspace where the input workspace has been corrected by the
@@ -23,4 +23,58 @@ detector to the integrated foil counts (:math:`\beta`) and then the
 final corrected count rate :math:`\displaystyle c_f` is defined as
 :math:`\displaystyle c_f = c_i - \beta c_b`.
 
+Usage
+-----
+
+**Example: Correcting the first spectrum**
+
+.. testcode::
+
+   ###### Simulates LoadVesuvio with spectrum number 135-136 #################
+   tof_ws = CreateSimulationWorkspace(Instrument='Vesuvio',BinParams=[50,0.5,562],UnitX='TOF')
+   tof_ws = CropWorkspace(tof_ws,StartWorkspaceIndex=134,EndWorkspaceIndex=135) # index one less than spectrum number
+   tof_ws = ConvertToPointData(tof_ws)
+   SetInstrumentParameter(tof_ws, ParameterName='t0',ParameterType='Number',Value='0.5')
+   ###########################################################################
+
+   mass_function = "name=GaussianComptonProfile,Mass=1.0079,Width=0.4,Intensity=1.1"
+   corrected, background = CalculateGammaBackground(tof_ws, ComptonFunction=mass_function,
+                                                    WorkspaceIndexList=0)
+
+   print "First 5 values of input:", tof_ws.readY(0)[0:4]
+   print "First 5 values of background:", background.readY(0)[0:4]
+   print "First 5 values of corrected:", corrected.readY(0)[0:4]
+
+Output:
+
+.. testoutput::
+
+   First 5 values of input: [ 1.  1.  1.  1.]
+   First 5 values of background: [ 1.00053361  1.00054704  1.00056072  1.00057468]
+   First 5 values of corrected: [-0.00053361 -0.00054704 -0.00056072 -0.00057468]
+
+**Example: Correcting all spectra**
+
+.. testcode::
+
+   ###### Simulates LoadVesuvio with spectrum number 135-136 #################
+   tof_ws = CreateSimulationWorkspace(Instrument='Vesuvio',BinParams=[50,0.5,562],UnitX='TOF')
+   tof_ws = CropWorkspace(tof_ws,StartWorkspaceIndex=134,EndWorkspaceIndex=135) # index one less than spectrum number5
+   tof_ws = ConvertToPointData(tof_ws)
+   SetInstrumentParameter(tof_ws, ParameterName='t0',ParameterType='Number',Value='0.5')
+   ###########################################################################
+
+   mass_function = "name=GaussianComptonProfile,Mass=1.0079,Width=0.4,Intensity=1.1"
+   corrected, background = CalculateGammaBackground(tof_ws, ComptonFunction=mass_function)
+
+   print "Number of background spectra:", background.getNumberHistograms()
+   print "Number of corrected spectra:", corrected.getNumberHistograms()
+
+Output:
+
+.. testoutput::
+
+   Number of background spectra: 2
+   Number of corrected spectra: 2
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/CalculatePeaksHKL-v1.rst b/Code/Mantid/docs/source/algorithms/CalculatePeaksHKL-v1.rst
index 3323a39de65ac64953506c794a60368df8ec119a..e8e1b8ecc373ed26f7740b34a746cb4c04f94170 100644
--- a/Code/Mantid/docs/source/algorithms/CalculatePeaksHKL-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CalculatePeaksHKL-v1.rst
@@ -19,4 +19,29 @@ Alternatives
 
 :ref:`algm-IndexPeaks`
 
+Usage
+-----
+
+**Example - Calculate peak HKL values based on UB matrix**
+
+.. testcode:: CalculatePeaksHKLExample
+
+  mdew = Load("TOPAZ_3680_5_sec_MDEW.nxs")
+  # Find some peaks. These are all unindexed so will have HKL = [0,0,0]
+  peaks = FindPeaksMD(InputWorkspace=mdew, MaxPeaks=1)
+
+  # Set the UB to unity
+  SetUB(peaks, UB=[1,0,0,0,1,0,0,0,1])
+
+  # Run the algorithm
+  indexed = CalculatePeaksHKL(PeaksWorkspace=peaks, OverWrite=True)
+
+  print "Number of Indexed Peaks: ", indexed
+
+Output:
+
+.. testoutput:: CalculatePeaksHKLExample
+
+  Number of Indexed Peaks:  1
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/CombinePeaksWorkspaces-v1.rst b/Code/Mantid/docs/source/algorithms/CombinePeaksWorkspaces-v1.rst
index a4d55d5366d6971a73bf10c17ffc6e90362a52ca..c652dbd16b3bcab3d9e20c41f9e460cba5a576ef 100644
--- a/Code/Mantid/docs/source/algorithms/CombinePeaksWorkspaces-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CombinePeaksWorkspaces-v1.rst
@@ -11,8 +11,9 @@ Description
 
 This algorithm can be used to combine lists of single crystal peaks,
 possibly obtained by different methods, in to a single list (contained
-in a PeaksWorkspace). With the default options, this will simply append
-the lists of peaks. If CombineMatchingPeaks is selected then an attempt
+in a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__). 
+With the default options, this will simply append the lists of peaks. 
+If CombineMatchingPeaks is selected then an attempt
 will be made to identify identical peaks by matching them in Q within
 the specified tolerance. The peaks in each workspace are traversed in
 the order they are found in the workspace (RHSWorkspace first) and if a
diff --git a/Code/Mantid/docs/source/algorithms/ConvertAxisByFormula-v1.rst b/Code/Mantid/docs/source/algorithms/ConvertAxisByFormula-v1.rst
index 1f56b4183690c059df12666a714a9cdf1a573434..b3307a8582dccfa9fc842b555ed3c772e89fef90 100644
--- a/Code/Mantid/docs/source/algorithms/ConvertAxisByFormula-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/ConvertAxisByFormula-v1.rst
@@ -21,12 +21,94 @@ altered, and as such may not work in all other algorithms.
 
 The algorithm can operate on the X or Y axis, but cannot alter the
 values of a spectrum axis (the axis used as the Y axis on newly loaded
-Raw data). If you wish to alter this axis use he
+Raw data). If you wish to alter this axis use the
 :ref:`algm-ConvertSpectrumAxis` algorithm first.
 
-The formula is defined in a simple math syntax, please look at the usage
-examples to some ideas of what is possible, a full list of the functions
-available can be found at the muparser website
-`1 <http://muparser.beltoforion.de/mup_features.html#idDef2>`__.
+The formula is defined in a simple math syntax. For example:
+
+* Squaring - *x^2*
+* Square root - *sqrt(x)*
+* Cubing - *x^3*
+* Basic addition - *y + 3*
+* Brackets - *(y+1)/20*
+* Natural Log - *ln(x)*
+* Log 10 - *log(x)*
+* Exponent - *exp(y)*
+* Round to nearest integer - *rint(y/10)*
+* Absolute value - *abs(y-100)*
+
+*x* and *y* can be used interchangeably to refer to the current axis value.
+
+Refer to the
+`muparser page <http://muparser.beltoforion.de/mup_features.html#idDef2>`_
+for a full list of the functions available.
+
+Usage
+-----
+
+**Example - Squaring the X axis:**
+
+.. testcode:: ExSquareXAxis
+
+   # Create sample input workspace
+   dataX = [1,2,3,4,5]
+   dataY = [1,1,1,1,1]
+   input = CreateWorkspace(dataX, dataY)
+
+   output = ConvertAxisByFormula(InputWorkspace=input,
+                                 Axis="X",
+                                 Formula="x^2",
+                                 AxisTitle="Squared X",
+                                 AxisUnits="x^2")
+
+   print "New X values:", output.getAxis(0).extractValues()
+   print "New X units:", output.getAxis(0).getUnit().symbol()
+   print "New X title:", output.getAxis(0).getUnit().caption()
+
+Output:
+
+.. testoutput:: ExSquareXAxis
+
+   New X values: [  1.   4.   9.  16.  25.]
+   New X units: x^2
+   New X title: Squared X
+
+**Example - Doubling the Y axis:**
+
+.. testcode:: ExDoubleYAxis
+
+   from mantid.api import NumericAxis
+
+   # Create sample input workspace (with 5 spectra)
+   dataX = [1,2,3,4,5]
+   dataY = [1,1,1,1,1]
+   input = CreateWorkspace(dataX, dataY, NSpec=5)
+
+   # Create numeric Y axis with values [1..5]
+   yAxis = NumericAxis.create(5)
+   for i in range(0,5):
+     yAxis.setValue(i, i+1)
+
+   # Replace Y axis in the input workspace. This is necessary because CreateWorkspace
+   # uses TextAxis by default, which are not suitable for conversion.
+   input.replaceAxis(1, yAxis)
+
+   output = ConvertAxisByFormula(InputWorkspace=input,
+                                 Axis="Y",
+                                 Formula="y*2",
+                                 AxisTitle="Doubled Y",
+                                 AxisUnits="y*2")
+
+   print "New Y values:", output.getAxis(1).extractValues()
+   print "New Y units:", output.getAxis(1).getUnit().symbol()
+   print "New Y title:", output.getAxis(1).getUnit().caption()
+
+Output:
+
+.. testoutput:: ExDoubleYAxis
+
+   New Y values: [  2.   4.   6.   8.  10.]
+   New Y units: y*2
+   New Y title: Doubled Y
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/ConvertEmptyToTof-v1.rst b/Code/Mantid/docs/source/algorithms/ConvertEmptyToTof-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..cce8d972a22fac287af25ec83b649be6885716c3
--- /dev/null
+++ b/Code/Mantid/docs/source/algorithms/ConvertEmptyToTof-v1.rst
@@ -0,0 +1,29 @@
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+Only for ILL usage. In the future, ILL plans to load data in raw format (no units used). The X-axis represent the time *channel number*.
+This algorithm converts the *channel number* to time of flight using the distances source-sample-detectors defined in the IDF. In addition, the user has to input the fields:
+
+- **ListOfSpectraIndices** - Spectrum or list of spectra to look for the elastic peak. Note that the spectra chosen must be at the same distance.
+- **ListOfChannelIndices** - Elastic peak channels - For the selected spetra above, the list/range of channels to look for the elastic peak (e.g. range).
+
+Note that the Input Workspace must have the following properties:
+
+-  ``wavelength``
+-  ``channel_width``
+
+Instead of using the fields above (ListOfSpectraIndices and ListOfChannelIndices), the user can specify the Elastic Peak Position (channel number) and the respective spectrum, using the following fields:
+
+- **ElasticPeakPosition**
+- **ElasticPeakPositionSpectrum**
+
+
+.. categories::
diff --git a/Code/Mantid/docs/source/algorithms/ConvertSpectrumAxis-v2.rst b/Code/Mantid/docs/source/algorithms/ConvertSpectrumAxis-v2.rst
index 40605ff58055282f908bd828300102b018e28f32..af1c3cfc86ed8fac25180aa84677e8dc89de0a39 100644
--- a/Code/Mantid/docs/source/algorithms/ConvertSpectrumAxis-v2.rst
+++ b/Code/Mantid/docs/source/algorithms/ConvertSpectrumAxis-v2.rst
@@ -19,4 +19,43 @@ duplicates will not be aggregated. Any spectrum for which a detector is
 not found (i.e. if the instrument definition is incomplete) will not
 appear in the output workspace.
 
+Usage
+-----
+
+**Example: Convert vertical axis to theta**
+
+.. testcode::
+
+   # Creates a workspace with some detectors attached
+   dataws = CreateSampleWorkspace(NumBanks=1,BankPixelWidth=2) # 2x2 detector
+
+   theta = ConvertSpectrumAxis(dataws, Target="Theta")
+
+   vertical_axis = theta.getAxis(1)
+   print "There are %d axis values" % vertical_axis.length()
+   print "Final theta value: %f (degrees)" % vertical_axis.getValue(vertical_axis.length() - 1)
+
+.. testoutput::
+
+   There are 4 axis values
+   Final theta value: 0.129645 (degrees)
+
+**Example: Convert vertical axis to elastic Q for direct geometry**
+
+.. testcode::
+
+   # Creates a workspace with some detectors attached
+   dataws = CreateSampleWorkspace(NumBanks=1,BankPixelWidth=2) # 2x2 detector
+
+   qws = ConvertSpectrumAxis(dataws, Target="ElasticQ", EFixed=15., EMode="Direct")
+
+   vertical_axis = qws.getAxis(1)
+   print "There are %d axis values" % vertical_axis.length()
+   print "Final Q value: %f (A^-1)" % vertical_axis.getValue(vertical_axis.length() - 1)
+
+.. testoutput::
+
+   There are 4 axis values
+   Final Q value: 0.006088 (A^-1)
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/ConvertToDetectorFaceMD-v1.rst b/Code/Mantid/docs/source/algorithms/ConvertToDetectorFaceMD-v1.rst
index 91ba445da9257c6eceac56bbbc219940deaa99b4..7111ec696e0c096d8ddf879c661c7f728ddc68a8 100644
--- a/Code/Mantid/docs/source/algorithms/ConvertToDetectorFaceMD-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/ConvertToDetectorFaceMD-v1.rst
@@ -9,12 +9,12 @@
 Description
 -----------
 
-This algorithm takes a a `MatrixWorkspace <MatrixWorkspace>`__ and
-converts it into a `MDEventWorkspace <MDEventWorkspace>`__ that can be
-viewed in the `SliceViewer <SliceViewer>`__.
+This algorithm takes a a `MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`__ and
+converts it into a `MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__ that can be
+viewed in the `SliceViewer <http://www.mantidproject.org/SliceViewer>`__.
 
 The algorithm currently only works for instruments with
-`RectangularDetectors <RectangularDetectors>`__. The coordinates of the
+`RectangularDetectors <http://www.mantidproject.org/InstrumentDefinitionFile#Creating_Rectangular_Area_Detectors>`__. The coordinates of the
 output workspace are:
 
 -  Pixel X coordinate (integer starting at 0)
@@ -25,8 +25,8 @@ output workspace are:
 Each MDEvent created has a weight given by the number of counts in that
 bin. Zero bins are not converted to events (saving memory).
 
-Once created, the `MDEventWorkspace <MDEventWorkspace>`__ can be viewed
-in the `SliceViewer <SliceViewer>`__. It can also be rebinned with
+Once created, the `MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__ can be viewed
+in the `SliceViewer <http://www.mantidproject.org/SliceViewer>`__. It can also be rebinned with
 different parameters using :ref:`algm-BinMD`. This allows you to view
 the data in detector-space. For example, you might use this feature to
 look at your detector's sensitivity as a function of position, as well
@@ -35,19 +35,20 @@ screenshot for example:
 
 .. figure:: /images/SliceViewer-DetectorFace.png
    :alt: SliceViewer-DetectorFace.png
+   :align: center
+   :width: 600 px
 
    SliceViewer-DetectorFace.png
 BankNumbers Parameter
 #####################
 
-If your instrument has several
-`RectangularDetectors <RectangularDetectors>`__, you can use the
+If your instrument has several `RectangularDetectors <http://www.mantidproject.org/InstrumentDefinitionFile#Creating_Rectangular_Area_Detectors>`__, you can use the
 *BankNumbers* property to specify which one(s) to convert. The algorithm
-looks for RectangularDetectors with the name 'bankXX' where XX is the
+looks for `RectangularDetectors <http://www.mantidproject.org/InstrumentDefinitionFile#Creating_Rectangular_Area_Detectors>`__ with the name 'bankXX' where XX is the
 bank number.
 
 If you specify more than one bank number, then the algorithm will create
-a 4D MDEventWorkspace. The fourth dimension will be equal to the bank
+a 4D `MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__. The fourth dimension will be equal to the bank
 number, allowing you to easily pick a bank to view.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/ConvertToMatrixWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/ConvertToMatrixWorkspace-v1.rst
index 230fe47e33ac02feccc3293dc44123e70b0e5b9b..447d34f8f5f145f0b79520a64baecc54292c7106 100644
--- a/Code/Mantid/docs/source/algorithms/ConvertToMatrixWorkspace-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/ConvertToMatrixWorkspace-v1.rst
@@ -12,4 +12,45 @@ Description
 This can also be performed using the :ref:`algm-Rebin` algorithm and
 having the "PreserveEvents" parameter set to false.
 
+Usage
+-----
+
+.. include:: ../usagedata-note.txt
+
+**Example - Simple conversion of an EventWorkspace**
+
+.. testcode:: ConvertToMatrixWorkspaceSimpleExample
+
+   event_ws = Load('CNCS_7860_event.nxs')
+   # Run the conversion algorithm
+   histo_ws = ConvertToMatrixWorkspace(event_ws)
+   # Check that the original workspace and the converted workspace have the same shape
+   print event_ws.getNumberHistograms(), event_ws.blocksize()
+   print histo_ws.getNumberHistograms(), histo_ws.blocksize()
+
+.. testoutput:: ConvertToMatrixWorkspaceSimpleExample
+
+   51200 1
+   51200 1
+
+**Example - Conversion when blocksize > 1**
+
+.. testcode:: ConvertToMatrixWorkspaceComplexExample
+
+   event_ws = Load('CNCS_7860_event.nxs')
+   # Rebin the loaded EventWorkspace to a new EventWorkspace that has > 1 bins
+   event_ws_rebinned = Rebin(InputWorkspace=event_ws, Params=1e3, PreserveEvents=True)
+   # Run the conversion algorithm
+   histo_ws_rebinned = ConvertToMatrixWorkspace(event_ws_rebinned)
+   # Check that the original workspace and the converted workspace have the same shape
+   print event_ws_rebinned.getNumberHistograms(), event_ws_rebinned.blocksize()
+   print histo_ws_rebinned.getNumberHistograms(), histo_ws_rebinned.blocksize()
+
+Output:
+
+.. testoutput:: ConvertToMatrixWorkspaceComplexExample    
+  
+   51200 17
+   51200 17
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/CorrectFlightPaths-v1.rst b/Code/Mantid/docs/source/algorithms/CorrectFlightPaths-v1.rst
index 78cf17a371730dee226379a221560082a25759fb..264885042720d917eef7257aa32a3a581e9f9e05 100644
--- a/Code/Mantid/docs/source/algorithms/CorrectFlightPaths-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CorrectFlightPaths-v1.rst
@@ -9,12 +9,17 @@
 Description
 -----------
 
-Corrects the flight paths of a flat detector. Both TOF sample-detector
-and distance sample-detector are corrected to constant values, i.e.,
-this algorithm make the detector spherical rather than flat.
+Corrects the flight paths of a flat detector.
 
-detector\_distance must exist in the \_Parameters.xml:
+Both TOF sample-detector and distance sample-detector are corrected to constant values, i.e., this algorithm make the detector spherical rather than flat.
+
+The sample to detector distance must be specified as **l2** in the instrument parameters file.
+
+So far this has only be tested on the ILL IN5.
+
+Note
+###################################
+This algorithm was coded as a proof of concept. It may be deprecated in the future.
 
-So far this has only be tested on ILL IN5.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/CreateFlatEventWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/CreateFlatEventWorkspace-v1.rst
index ce683e022ceb036179c3b6ebe0b262254c3c48c8..d380f18043fa51b67186936c3a38b9ec87d645aa 100644
--- a/Code/Mantid/docs/source/algorithms/CreateFlatEventWorkspace-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CreateFlatEventWorkspace-v1.rst
@@ -9,8 +9,8 @@
 Description
 -----------
 
-TODO: Enter a full wiki-markup description of your algorithm here. You
-can then use the Build/wiki\_maker.py script to generate your full wiki
-page.
+This creates a new event workspace from an existing one by sampling an area of the 
+source workspaces background and then using this to create a new workspace that covers 
+the same data range as the input workspace.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/CreateSingleValuedWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/CreateSingleValuedWorkspace-v1.rst
index ba3f4d5fbd0a5189c7971bdc3a920f581cf901d9..e8156edfd6f47662cadebea2430509a01cec2d14 100644
--- a/Code/Mantid/docs/source/algorithms/CreateSingleValuedWorkspace-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CreateSingleValuedWorkspace-v1.rst
@@ -10,7 +10,65 @@ Description
 -----------
 
 Creates a 2D workspace that contains a single value and an optional
-error value. This is useful if, for example, there is a need to multiply
-(or divide etc) a workspace by a single value.
+error value. This was traditionally used for doing binary operations between
+a workspace and a single value. However, now that the Python access allows
+the standard binary operations with workspaces & single numbers, the requirement
+for this algorithm is almost gone.
+
+One use case for which it will be required is when performing operations using only
+the MantidPlot GUI point-and-click approach.
+
+Usage
+-----
+
+**Workspace with single y value and zero error:**
+
+.. testcode::
+
+   five = CreateSingleValuedWorkspace(5)
+
+   print "Number of histograms:",five.getNumberHistograms()
+   print "Length of y array:",len(five.readY(0))
+   print "Length of e array:",len(five.readE(0))
+   print "Length of x array:",len(five.readX(0))
+
+   print "y value:",five.readY(0)
+   print "e value:",five.readE(0)
+
+Output:
+
+.. testoutput::
+
+   Number of histograms: 1
+   Length of y array: 1
+   Length of e array: 1
+   Length of x array: 1
+   y value: [ 5.]
+   e value: [ 0.]
+
+**Workspace with single y and e value:**
+
+.. testcode::
+
+   five = CreateSingleValuedWorkspace(5, 0.1)
+
+   print "Number of histograms:",five.getNumberHistograms()
+   print "Length of y array:",len(five.readY(0))
+   print "Length of e array:",len(five.readE(0))
+   print "Length of x array:",len(five.readX(0))
+
+   print "y value:",five.readY(0)
+   print "e value:",five.readE(0)
+
+Output:
+
+.. testoutput::
+
+   Number of histograms: 1
+   Length of y array: 1
+   Length of e array: 1
+   Length of x array: 1
+   y value: [ 5.]
+   e value: [ 0.1]
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/CuboidGaugeVolumeAbsorption-v1.rst b/Code/Mantid/docs/source/algorithms/CuboidGaugeVolumeAbsorption-v1.rst
index 455de114992cfe4b0a9a4487a4c14f565dab5199..b013a84a587eb95419da7bc1aae9f98bae22275d 100644
--- a/Code/Mantid/docs/source/algorithms/CuboidGaugeVolumeAbsorption-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CuboidGaugeVolumeAbsorption-v1.rst
@@ -12,12 +12,14 @@ Description
 This algorithm uses a numerical integration method to calculate
 attenuation factors resulting from absorption and single scattering
 within a cuboid region of a sample with the dimensions and material
-properties given. **The gauge volume generated will be an axis-aligned
+properties given. 
+
+The gauge volume generated will be an axis-aligned
 cuboid centred on the sample (centre) position. The sample must fully
 enclose this cuboid. If this does not meet your needs you can instead
 use the general :ref:`algm-AbsorptionCorrection`
 algorithm in conjunction with
-:ref:`algm-DefineGaugeVolume`.**
+:ref:`algm-DefineGaugeVolume`.
 
 Factors are calculated for each spectrum (i.e. detector position) and
 wavelength point, as defined by the input workspace. The sample is
@@ -34,7 +36,7 @@ Restrictions on the input workspace
 ###################################
 
 The input workspace must have units of wavelength. The
-`instrument <instrument>`__ associated with the workspace must be fully
+`instrument <http://www.mantidproject.org/instrument>`__ associated with the workspace must be fully
 defined because detector, source & sample position are needed. A sample
 shape must have been defined using, e.g.,
 :ref:`algm-CreateSampleShape` and the gauge volume must be
diff --git a/Code/Mantid/docs/source/algorithms/DeleteWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/DeleteWorkspace-v1.rst
index 77eb47ce3fd6816075793b33da94451de943141e..a293848c56e8e433347d18ac46ac6741733ca3af 100644
--- a/Code/Mantid/docs/source/algorithms/DeleteWorkspace-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/DeleteWorkspace-v1.rst
@@ -11,4 +11,41 @@ Description
 
 If the input workspace exists then it is removed from Mantid.
 
+Usage
+-----
+
+**Example - Delete using a handle**
+
+.. testcode::
+
+   # A small test workspace, with sample_ws as the handle
+   sample_ws = CreateSingleValuedWorkspace(5.0)
+
+   DeleteWorkspace(sample_ws)
+
+   print "sample_ws exists in mantid:",("sample_ws" in mtd)
+
+Output:
+
+.. testoutput::
+
+   sample_ws exists in mantid: False
+
+**Example - Delete using a string**
+
+.. testcode::
+
+   # A small test workspace, with sample_ws as the handle
+   CreateSingleValuedWorkspace(5.0, OutputWorkspace="single_value")
+
+   DeleteWorkspace("single_value")
+
+   print "single_value exists in mantid:",("single_value" in mtd)
+
+Output:
+
+.. testoutput::
+
+   single_value exists in mantid: False
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/DetectorDiagnostic-v1.rst b/Code/Mantid/docs/source/algorithms/DetectorDiagnostic-v1.rst
index f9d3bbe0b708a5a9fd2ce2a6a31aa62bae6dbe89..5c846fe4a65e744f4c0b946c13067518a5a4098f 100644
--- a/Code/Mantid/docs/source/algorithms/DetectorDiagnostic-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/DetectorDiagnostic-v1.rst
@@ -14,13 +14,13 @@ function located in the scripts/inelastic directory. The algorithm
 expects processed workspaces as input just as the other function did.
 The main functionality of the algorithm is to determine issues with
 detector vanadium runs and mask out bad pixels. The algorithms that are
-run on the detector vanadium are FindDetectorsOutsideLimits and
-MedianDetectorTest. It also performs a second set of diagnostics on
-another detector vanadium run and DetectorEfficiencyVariation on the
+run on the detector vanadium are :ref:`algm-FindDetectorsOutsideLimits` and
+:ref:`algm-MedianDetectorTest`. It also performs a second set of diagnostics on
+another detector vanadium run and :ref:`algm-DetectorEfficiencyVariation` on the
 two. The algorithm also checks processed sample workspaces (total counts
 and background) for bad pixels as well. The total counts workspace is
-tested with FindDetectorsOutsideLimits. The background workspace is run
-through MedianDetector test. A processed sample workspace can be given
-to perform and CreatePSDBleedMask will be run on it.
+tested with :ref:`algm-FindDetectorsOutsideLimits`. The background workspace is run
+through :ref:`algm-MedianDetectorTest`. A processed sample workspace can be given
+to perform and :ref:`algm-CreatePSDBleedMask` will be run on it.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/DiffractionFocussing-v2.rst b/Code/Mantid/docs/source/algorithms/DiffractionFocussing-v2.rst
index a765a7ca6ab02b3d6db3c01121552930e178e1d2..ab00b693af9bc9eabb292f0ee44e778f74fb545c 100644
--- a/Code/Mantid/docs/source/algorithms/DiffractionFocussing-v2.rst
+++ b/Code/Mantid/docs/source/algorithms/DiffractionFocussing-v2.rst
@@ -72,10 +72,6 @@ Usage
 
    print("The 51st y-value is: %.3f" % ws.readY(0)[50])
 
-.. testcleanup:: ExHRPDFocussing
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExHRPDFocussing
@@ -96,10 +92,6 @@ Output:
    print "Number of focussed spectra: " + str(ws.getNumberHistograms())
    print "What type is the workspace after focussing: " + str(type(ws))
 
-.. testcleanup:: ExEventFocussing
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExEventFocussing
diff --git a/Code/Mantid/docs/source/algorithms/ExponentialMD-v1.rst b/Code/Mantid/docs/source/algorithms/ExponentialMD-v1.rst
index ed6216bbc9adaf81659d105f57256521f0076e01..021f257ccabde08b862da3841ea965ee7cb97ab2 100644
--- a/Code/Mantid/docs/source/algorithms/ExponentialMD-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/ExponentialMD-v1.rst
@@ -9,15 +9,15 @@
 Description
 -----------
 
-This executes the exponential function on a MDHistoWorkspace.
+This executes the exponential function on a `MDHistoWorkspace <http://www.mantidproject.org/MDHistoWorkspace>`__.
 
 The signal :math:`a` becomes :math:`f = e^a`
 
 The error :math:`da` becomes :math:`df^2 = f^2 * da^2`
 
 This algorithm cannot be run on a
-`MDEventWorkspace <MDEventWorkspace>`__. Its equivalent on a
-`MatrixWorkspace <MatrixWorkspace>`__ is called
+`MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__. Its equivalent on a
+`MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`__ is called
 :ref:`algm-Exponential`.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/FakeMDEventData-v1.rst b/Code/Mantid/docs/source/algorithms/FakeMDEventData-v1.rst
index ed428847103fb79ba20eee8d4031cd1d02a5c357..f19e0a36793f70a21e344cb84fb3203b4f9167c4 100644
--- a/Code/Mantid/docs/source/algorithms/FakeMDEventData-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/FakeMDEventData-v1.rst
@@ -9,8 +9,9 @@
 Description
 -----------
 
-For testing MDEventWorkspaces, this algorithm either creates a uniform,
-random distribution of events, or generate regular events placed in
-boxes, or fills peaks around given points with a given number of events.
+For testing `MDEventWorkspaces <http://www.mantidproject.org/MDEventWorkspace>`_,
+this algorithm either creates a uniform, random distribution of events, or generate
+regular events placed in boxes, or fills peaks around given points with a given
+number of events.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/FilterByLogValue-v1.rst b/Code/Mantid/docs/source/algorithms/FilterByLogValue-v1.rst
index d495d7886ba3928da4b19d8e029ee660c03b9065..bcdab6452f4c34a27115b57364b713683e9a9930 100644
--- a/Code/Mantid/docs/source/algorithms/FilterByLogValue-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/FilterByLogValue-v1.rst
@@ -65,7 +65,7 @@ rejected. For example, this call will filter out veto pulses:
 Comparing with other event filtering algorithms
 ###############################################
 
-Wiki page `EventFiltering <EventFiltering>`__ has a detailed
+Wiki page `EventFiltering <http://www.mantidproject.org/EventFiltering>`__ has a detailed
 introduction on event filtering in MantidPlot.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/FilterPeaks-v1.rst b/Code/Mantid/docs/source/algorithms/FilterPeaks-v1.rst
index 2a7108b402849f5301d6280facfd1a4b253cdc2b..994994e985fa9bd2eb014ca855f0d4b3eb46eca8 100644
--- a/Code/Mantid/docs/source/algorithms/FilterPeaks-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/FilterPeaks-v1.rst
@@ -9,7 +9,7 @@
 Description
 -----------
 
-Filters a `PeaksWorkspace <PeaksWorkspace>`__ using a set number of
-queries. Outputs a filtered PeaksWorkspace.
+Filters a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__ using a set number of
+queries. Outputs a filtered `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`__.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/FindDetectorsPar-v1.rst b/Code/Mantid/docs/source/algorithms/FindDetectorsPar-v1.rst
index 140fcbb87c0d77b5561129685c8a1151b6fb58e0..943998cbc14a70916d97cf28e7c39f90bab6782f 100644
--- a/Code/Mantid/docs/source/algorithms/FindDetectorsPar-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/FindDetectorsPar-v1.rst
@@ -11,11 +11,14 @@ Description
 
 Identifies geometrical parameters of detectors and groups of detectors
 after the workspaces were grouped using ASCII or XML map file. Located
-in DataHangdling\\Instrument\\Detectors group and intended to be used as
-Child Algorithm of saveNXSPE algorithm, though can be deployed
-independently. Dynamic casting from iAlgorithm and accessors functions
-return calculated parameters to saveNXSPE when FindDetectorsPar used as
-the Child Algorithm of saveNXSPE procedure;
+in DataHandling\\Instrument\\Detectors group and intended to be used as
+Child Algorithm of :ref:`SaveNXSPE <algm-SaveNXSPE>`
+algorithm, though can be deployed independently. Dynamic casting from iAlgorithm
+and accessors functions
+return calculated parameters to :ref:`SaveNXSPE <algm-SaveNXSPE>`
+when FindDetectorsPar used as
+the Child Algorithm of :ref:`SaveNXSPE <algm-SaveNXSPE>`
+procedure;
 
 Internal Child Algorithm identifies the group topology, namely if a
 group of detectors is arranged into a rectangular shape or in a ring.
@@ -31,8 +34,8 @@ After identifying the topology, the parameters are calculated using
 formulas for angles in Cartesian or Cylindrical coordinate systems
 accordingly
 
-`par <SavePAR>`__ and `phx <SavePHX>`__ files
----------------------------------------------
+:ref:`par <algm-SavePAR>` and :ref:`phx <algm-SavePHX>` files
+-------------------------------------------------------------
 
 These files are ascii files which are used to describe the combined
 detectors geometry defined by map files. There are no reasons for you to
@@ -41,18 +44,19 @@ In this case you can quickly modify and use par file until this
 algorithm is modified. It is your responsibility then to assure the
 correspondence between mapped detectors and parameters in the par file.
 
-The par files are simple ASCII files with the following columns:
+The par files are simple ASCII files with the following columns::
 
-| ``       1st column      sample-detector distance (m)``
-| ``       2nd  "          scattering angle (deg)``
-| ``       3rd  "          azimuthal angle (deg)   (west bank = 0 deg, north bank = -90 deg etc.)   (Note the reversed sign convention cf .phx files)``
-| ``       4th  "          width  (m)``
-| ``       5th  "          height (m)``
+    1st column      sample-detector distance (m)
+    2nd  "          scattering angle (deg)
+    3rd  "          azimuthal angle (deg)   (west bank = 0 deg, north bank = -90 deg etc.)   (Note the reversed sign convention cf .phx files)
+    4th  "          width  (m)
+    5th  "          height (m)
 
 When processed by this algorithm, 4th and 5th column are transformed
 into angular values.
 
-`Phx <SavePHX>`__ files are Mslice phx files, which do not contain
+:ref:`Phx <algm-SavePHX>`
+files are Mslice phx files, which do not contain
 secondary flight path. This path is calculated by the algorithm from the
 data in the instrument description and the angular values are calculated
 as in nxspe file. There are no reason to use phx files to build nxspe
diff --git a/Code/Mantid/docs/source/algorithms/Fit-v1.rst b/Code/Mantid/docs/source/algorithms/Fit-v1.rst
index 405db213df1b6bce1708e74b5bfdcfa6660a4ffa..37d69a9d0e1ad29cba19879a983d24846cf463d3 100644
--- a/Code/Mantid/docs/source/algorithms/Fit-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/Fit-v1.rst
@@ -81,14 +81,14 @@ default value defined by the function. All names are case sensitive. For
 example for fitting a Gaussian the Function property might look like
 this:
 
-``Function: "name=Gaussian, PeakCentre=4.6, Height=10, Sigma=0.5"``
+``Function: "name=Gaussian, PeakCentre=4.6, Height=10, Sigma=0.5"``
 
 Some functions have attributes. An attribute is a non-fitting parameter
 and can be of one of the following types: text string, integer, or
 double. Attributes are set just like the parameters using name=value
 pairs. For example:
 
-``Function: "name=UserFunction, Formula=a+b*x, a=1, b=2"``
+``Function: "name=UserFunction, Formula=a+b*x, a=1, b=2"``
 
 In this example Formula is the name of a string attribute which defines
 an expression for the user UserFunction. The fitting parameters a and b
@@ -107,9 +107,9 @@ the Function property. Each simple function definition must be separated
 by a semicolon ';'. For example fitting two Gaussians on a linear
 background might look like this:
 
-| ``Function: "name=LinearBackground, A0=0.3; ``
-| ``           name=Gaussian, PeakCentre=4.6, Height=10, Sigma=0.5;``
-| ``           name=Gaussian, PeakCentre=7.6, Height=8, Sigma=0.5"``
+| ``Function: "name=LinearBackground, A0=0.3; ``
+| ``           name=Gaussian, PeakCentre=4.6, Height=10, Sigma=0.5;``
+| ``           name=Gaussian, PeakCentre=7.6, Height=8, Sigma=0.5"``
 
 Setting ties
 ############
@@ -120,7 +120,7 @@ tying expressions. Use Ties property to set any ties. In case of a
 simple function the parameter names are used as variables in the tying
 expressions. For example
 
-``Ties: "a=2*b+1, c=2"``
+``Ties: "a=2*b+1, c=2"``
 
 This ties parameter "a" to parameter "b" and fixes "c" to the constant
 2.
@@ -136,13 +136,13 @@ part defines the function by its index in the composite function
 (starting at 0). The index corresponds to the order in which the
 functions are defined in the Function property. For example:
 
-``Ties: "f1.Sigma=f0.Sigma,f2.Sigma=f0.Sigma"``
+``Ties: "f1.Sigma=f0.Sigma,f2.Sigma=f0.Sigma"``
 
 This ties parameter "Sigma" of functions 1 and 2 to the "Sigma" of
 function 0. Of course all three functions must have a parameter called
 "Sigma" for this to work. The last example can also be written
 
-``Ties: "f1.Sigma=f2.Sigma=f0.Sigma"``
+``Ties: "f1.Sigma=f2.Sigma=f0.Sigma"``
 
 Setting constraints
 ###################
@@ -155,22 +155,22 @@ The penalty applied is described in more detail
 constraints. In case of a simple function the parameter names are used
 as variables in the constraint expressions. For example
 
-``Constraints: "4.0 < c < 4.2"``
+``Constraints: "4.0 < c < 4.2"``
 
 Constraint the parameter "c" to be with the range 4.0 to 4.2, whereas
 
-``Constraints: "c > 4.0"``
+``Constraints: "c > 4.0"``
 
 means "c" is constrained to be above the lower value 4.0 and
 
-``Constraints: "c < 4.2"``
+``Constraints: "c < 4.2"``
 
 means "c" is constrained to be below the upper value 4.2.
 
 In case of a composite function the same notation is used for
 constraints and for ties. For example
 
-``Constraints: "f1.c < 4.2"``
+``Constraints: "f1.c < 4.2"``
 
 constrain the parameter "c" of function 1.
 
@@ -207,10 +207,10 @@ Examples
 This example shows a simple fit to a Gaussian function. The algorithm
 properties are:
 
-| ``InputWorkspace:  Test``
-| ``WorkspaceIndex:  0``
-| ``Function:        name=Gaussian, PeakCentre=4, Height=1.3, Sigma=0.5``
-| ``Output:          res``
+| ``InputWorkspace:  Test``
+| ``WorkspaceIndex:  0``
+| ``Function:        name=Gaussian, PeakCentre=4, Height=1.3, Sigma=0.5``
+| ``Output:          res``
 
 .. figure:: /images/GaussianFit.jpg
    :alt: GaussianFit.jpg
@@ -221,11 +221,11 @@ properties are:
 
 The next example shows a fit of the same data but with a tie.
 
-| ``InputWorkspace:  Test``
-| ``WorkspaceIndex:  0``
-| ``Function:        name=Gaussian, PeakCentre=4, Height=1.3, Sigma=0.5``
-| ``Ties:            Sigma=Height/2``
-| ``Output:          res``
+| ``InputWorkspace:  Test``
+| ``WorkspaceIndex:  0``
+| ``Function:        name=Gaussian, PeakCentre=4, Height=1.3, Sigma=0.5``
+| ``Ties:            Sigma=Height/2``
+| ``Output:          res``
 
 .. figure:: /images/GaussianFit_Ties.jpg
    :alt: GaussianFit_Ties.jpg
@@ -238,12 +238,12 @@ This example shows a fit of two overlapping Gaussians on a linear
 background. Here we create a composite function with a LinearBackground
 and two Gaussians:
 
-| ``InputWorkspace:  Test``
-| ``WorkspaceIndex:  0``
-| ``Function:        name=LinearBackground,A0=1;``
-| ``                 name=Gaussian,PeakCentre=4,Height=1.5, Sigma=0.5;``
-| ``                 name=Gaussian,PeakCentre=6,Height=4, Sigma=0.5 ``
-| ``Output:          res``
+| ``InputWorkspace:  Test``
+| ``WorkspaceIndex:  0``
+| ``Function:        name=LinearBackground,A0=1;``
+| ``                 name=Gaussian,PeakCentre=4,Height=1.5, Sigma=0.5;``
+| ``                 name=Gaussian,PeakCentre=6,Height=4, Sigma=0.5 ``
+| ``Output:          res``
 
 .. figure:: /images/Gaussian2Fit.jpg
    :alt: Gaussian2Fit.jpg
@@ -255,13 +255,13 @@ and two Gaussians:
 This example repeats the previous one but with the Sigmas of the two
 Gaussians tied:
 
-| ``InputWorkspace:  Test``
-| ``WorkspaceIndex:  0``
-| ``Function:        name=LinearBackground,A0=1;``
-| ``                 name=Gaussian,PeakCentre=4,Height=1.5, Sigma=0.5;``
-| ``                 name=Gaussian,PeakCentre=6,Height=4, Sigma=0.5 ``
-| ``Ties:            f2.Sigma = f1.Sigma``
-| ``Output:          res``
+| ``InputWorkspace:  Test``
+| ``WorkspaceIndex:  0``
+| ``Function:        name=LinearBackground,A0=1;``
+| ``                 name=Gaussian,PeakCentre=4,Height=1.5, Sigma=0.5;``
+| ``                 name=Gaussian,PeakCentre=6,Height=4, Sigma=0.5 ``
+| ``Ties:            f2.Sigma = f1.Sigma``
+| ``Output:          res``
 
 .. figure:: /images/Gaussian2Fit_Ties.jpg
    :alt: Gaussian2Fit_Ties.jpg
@@ -306,10 +306,6 @@ Usage
    print "Number of spectra in fitWorkspace is: " +  str(fitWorkspace.getNumberHistograms())
    print("The 20th y-value of the calculated pattern: %.4f" % fitWorkspace.readY(1)[19])
 
-.. testcleanup:: ExFitPeak
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExFitPeak
diff --git a/Code/Mantid/docs/source/algorithms/GenerateEventsFilter-v1.rst b/Code/Mantid/docs/source/algorithms/GenerateEventsFilter-v1.rst
index 0aef297f849660bc252220a0b48d06480dc2c363..785395b1fc5548797990ccb26e452e19f7fec110 100644
--- a/Code/Mantid/docs/source/algorithms/GenerateEventsFilter-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/GenerateEventsFilter-v1.rst
@@ -11,54 +11,56 @@ Description
 
 This algorithm is able to generate event splitters according to user's
 requirement for filtering events. The generated time splitters are
-stored either in a `SplittersWorkspace <SplittersWorkspace>`__ or a
-`MatrixWorkspace <MatrixWorkspace>`__. Both of them will be used by
-algorithm :ref:`algm-FilterEvents` to filter events from an
-`EventWorkspace <EventWorkspace>`__.
+stored either in a `SplittersWorkspace <http://www.mantidproject.org/SplittersWorkspace>`_ or a
+`MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`_. Both of them will be used by
+algorithm :ref:`FilterEvents <algm-FilterEvents>`
+to filter events from an
+`EventWorkspace <http://www.mantidproject.org/EventWorkspace>`_.
 
 This algorithm is designed as a general-purposed event splitter
-generator. Combined with :ref:`algm-FilterEvents`, it will
-replace
+generator. Combined with :ref:`FilterEvents <algm-FilterEvents>`,
+it will replace
 
--  :ref:`algm-FilterByTime`
--  :ref:`algm-FilterByLogValue`
+-  :ref:`FilterByTime <algm-FilterByTime>`
+-  :ref:`FilterByLogValue <algm-FilterByLogValue>`
 
 Moreover, the time resolution of these two algorithms is microseconds,
 i.e., the wall time of an (neutron) event. While the original
-:ref:`algm-FilterByTime` and
-:ref:`algm-FilterByLogValue` are of the resolution of pulse
-time. It is also enhanced to process the fast frequency sample logs,
-which can be even faster than chopper frequencies.
+:ref:`FilterByTime <algm-FilterByTime>`
+and
+:ref:`FilterByLogValue <algm-FilterByLogValue>`
+are of the resolution of pulse time. It is also enhanced to process the fast
+frequency sample logs, which can be even faster than chopper frequencies.
 
 Workspace to store event splitters
 ##################################
 
 An event splitter used in Mantid contains start time, stop time and
 target workspace. Any data structure that has the above 3 properties can
-serve as event splitter. There are 2 types of output workspaces storing
+serve as an event splitter. There are two types of output workspaces for storing
 event splitters that are supported by this algorithm.
 
--  `SplittersWorkspace <SplittersWorkspace>`__: It is a
-   `TableWorskpace <TableWorskpace>`__ that has 3 columns for start
+-  `SplittersWorkspace <http://www.mantidproject.org/SplittersWorkspace>`_: It is a
+   `TableWorkspace <http://www.mantidproject.org/TableWorkspace>`_ that has 3 columns for start
    time, stop time and target workspace for events within start time and
    stop time. This type of workspace is appropriate for the case that
    the amount of generated event splitters are not huge;
--  `MatrixWorkspace <MatrixWorkspace>`__: It uses X-axis to store time
+-  `MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`_: It uses X-axis to store time
    stamp in total nanoseconds and Y-axis to store target workspace. For
    example, x\_i, x\_i+1 and y\_i construct an event filter as start
-   time is x\_i, stop time is x\_i+i, and target workspace is y\_i-th
+   time is x\_i, stop time is x\_i+1, and target workspace is y\_i-th
    workspace. If y\_i is less than 0, then it means that all events
    between time x\_i and x\_i+1 will be discarded. This type of
    workspace is appropriate for the case that the amount of generated
    event splitters are huge, because processing a
-   `MatrixWorkspace <MatrixWorkspace>`__ is way faster than a
-   `TableWorkspace <TableWorkspace>`__ in Mantid.
+   `MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`_ is way faster than a
+   `TableWorkspace <http://www.mantidproject.org/TableWorkspace>`_ in Mantid.
 
 Functionalities
 ###############
 
 Here are the types of event filters (i.e.,
-`SplittersWorkspace <SplittersWorkspace>`__) that can be generated by
+`SplittersWorkspace <http://www.mantidproject.org/SplittersWorkspace>`_) that can be generated by
 this algorithm:
 
 -  A filter for one time interval.
@@ -101,7 +103,7 @@ be 'tol', and LogValueInterval to be 'delta', then the log value
 intervals are (min-tol, min-tol+delta), (min-tol+delta, min-tol+2delta),
 ...
 
-The default value of LogValueTolerance is LogValueInterval devided by 2.
+The default value of LogValueTolerance is LogValueInterval divided by 2.
 
 About how log value is recorded
 ###############################
@@ -120,11 +122,12 @@ Comparison to FilterByLogValue
 log time is after run star time, FilterByLogValue assumes that the log
 value before the first recorded log time is also within range, and thus
 the first splitter starts from the run star time, while
-GenerateEventFilter tends to be more conservative, and thus the first
+:ref:`GenerateEventsFilter <algm-GenerateEventsFilter>`
+tends to be more conservative, and thus the first
 splitter will start from the first log time.
 
 2. FilterByLogValue only filters events at the resolution of pulse time,
-while :ref:`algm-GenerateEventsFilter` can improve the
-resolution to 1 micro second.
+while :ref:`GenerateEventsFilter <algm-GenerateEventsFilter>` can improve the
+resolution to 1 microsecond.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/GetEi-v1.rst b/Code/Mantid/docs/source/algorithms/GetEi-v1.rst
index dead31615e9abf46d373ba092468926c7f3e8c30..67238db4ac145027184532120e1ab0844f48cc15 100644
--- a/Code/Mantid/docs/source/algorithms/GetEi-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/GetEi-v1.rst
@@ -9,7 +9,8 @@
 Description
 -----------
 
-Uses E= (1/2)mv^2 to calculate the energy of neutrons leaving the
+Uses :math:`E=\frac{1}{2}mv^2`
+to calculate the energy of neutrons leaving the
 source. The velocity is calculated from the time it takes for the
 neutron pulse to travel between the two monitors whose spectra were
 specified.
@@ -36,12 +37,15 @@ peak height locations. The half height points are found as follows:
    arrival time of the neutrons
 
 The above process is illustrated on a peak is shown below in the image
-below |Monitor Peak\|centre\|618px|
+below
+
+.. image:: /images/Monitorspect_getei.jpg
+    :align: center
+    :alt: Monitor Peak
+    :width: 618px
 
 The distances between the monitors are read from the instrument
 definition file. It is assumed that the source and the monitors all lie
 on one line and that the monitors have the same delay time.
 
-.. |Monitor Peak\|centre\|618px| image:: /images/Monitorspect_getei.jpg
-
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/GetEi-v2.rst b/Code/Mantid/docs/source/algorithms/GetEi-v2.rst
index b15f0c5ad98168e97074398176ef2f722f5b961f..744b6b74cdfd766f9a6ebf3436734699acabe9ff 100644
--- a/Code/Mantid/docs/source/algorithms/GetEi-v2.rst
+++ b/Code/Mantid/docs/source/algorithms/GetEi-v2.rst
@@ -9,7 +9,8 @@
 Description
 -----------
 
-Uses E= (1/2)mv^2 to calculate the energy of neutrons leaving the
+Uses :math:`E=\frac{1}{2}mv^2`
+to calculate the energy of neutrons leaving the
 source. The velocity is calculated from the time it takes for the
 neutron pulse to travel between the two monitors whose spectra were
 specified. If no spectra are specified, the algorithm will use the
@@ -19,7 +20,7 @@ An initial energy guess is required for the algorithm to find the
 correct peak. The analysis will be done on the highest peak that is
 within 8% of the estimated TOF given by the estimate. If no initial
 guess is given, the algorithm will try to get it from the workspace,
-from a sample log variable called "EnergyRequest".
+from a sample log variable called *EnergyRequest*.
 
 Not all neutrons arrive at the monitors at the same time because their
 kinetic energies, and therefore velocities, are all different. The time
@@ -39,12 +40,15 @@ peak height locations. The half height points are found as follows:
    arrival time of the neutrons
 
 The above process is illustrated on a peak is shown below in the image
-below |Monitor Peak\|centre\|618px|
+below.
+
+.. image:: /images/Monitorspect_getei.jpg
+    :align: center
+    :width: 618px
+    :alt: Monitor Peak
 
 The distances between the monitors are read from the instrument
 definition file. It is assumed that the source and the monitors all lie
 on one line and that the monitors have the same delay time.
 
-.. |Monitor Peak\|centre\|618px| image:: /images/Monitorspect_getei.jpg
-
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/IQTransform-v1.rst b/Code/Mantid/docs/source/algorithms/IQTransform-v1.rst
index d777a7c597a479c9b0b53886070273a58bbcc38f..6a001a20d9c0823e6bd549031500f1d2edad6cf3 100644
--- a/Code/Mantid/docs/source/algorithms/IQTransform-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/IQTransform-v1.rst
@@ -45,10 +45,78 @@ always point data.
 +-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
 | Log-Log               | :math:`\ln(I)`                                                                                | :math:`\ln(Q)`                                                                                   |
 +-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
-| General \*            | :math:`Q^{C_1} \times I^{C_2} \times \ln{\left( Q^{C_3} \times I^{C_4} \times C_5 \right)}`   | :math:`Q^{C_6} \times I^{C_7} \times \ln{\left( Q^{C_8} \times I^{C_9} \times C_{10} \right)}`   |
+| General [*]_          | :math:`Q^{C_1} \times I^{C_2} \times \ln{\left( Q^{C_3} \times I^{C_4} \times C_5 \right)}`   | :math:`Q^{C_6} \times I^{C_7} \times \ln{\left( Q^{C_8} \times I^{C_9} \times C_{10} \right)}`   |
 +-----------------------+-----------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+
 
-\* The constants :math:`C_1 - C_{10}` are, in subscript order, the ten
-constants passed to the GeneralFunctionConstants property.
+.. [*] The constants :math:`C_1 - C_{10}` are, in subscript order, the ten constants passed to the GeneralFunctionConstants property.
+
+Usage
+-----
+
+**Example - Zimm transformation:**
+
+.. testcode:: ExZimm
+
+   x = [1,2,3]
+   y = [1,2,3]
+   input = CreateWorkspace(x,y)
+   input.getAxis(0).setUnit("MomentumTransfer")
+   input.setDistribution(True)
+
+   output = IQTransform(input, 'Zimm')
+
+   print 'Output Y:', output.readY(0)
+   print 'Output X:', output.readX(0)
+Output:
+
+.. testoutput:: ExZimm
+
+   Output Y: [ 1.          0.5         0.33333333]
+   Output X: [ 1.  4.  9.]
+
+**Example - Zimm transformation and background:**
+
+.. testcode:: ExZimmBg
+
+   x = [1,2,3]
+   y = [1,2,3]
+   input = CreateWorkspace(x,y)
+   input.getAxis(0).setUnit("MomentumTransfer")
+   input.setDistribution(True)
+
+   output = IQTransform(input, 'Zimm', BackgroundValue=0.5)
+
+   print 'Output Y:', output.readY(0)
+   print 'Output X:', output.readX(0)
+Output:
+
+.. testoutput:: ExZimmBg
+
+   Output Y: [ 2.          0.66666667  0.4       ]
+   Output X: [ 1.  4.  9.]
+
+**Example - General transformation:**
+
+.. testcode:: ExGeneral
+
+   import math
+
+   x = [1,2,3]
+   y = [1,2,3]
+   input = CreateWorkspace(x,y)
+   input.getAxis(0).setUnit("MomentumTransfer")
+   input.setDistribution(True)
+
+   constants = [2,2,0,0,math.e,3,0,0,0,math.e]
+   output = IQTransform(input, 'General', GeneralFunctionConstants=constants)
+
+   print 'Output Y:', output.readY(0)
+   print 'Output X:', output.readX(0)
+Output:
+
+.. testoutput:: ExGeneral
+
+   Output Y: [  1.  16.  81.]
+   Output X: [  1.   8.  27.]
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/IndexSXPeaks-v1.rst b/Code/Mantid/docs/source/algorithms/IndexSXPeaks-v1.rst
index 1bf0ed7661d98bfd07ea4836ccb458ec358894a6..6fdbf155dd3aca6a6389d77a0c690c5e9f2f6aa8 100644
--- a/Code/Mantid/docs/source/algorithms/IndexSXPeaks-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/IndexSXPeaks-v1.rst
@@ -9,7 +9,7 @@
 Description
 -----------
 
-Given a PeaksWorkspace and a set of lattice parameters, attempts to tag
+Given a `PeaksWorkspace <http://www.mantidproject.org/PeaksWorkspace>`_ and a set of lattice parameters, attempts to tag
 each peak with a HKL value by comparing d-spacings between potential HKL
 matches and the peaks as well as angles between Q vectors.
 
@@ -17,8 +17,9 @@ Usage Notes
 -----------
 
 This algorithm does not generate a UB Matrix, it will only index peaks.
-Run CalculateUMatrix algorithm after executing this algorithm in order
-to attach a UB Matrix onto the sample. The CopySample algorithm will
-allow this UB Matrix to be transfered between workspaces.
+Run :ref:`CalculateUMatrix <algm-CalculateUMatrix>`
+algorithm after executing this algorithm in order
+to attach a UB Matrix onto the sample. The :ref:`CopySample <algm-CopySample>`
+algorithm will allow this UB Matrix to be transfered between workspaces.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/IntegratePeaksUsingClusters-v1.rst b/Code/Mantid/docs/source/algorithms/IntegratePeaksUsingClusters-v1.rst
index f8c04005e6947777758ea55363a6f33fad9d42b5..54100d3cd32e549b590ca2af51550a02ccb9b3f9 100644
--- a/Code/Mantid/docs/source/algorithms/IntegratePeaksUsingClusters-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/IntegratePeaksUsingClusters-v1.rst
@@ -26,10 +26,7 @@ work.
 .. figure:: /images/ClusterImage.png
    :alt: ClusterImage.png
 
-   ClusterImage.png
-*Cluster Label region displayed in the `SliceViewer <SliceViewer>`__.
-Peak centre is marked with an X. The green circle illustrates the
-integration region used by :ref:`algm-IntegratePeaksMD`*
+   Cluster Label region displayed in the SliceViewer. Peak centre is marked with an X. The green circle illustrates the integration region used by :ref:`algm-IntegratePeaksMD`
 
 A threshold for the Peak should be defined below which, parts of the
 image are treated as background. The normalization method in combination
@@ -91,4 +88,23 @@ resolve this problem.
 For more in-depth analysis, the algorithm will produce debug log
 messages.
 
+Usage
+-----
+
+**Example - Simple Integration of TOPAZ data**
+
+.. testcode:: IntegratePeaksUsingClustersExample
+
+   # Load an MDEventWorkspace (QLab) containing some SC diffration peaks
+   mdew = Load("TOPAZ_3680_5_sec_MDEW.nxs")
+   # The following algorithms need to know that frame to use, this is an older file. Newer files will automaticall have this.
+   SetSpecialCoordinates(InputWorkspace=mdew, SpecialCoordinates='Q (lab frame)')
+   # Find the 5 most intense peaks
+   peaks = FindPeaksMD(InputWorkspace=mdew, MaxPeaks=5)
+   # Bin to a 100 by 100 by 100 image. A 300 by 300 by 300 image is better.
+   mdhw = BinMD(InputWorkspace=mdew, AxisAligned=True,AlignedDim0='Q_lab_x,0,8,100', AlignedDim1='Q_lab_y,-10,10,100', AlignedDim2='Q_lab_z,0,10,100') 
+   # Perform the integration
+   integrated_peaks, cluster_image = IntegratePeaksUsingClusters(InputWorkspace=mdhw, PeaksWorkspace=peaks, Threshold=1e7)
+
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/InterpolatingRebin-v1.rst b/Code/Mantid/docs/source/algorithms/InterpolatingRebin-v1.rst
index 384db8926c6a4a42601f15d7801f19c663b7a0df..c9950f6cf0e7e387dfa040d4fdda03b64e062daf 100644
--- a/Code/Mantid/docs/source/algorithms/InterpolatingRebin-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/InterpolatingRebin-v1.rst
@@ -9,12 +9,12 @@
 Description
 -----------
 
-This algorithms is useful for increasing the time resolution of spectra
+This algorithm is useful for increasing the time resolution of spectra
 whose bins have large numbers of counts which vary smoothly e.g. monitor
 spectra.
 
 The "params" property defines the new bin boundaries using the same
-syntax as in :ref:`algm-Rebin`. That is, the first number is the first
+syntax as in :ref:`Rebin <algm-Rebin>`. That is, the first number is the first
 bin boundary and the second number is the width of the bins. Bins are
 created until the third number would be exceeded, the third number is
 the x-value of the last bin. There can be further pairs of numbers, the
@@ -28,7 +28,7 @@ that any of these space filling bins cannot be less than 25% or more
 than 125% of the width that was specified.
 
 To calculate the y-values the input spectra are approximated with a time
-series where the value at the center of each bin mean is the mean count
+series where the value at the center of each bin is the mean count
 rate over the bin. This series is interpolated by calculating cubic
 splines that fit this series and evaluating the splines at the centers
 of the requested bin. The splines have natural boundary conditions and
@@ -43,11 +43,34 @@ respective input bin data points.
 Example Rebin param strings
 ###########################
 
-The same syntax as for :ref:`algm-Rebin`
+The input rebin parameter string is identical to that used by :ref:`Rebin <rebin-example-strings>`.
 
-0,100,20000
-    From 0 rebin in constant size bins of 100 up to 20,000
-0,100,10000,200,20000
-    From 0 rebin in steps of 100 to 10,000 then steps of 200 to 20,000
+Usage
+-----
+
+**Example - rebin with single bin width:**
+
+.. testcode::
+
+   # create histogram workspace
+   dataX = [0,1,2,3,4,5,6,7,8,9] # or use dataX=range(0,10)
+   dataY = [1,1,1,1,1,1,1,1,1] # or use dataY=[1]*9
+   ws = CreateWorkspace(dataX, dataY)
+
+   # rebin from min to max with size bin = 0.5
+   ws = InterpolatingRebin(ws, 0.5)
+
+   print "First 5 rebinned X values are:", ws.readX(0)[0:5]
+   print "First 5 rebinned Y values are:", ws.readY(0)[0:5]
+
+Output:
+
+.. testoutput::
+
+   First 5 rebinned X values are: [ 0.   0.5  1.   1.5  2. ]
+   First 5 rebinned Y values are: [ 0.5  0.5  0.5  0.5  0.5]
+
+
+For further examples with more complex parameter strings see :ref:`Rebin examples <rebin-usage>`.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/Load-v1.rst b/Code/Mantid/docs/source/algorithms/Load-v1.rst
index d6fe705bb35382e604e9d6f8566019a3f905d057..e95246f07bfed839da97b39950e37b7da6016db7 100644
--- a/Code/Mantid/docs/source/algorithms/Load-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/Load-v1.rst
@@ -41,10 +41,6 @@ Usage
 
    print "The 1st x-value of the first spectrum is: " + str(ws.readX(0)[0])
 
-.. testcleanup:: ExLoadISISnexusHist
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExLoadISISnexusHist
@@ -61,10 +57,6 @@ Output:
 
    print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())
 
-.. testcleanup:: ExLoadEventNexus
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExLoadEventNexus
@@ -81,10 +73,6 @@ Output:
 
    print "The number of periods (entries) is: " + str(ws[0].getNumberOfEntries())
 
-.. testcleanup:: ExLoadISISMuon
-
-   DeleteWorkspace(ws[0])
-
 Output:
 
 .. testoutput:: ExLoadISISMuon
@@ -101,10 +89,6 @@ Output:
 
    print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())
 
-.. testcleanup:: ExLoadNexusProcessedWithLoad
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExLoadNexusProcessedWithLoad
diff --git a/Code/Mantid/docs/source/algorithms/LoadCalFile-v1.rst b/Code/Mantid/docs/source/algorithms/LoadCalFile-v1.rst
index 74c031c5beca54f4f296f1dc6c4ad37f964523d5..ec01134109687e53dbc58fad0e4085707669aaeb 100644
--- a/Code/Mantid/docs/source/algorithms/LoadCalFile-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadCalFile-v1.rst
@@ -10,8 +10,7 @@ Description
 -----------
 
 This algorithm loads an ARIEL-style 5-column ASCII .cal file into up to
-3 workspaces: a GroupingWorkspace, OffsetsWorkspace and/or
-MaskWorkspace.
+3 workspaces: a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.
 
 The format is
 
diff --git a/Code/Mantid/docs/source/algorithms/LoadDspacemap-v1.rst b/Code/Mantid/docs/source/algorithms/LoadDspacemap-v1.rst
index 0b500ad5c59980fdacb79e764b70ef6c3a1ca446..d41c10ea7921548d73c57a10bbaa68079a67fa55 100644
--- a/Code/Mantid/docs/source/algorithms/LoadDspacemap-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadDspacemap-v1.rst
@@ -13,6 +13,6 @@ Loads a Dspacemap file (POWGEN binary, VULCAN binary or ascii format)
 into an OffsetsWorkspace.
 
 The resulting workspace can then be used with, e.g.
-:ref:`algm-AlignDetectors` to perform calibration.
+:ref:`AlignDetectors <algm-AlignDetectors>` to perform calibration.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/LoadISISNexus-v2.rst b/Code/Mantid/docs/source/algorithms/LoadISISNexus-v2.rst
index c0a2bb50ea146481f20ddd6488394d16f9023ad6..14688aaa39fd06287975fe14093f6d2281ada371 100644
--- a/Code/Mantid/docs/source/algorithms/LoadISISNexus-v2.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadISISNexus-v2.rst
@@ -25,10 +25,6 @@ Usage
 
    print "The 1st x-value of the first spectrum is: " + str(ws.readX(0)[0])
 
-.. testcleanup:: ExLoadISISnexus
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExLoadISISnexus
@@ -44,10 +40,6 @@ Output:
 
    print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())
 
-.. testcleanup:: ExLoadSpectrumMinMax
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExLoadSpectrumMinMax
@@ -63,10 +55,6 @@ Output:
 
    print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())
 
-.. testcleanup:: ExLoadEntryNumber
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExLoadEntryNumber
diff --git a/Code/Mantid/docs/source/algorithms/LoadLogsForSNSPulsedMagnet-v1.rst b/Code/Mantid/docs/source/algorithms/LoadLogsForSNSPulsedMagnet-v1.rst
index c4554e52ebb2f888fcd67c262dfcbdd19d22bef4..1f30311815f5c4d86524e3eda90682b28b8aae1c 100644
--- a/Code/Mantid/docs/source/algorithms/LoadLogsForSNSPulsedMagnet-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadLogsForSNSPulsedMagnet-v1.rst
@@ -9,6 +9,8 @@
 Description
 -----------
 
+.. warning::
 
+    This algorithm is deprecated and should not be used.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/LoadNexus-v1.rst b/Code/Mantid/docs/source/algorithms/LoadNexus-v1.rst
index f5fd03f275f8e426f4855f6a2d79e5f202ef0f2b..a599f8e72453f8175fe2ac0254062ca53b6aca75 100644
--- a/Code/Mantid/docs/source/algorithms/LoadNexus-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadNexus-v1.rst
@@ -39,10 +39,6 @@ Usage
 
    print "The 1st x-value of the first spectrum is: " + str(ws.readX(0)[0])
 
-.. testcleanup:: ExLoadISISnexus
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExLoadISISnexus
@@ -59,10 +55,6 @@ Output:
 
    print "The number of periods (entries) is: " + str(ws[0].getNumberOfEntries())
 
-.. testcleanup:: ExLoadISISMuon
-
-   DeleteWorkspace(ws[0])
-
 Output:
 
 .. testoutput:: ExLoadISISMuon
@@ -79,10 +71,6 @@ Output:
 
    print "The number of histograms (spectra) is: " + str(ws.getNumberHistograms())
 
-.. testcleanup:: ExLoadNexusProcessedWithLoadNexus
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExLoadNexusProcessedWithLoadNexus
diff --git a/Code/Mantid/docs/source/algorithms/LoadNexusLogs-v1.rst b/Code/Mantid/docs/source/algorithms/LoadNexusLogs-v1.rst
index 15bfe49774a275e7f8c473830b0ae1bd28f643c5..458742dab8d2bc7835e62df882b55cae489b092b 100644
--- a/Code/Mantid/docs/source/algorithms/LoadNexusLogs-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadNexusLogs-v1.rst
@@ -9,12 +9,14 @@
 Description
 -----------
 
-The LoadNexusLogs algorithm loads the sample logs from the given nexus
-file. The logs are visible from MantidPlot if you right-click on a
-workspace and select "Sample Logs...".
+The :ref:`LoadNexusLogs <algm-LoadNexusLogs>`
+algorithm loads the sample logs from the given `NeXus <http://www.nexusformat.org>`_
+file. The logs are visible from MantidPlot if you right-click on a workspace and
+select "Sample Logs...".
 
-If you use :ref:`algm-LoadEventNexus` or
-:ref:`algm-LoadISISNexus`, calling this algorithm is not
-necessary, since it called as a child algorithm.
+If you use :ref:`LoadEventNexus <algm-LoadEventNexus>`
+or
+:ref:`LoadISISNexus <algm-LoadISISNexus>`,
+calling this algorithm is not necessary, since it called as a child algorithm.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/LoadParameterFile-v1.rst b/Code/Mantid/docs/source/algorithms/LoadParameterFile-v1.rst
index 4acfca00f2ba95680a2a3f7b64a3c0c94eb6758d..559b44a5560a1f00821ee784f43d7d3f28fba49f 100644
--- a/Code/Mantid/docs/source/algorithms/LoadParameterFile-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadParameterFile-v1.rst
@@ -8,13 +8,17 @@
 
 Description
 -----------
+ 
+.. role:: xml(code)
+   :language: xml
 
 This algorithm allows instrument parameters to be specified in a
-separate file from the `IDF <InstrumentDefinitionFile>`__. The required
+separate file from the `IDF <http://www.mantidproject.org/InstrumentDefinitionFile>`__. The required
 format for this file is identical to that used for defining parameters
-through s in an IDF. Below is an example of how to define a parameter
+through :xml:`<component-link>` s in an 
+`IDF <http://www.mantidproject.org/InstrumentDefinitionFile>`__. Below is an example of how to define a parameter
 named 'test' to be associated with a component named 'bank\_90degnew'
-defined in the IDF of the HRPD instrument:
+defined in the `IDF <http://www.mantidproject.org/InstrumentDefinitionFile>`__ of the HRPD instrument:
 
 .. code-block:: xml
 
diff --git a/Code/Mantid/docs/source/algorithms/LoadSpec-v1.rst b/Code/Mantid/docs/source/algorithms/LoadSpec-v1.rst
index 69fc7c308deba2ea5da0fda6a7b26d5b01d2f16e..cd234f79be9301b169c45386e8381b69948d7276 100644
--- a/Code/Mantid/docs/source/algorithms/LoadSpec-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadSpec-v1.rst
@@ -10,8 +10,8 @@ Description
 -----------
 
 The LoadSpec algorithm reads in spectra data from a text file and stores
-it in a Workspace2D as data points. The data in the file must be
-organized by set of 3 columns (separated by any number of spaces). The
+it in a `Workspace2D <http://www.mantidproject.org/Workspace2D>`__ as data points. 
+The data in the file must be organized by set of 3 columns (separated by any number of spaces). The
 first column has to be the X values, the second column the Y values and
 the third column the error values.
 
@@ -38,7 +38,7 @@ LoadSpec:
     5.0   25.0  3.2
     6.0   30.0  4.2
 
-This will create a Workspace2D with 1 spectrum.
+This will create a `Workspace2D <http://www.mantidproject.org/Workspace2D>`__ with 1 spectrum.
 
 *Example 2:*
 
@@ -71,6 +71,6 @@ This will create a Workspace2D with 1 spectrum.
     2.0   210.0  3.0
     3.0   215.0  4.0
 
-This text file will create a Workspace2D with 3 spectra.
+This text file will create a `Workspace2D <http://www.mantidproject.org/Workspace2D>`__ with 3 spectra.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/LoadVesuvio-v1.rst b/Code/Mantid/docs/source/algorithms/LoadVesuvio-v1.rst
index b9464cc30c6555f9da0b372da3a92a98b019605c..534e896c3d87ba380de1d316e121373342a7086c 100644
--- a/Code/Mantid/docs/source/algorithms/LoadVesuvio-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadVesuvio-v1.rst
@@ -9,7 +9,83 @@
 Description
 -----------
 
-A Workflow algorithm to load the data from the VESUVIO instrument at
-ISIS.
+The `Vesuvio <http://www.isis.stfc.ac.uk/instruments/vesuvio/vesuvio4837.html>`__ instrument at ISIS produces
+`RAW <http://www.mantidproject.org/RAW_File>` files in the standard format. However, due to the unique design
+of the instrument the raw counts from the input files must be manipulated before they are considered useful.
+
+This algorithm wraps calls to :ref:`LoadRaw <algm-LoadRaw>` and computes the counts (:math:`\mu s^{-1}`) using the
+foil-cycling method described `here <http://m.iopscience.iop.org/0957-0233/23/4/045902/pdf/0957-0233_23_4_045902.pdf>`__.
+
+The output is point data and not a histogram.
+
+IP File
+#######
+
+There is an option to specify an ascii instrument parameter file to specify new detector positions along with a *t0* delay
+time parameter for each detector.
+
+Usage
+-----
+
+**Load a single file & spectrum with default difference:**
+
+.. code-block:: python
+
+   tof = LoadVesuvio("14188",SpectrumList=135)
+
+   print "Number of spectra:", tof.getNumberHistograms()
+
+Output::
+
+   Number of spectra: 1
+
+**Sum runs on single spectrum with default difference:**
+
+.. code-block:: python
+
+   tof = LoadVesuvio("14188-14193",SpectrumList=135)
+
+   print "Number of spectra:", tof.getNumberHistograms()
+
+Output::
+
+   Number of spectra: 1
+
+**Sum runs on a range of spectra with default difference:**
+
+.. code-block:: python
+
+   tof = LoadVesuvio("14188-14193",SpectrumList="135-142")
+
+   print "Number of spectra:", tof.getNumberHistograms()
+
+Output::
+
+   Number of spectra: 8
+
+**Sum runs and spectra on a range of spectra with default difference:**
+
+.. code-block:: python
+
+   tof = LoadVesuvio("14188-14193",SpectrumList="135-142", SumSpectra=True)
+
+   print "Number of spectra:", tof.getNumberHistograms()
+
+Output::
+
+   Number of spectra: 1
+
+**Sum runs and spectra on a range of spectra using single difference method:**
+
+.. code-block:: python
+
+   tof = LoadVesuvio("14188-14193",SpectrumList="135-142", SumSpectra=True,
+                     Mode="SingleDifference")
+
+   print "Number of spectra:", tof.getNumberHistograms()
+
+Output::
+
+   Number of spectra: 1
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/LogarithmMD-v1.rst b/Code/Mantid/docs/source/algorithms/LogarithmMD-v1.rst
index 12fe0a2ee96bac96b95171c2bd4a3899cb5fd1f2..beea139ce0b28cfaf6b6647ce469fce98d5e6c1a 100644
--- a/Code/Mantid/docs/source/algorithms/LogarithmMD-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LogarithmMD-v1.rst
@@ -9,15 +9,15 @@
 Description
 -----------
 
-This executes the natural logarithm operation on a MDHistoWorkspace.
+This executes the natural logarithm operation on a `MDHistoWorkspace <http://www.mantidproject.org/MDHistoWorkspace>`__.
 
 The signal :math:`a` becomes :math:`f = log(a)`
 
 The error :math:`da` becomes :math:`df^2 = a^2 / da^2`
 
 This algorithm cannot be run on a
-`MDEventWorkspace <MDEventWorkspace>`__. Its equivalent on a
-`MatrixWorkspace <MatrixWorkspace>`__ is called
+`MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__. Its equivalent on a
+`MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`__ is called
 :ref:`algm-Logarithm`.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/MaskMD-v1.rst b/Code/Mantid/docs/source/algorithms/MaskMD-v1.rst
index b38159bc810a1d1889a3194c4e126e0675fd46c7..0984a1f2784e50ea09b91a773e61da9d4f14a743 100644
--- a/Code/Mantid/docs/source/algorithms/MaskMD-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/MaskMD-v1.rst
@@ -9,7 +9,7 @@
 Description
 -----------
 
-This algorithm masks a `MDWorkspace <MDWorkspace>`__ in-situ.
+This algorithm masks a `MDWorkspace <http://www.mantidproject.org/MDWorkspace>`__ in-situ.
 
 This algorithm will first clear-out any existing masking and then apply
 the new masking.
@@ -18,7 +18,7 @@ Simple Example
 --------------
 
 Mask as single box region in a 3D workspace with Dimension ids X, Y, Z.
-Suppose that the dimensions exented from -2 to 2 in each dimension and
+Suppose that the dimensions extended from -2 to 2 in each dimension and
 you want to mask the central region.
 
 ``MaskMD("Workspace"=workspace,Dimensions="X,Y,Z",Exents="-1,1,-1,1,-1,1")``
@@ -34,10 +34,10 @@ workspace.
 
 In this example, because the dimensionality is 3 and because 6 dimension
 ids have been provided, the algorithm treats {X,Y,Z} as one masking
-region and the following {X,Y,Z} as another. Likewise of the 12, Extents
-inputs provided, the first 6 entries {-2,-1,-2,-1,-2,-1} are min, max
+region and the following {X,Y,Z} as another. Likewise of the 12 extents
+inputs provided; the first 6 entries {-2,-1,-2,-1,-2,-1} are min/max
 values for the first {X,Y,Z} and the latter 6 {+1,+2,+1,+2,+1,+2} relate
-to the last {X,Y,Z}. Applying this maksing will result in two completely
+to the last {X,Y,Z}. Applying this masking will result in two completely
 separate areas masked in a single call to the algorithm.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/Mean-v1.rst b/Code/Mantid/docs/source/algorithms/Mean-v1.rst
index 2630326a79f5400f623073f4a6a8565414bbcc73..e8ad20b79acc58d16210736ee55609cfa369b838 100644
--- a/Code/Mantid/docs/source/algorithms/Mean-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/Mean-v1.rst
@@ -9,7 +9,46 @@
 Description
 -----------
 
-Calculates the mean of the workspaces provided. Output workspace is
-identical in shape to the input workspaces.
+Calculates the arithmetic mean of the *y* values of the workspaces provided. If each input workspace is labelled :math:`w_i` and there 
+are *N* workspaces then the mean is computed as:
+
+.. math::
+
+   m = \frac{1}{N} \sum_{i=0}^{N-1} w_i
+
+where *m* is the output workspace. The *x* values are copied from the first input workspace.
+
+Restrictions
+############
+
+All input workspaces must have the same shape.
+
+Usage:
+------
+
+**Example: Simple mean of two workspaces**
+
+.. testcode::
+
+   # Create two  2-spectrum workspaces with Y values 1->8 & 3->10
+   dataX = [0,1,2,3,4,
+            0,1,2,3,4]
+   dataY = [1,2,3,4,
+            5,6,7,8]
+   ws_1 = CreateWorkspace(dataX, dataY, NSpec=2)
+   dataY = [3,4,5,6,
+            7,8,9,10]
+   ws_2 = CreateWorkspace(dataX, dataY, NSpec=2)
+
+   result = Mean("ws_1, ws_2") # note the comma-separate strings
+   print "Mean of y values in first spectrum:", result.readY(0)
+   print "Mean of y values in second spectrum:", result.readY(1)
+
+Output:
+
+.. testoutput::
+
+   Mean of y values in first spectrum: [ 2.  3.  4.  5.]
+   Mean of y values in second spectrum: [ 6.  7.  8.  9.]
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/MuonCalculateAsymmetry-v1.rst b/Code/Mantid/docs/source/algorithms/MuonCalculateAsymmetry-v1.rst
index a0b012ed9934c7a68406451db3d784530a74e6ce..dfd89f3bc18e71ea25e5705c24ec4ce04636d44d 100644
--- a/Code/Mantid/docs/source/algorithms/MuonCalculateAsymmetry-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/MuonCalculateAsymmetry-v1.rst
@@ -24,4 +24,54 @@ For every mode, either one or two data acquisition period workspaces can
 be provided. PeriodOperation determines in which way period data will be
 merged at the end.
 
+Usage
+-----
+
+**Example - Pair asymmetry for a single period:**
+
+.. testcode:: ExPairAsymmetry
+
+   y = [1,2,3] + [4,5,6]
+   x = [1,2,3] * 2
+   input = CreateWorkspace(x, y, NSpec=2)
+
+   output = MuonCalculateAsymmetry(FirstPeriodWorkspace = input,
+                                   OutputType = 'PairAsymmetry',
+                                   PairFirstIndex = 1,
+                                   PairSecondIndex = 0,
+                                   Alpha = 0.5)
+
+   print 'Output:', output.readY(0)
+
+Output:
+
+.. testoutput:: ExPairAsymmetry
+
+   Output: [ 0.77777778  0.66666667  0.6       ]
+
+**Example - Group asymmetry for two periods:**
+
+.. testcode:: ExGroupAsymmetryMultiperiod
+
+   y1 = [100,50,10]
+   y2 = [150,20,1]
+   x = [1,2,3]
+
+   input1 = CreateWorkspace(x, y1)
+   input2 = CreateWorkspace(x, y2)
+
+   output = MuonCalculateAsymmetry(FirstPeriodWorkspace = input1,
+                                   SecondPeriodWorkspace = input2,
+                                   PeriodOperation = '-',
+                                   OutputType = 'GroupAsymmetry',
+                                   GroupIndex = 0)
+
+   print 'Output:', output.readY(0)
+
+Output:
+
+.. testoutput:: ExGroupAsymmetryMultiperiod
+
+   Output: [-0.28634067  0.60594273  0.26255546]
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/MuonGroupDetectors-v1.rst b/Code/Mantid/docs/source/algorithms/MuonGroupDetectors-v1.rst
index 31d970669074913ff39f5611334e86e94df9c151..aa690e34087bac8b0e1257815646fa6a00eeb51a 100644
--- a/Code/Mantid/docs/source/algorithms/MuonGroupDetectors-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/MuonGroupDetectors-v1.rst
@@ -22,4 +22,67 @@ std::invalid\_argument exceptions are thrown if table format is not
 correct, there are no non-empty groups or one of the detector IDs does
 not exist in the workspace.
 
+Usage
+-----
+
+.. include:: ../usagedata-note.txt
+
+**Example - Grouping MUSR data:**
+
+.. testcode:: ExGroupMUSR
+
+   # Load first period of a MUSR data file
+   ws = LoadMuonNexus('MUSR00015189.nxs', EntryNumber=1)
+
+   # Create a table with some custom grouping
+   grouping = CreateEmptyTableWorkspace()
+   grouping.addColumn('vector_int', 'detectors')
+
+   # 3 rows = 3 groups
+   grouping.addRow([range(1,6)])
+   grouping.addRow([range(6,11)])
+   grouping.addRow([[2,3,4]])
+
+   grouped = MuonGroupDetectors('ws', 'grouping')
+
+   print 'No. of spectra in grouped workspace:', grouped.getNumberHistograms()
+   print 'Detectors grouped in spectra 0:', list(grouped.getSpectrum(0).getDetectorIDs())
+   print 'Detectors grouped in spectra 1:', list(grouped.getSpectrum(1).getDetectorIDs())
+   print 'Detectors grouped in spectra 2:', list(grouped.getSpectrum(2).getDetectorIDs())
+
+Output:
+
+.. testoutput:: ExGroupMUSR
+
+   No. of spectra in grouped workspace: 3
+   Detectors grouped in spectra 0: [1, 2, 3, 4, 5]
+   Detectors grouped in spectra 1: [6, 7, 8, 9, 10]
+   Detectors grouped in spectra 2: [2, 3, 4]
+
+
+**Example - Using grouping from data file:**
+
+.. testcode:: ExGroupingFromNexus
+
+   # Load MUSR grouping from the Nexus file
+   __unused_ws = LoadMuonNexus('MUSR00015189.nxs', DetectorGroupingTable='grouping')
+
+   # Load data from a different MUSR file
+   ws = LoadMuonNexus('MUSR00015190.nxs')
+
+   # Use grouping from one file to group data from different file
+   grouped = MuonGroupDetectors('ws', 'grouping')
+
+   print 'No. of periods loaded:', grouped.size()
+   print 'No. of grouped spectra in first period:', grouped.getItem(0).getNumberHistograms()
+   print 'No. of grouped spectra in second period:', grouped.getItem(1).getNumberHistograms()
+
+Output:
+
+.. testoutput:: ExGroupingFromNexus
+
+   No. of periods loaded: 2
+   No. of grouped spectra in first period: 2
+   No. of grouped spectra in second period: 2
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/MuonLoad-v1.rst b/Code/Mantid/docs/source/algorithms/MuonLoad-v1.rst
index 3fa577e5b3d1f597496d1499ca3b4d86e6c60332..b1235ede4579fbd11fe0f03ebf4cb37bfd1c3be8 100644
--- a/Code/Mantid/docs/source/algorithms/MuonLoad-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/MuonLoad-v1.rst
@@ -18,17 +18,51 @@ Specifically:
 #. Apply dead time correction
 #. Group the workspace
 #. Offset, crop and rebin the workspace
-#. If the loaded data is multi-period - apply the specified operation to
-   specified periods to get a single data set.
 #. Use :ref:`algm-MuonCalculateAsymmetry` to get the
    resulting workspace.
 
 Workflow
 ########
 
-.. figure:: /images/MuonWorkflow.png
-   :alt: MuonWorkflow.png
+.. image:: ../images/MuonWorkflow.png
 
-   MuonWorkflow.png
+Usage
+-----
+
+.. include:: ../usagedata-note.txt
+
+.. note::
+
+   For more extensive usage examples on result type / period options please refer to the
+   :ref:`algm-MuonCalculateAsymmetry` documentation.
+
+   For example of applying custom dead times, please refer to :ref:`algm-ApplyDeadTimeCorr`
+   documentation.
+
+   For example of applying custom grouping, please refer to :ref:`algm-MuonGroupDetectors`
+   documentation.
+
+**Example - Integrated pair asymmetry for MUSR run:**
+
+.. testcode:: ExPairAsymmetry
+
+   output = MuonLoad(Filename = 'MUSR0015189.nxs',
+                     TimeZero = 0.55,
+                     Xmin = 0.11,
+                     Xmax = 12,
+                     OutputType = "PairAsymmetry",
+                     PairFirstIndex = 0,
+                     PairSecondIndex = 1,
+                     Alpha = 1.0)
+
+   output_int = Integration(output)
+
+   print 'Integrated asymmetry for the run: {0:.3f}'.format(output_int.readY(0)[0])
+
+Output:
+
+.. testoutput:: ExPairAsymmetry
+
+   Integrated asymmetry for the run: 106.326
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/NormaliseByPeakArea-v1.rst b/Code/Mantid/docs/source/algorithms/NormaliseByPeakArea-v1.rst
index 05ac37f6fd3f9bc835a5fedf775cb8f2aa5b0d92..c971b3d7608bb983d7b8e1d0f33953ecd829cdce 100644
--- a/Code/Mantid/docs/source/algorithms/NormaliseByPeakArea-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/NormaliseByPeakArea-v1.rst
@@ -9,12 +9,18 @@
 Description
 -----------
 
-Takes an input TOF spectrum and converts it to Y-space using the
-:ref:`algm-ConvertToYSpace` algorithm. The result is then
-fitted using the ComptonPeakProfile function using the given mass to
+Takes an input TOF spectrum from :ref:`LoadVesuvio <algm-LoadVesuvio>` and
+converts it to Y-space using the
+:ref:`ConvertToYSpace <algm-ConvertToYSpace>` algorithm. The result is then
+fitted using the ComptonPeakProfile function and the given mass to
 produce an estimate of the peak area. The input data is normalised by
 this value.
 
+The input workspace is required to be a point data workspace, see
+:ref:`ConvertToPointData <algm-ConvertToPointData>`, and each detector is required to have
+an instrument parameter named *t0* that specifies the detector delay time in :math:`\mu s`, see
+:ref:`SetInstrumentParameter <algm-SetInstrumentParameter>`.
+
 The algorithm has 4 outputs:
 
 -  the input data normalised by the fitted peak area;
@@ -23,7 +29,62 @@ The algorithm has 4 outputs:
 -  the input data converted to Y and then symmetrised about Y=0.
 
 If the sum option is requested then all input spectra are rebinned, in
-steps of 0.5 :math:`A^-1`, to a common Y grid and then summed to give a
+steps of 0.5 :math:`\AA^{-1}`, to a common Y grid and then summed to give a
 single spectrum.
 
+Usage
+-----
+
+**Example - Normalise without summation:**
+
+.. testcode:: NormaliseNoSumOutput
+
+    ###### Simulates LoadVesuvio #################
+    tof_ws = CreateSimulationWorkspace(Instrument='Vesuvio',BinParams=[50,0.5,562],UnitX='TOF')
+    tof_ws = CropWorkspace(tof_ws,StartWorkspaceIndex=0,EndWorkspaceIndex=4)
+    tof_ws = ConvertToPointData(tof_ws)
+    SetInstrumentParameter(tof_ws,ParameterName='t0',ParameterType='Number',Value='0.5')
+    ##############################################
+
+    normalised, yspace, fitted, symmetrised = \
+      NormaliseByPeakArea(InputWorkspace=tof_ws, Mass=1.0079,Sum=False)
+
+    print "Number of normalised spectra is: %d" % normalised.getNumberHistograms()
+    print "Number of Y-space spectra is: %d" % yspace.getNumberHistograms()
+    print "Number of fitted spectra is: %d" % fitted.getNumberHistograms()
+    print "Number of symmetrised spectra is: %d" % symmetrised.getNumberHistograms()
+
+.. testoutput:: NormaliseNoSumOutput
+
+    Number of normalised spectra is: 5
+    Number of Y-space spectra is: 5
+    Number of fitted spectra is: 5
+    Number of symmetrised spectra is: 5
+
+**Example - Normalise with summation:**
+
+.. testcode:: NormaliseWithSummedOutput
+
+    ###### Simulates LoadVesuvio #################
+    tof_ws = CreateSimulationWorkspace(Instrument='Vesuvio',BinParams=[50,0.5,562],UnitX='TOF')
+    tof_ws = CropWorkspace(tof_ws,StartWorkspaceIndex=0,EndWorkspaceIndex=4)
+    tof_ws = ConvertToPointData(tof_ws)
+    SetInstrumentParameter(tof_ws,ParameterName='t0',ParameterType='Number',Value='0.5')
+    ##############################################
+
+    normalised, yspace, fitted, symmetrised = \
+      NormaliseByPeakArea(InputWorkspace=tof_ws, Mass=1.0079,Sum=True)
+
+    print "Number of normalised spectra is: %d" % normalised.getNumberHistograms()
+    print "Number of Y-space spectra is: %d" % yspace.getNumberHistograms()
+    print "Number of fitted spectra is: %d" % fitted.getNumberHistograms()
+    print "Number of symmetrised spectra is: %d" % symmetrised.getNumberHistograms()
+
+.. testoutput:: NormaliseWithSummedOutput
+
+    Number of normalised spectra is: 5
+    Number of Y-space spectra is: 1
+    Number of fitted spectra is: 1
+    Number of symmetrised spectra is: 1
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/PeaksInRegion-v1.rst b/Code/Mantid/docs/source/algorithms/PeaksInRegion-v1.rst
index 546592bb1c198406ad9de2da141f80b9ce70ce78..7aaef432228f5b0732f9bee4095829c7b63a7ac7 100644
--- a/Code/Mantid/docs/source/algorithms/PeaksInRegion-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/PeaksInRegion-v1.rst
@@ -12,4 +12,36 @@ Description
 Determines which peaks intersect a defined box region in either QLab,
 QSample or HKL space. Similar to :ref:`algm-PeaksOnSurface`.
 
+Usage
+-----
+
+**Example - Peaks inside and outside of a defined region**
+
+.. testcode:: PeaksInRegionExample
+
+   # Load an MDEventWorkspace (QLab) containing some SC diffration peaks
+   mdew = Load("TOPAZ_3680_5_sec_MDEW.nxs")
+   # Find some peaks. These are all unindexed so will have HKL = [0,0,0]
+   peaks = FindPeaksMD(InputWorkspace=mdew, MaxPeaks=1)
+   
+   # Find peaks in region when the Peak sits in the centre of a box
+   in_box_table = PeaksInRegion(peaks, CoordinateFrame='HKL', PeakRadius=0.1, Extents=[-1.0,1.0,-1.0,1.0,-1.0,1.0], CheckPeakExtents=True)
+   print in_box_table.row(0)
+   
+   # Find peaks in region when the peak is just outside the box (by radius)
+   just_outside_box_table = PeaksInRegion(peaks, CoordinateFrame='HKL', PeakRadius=0.999, Extents=[1.0,2.0,-1.0,1.0,-1.0,1.0], CheckPeakExtents=True)
+   print just_outside_box_table.row(0)
+   
+   # Find peaks in region when the peak is just inside the box (by radius)
+   just_intesecting_box_table = PeaksInRegion(peaks, CoordinateFrame='HKL', PeakRadius=1.00, Extents=[1.0,2.0,-1.0,1.0,-1.0,1.0], CheckPeakExtents=True)
+   print just_intesecting_box_table.row(0)
+   
+Output:
+
+.. testoutput:: PeaksInRegionExample
+
+   {'Distance': 0.0, 'PeakIndex': 0, 'Intersecting': True}
+   {'Distance': -1.0, 'PeakIndex': 0, 'Intersecting': False}
+   {'Distance': -1.0, 'PeakIndex': 0, 'Intersecting': True}
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/PeaksOnSurface-v1.rst b/Code/Mantid/docs/source/algorithms/PeaksOnSurface-v1.rst
index cf3c05d1fb4cc36e2d92291bb8755f79a3c4501a..7a7f7ababce5e8ea1182aa02929270e8b74b0ee5 100644
--- a/Code/Mantid/docs/source/algorithms/PeaksOnSurface-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/PeaksOnSurface-v1.rst
@@ -14,4 +14,38 @@ Determine whether a peak intersects a surface. Similar to
 provided. The vertexes must be provided in clockwise ordering starting
 at the lower left.
 
+Usage
+------
+
+**Example - Peaks on and off a finite surface**
+
+.. testcode:: PeaksOnSurfaceExample
+
+   # Load an MDEventWorkspace (QLab) containing some SC diffration peaks
+   mdew = Load("TOPAZ_3680_5_sec_MDEW.nxs")
+   # Find some peaks. These are all unindexed so will have HKL = [0,0,0]
+   peaks = FindPeaksMD(InputWorkspace=mdew, MaxPeaks=1)
+   
+   # Peak is on the plane
+   out_of_plane_offset = 0
+   tbl = PeaksOnSurface(InputWorkspace=peaks, PeakRadius=1.0, CoordinateFrame='HKL', Vertex1=[1.0, -1.0, out_of_plane_offset], Vertex2=[-1.0,-1.0,out_of_plane_offset], Vertex3=[-1.0, 1.0,out_of_plane_offset], Vertex4=[1.0, 1.0,out_of_plane_offset])
+   print tbl.row(0)
+   
+   # Peak is off the plane, and does not intesect it
+   out_of_plane_offset = 1.000
+   tbl = PeaksOnSurface(InputWorkspace=peaks, PeakRadius=0.999,  CoordinateFrame='HKL', Vertex1=[1.0, -1.0, out_of_plane_offset], Vertex2=[-1.0,-1.0,out_of_plane_offset], Vertex3=[-1.0, 1.0,out_of_plane_offset], Vertex4=[1.0, 1.0,out_of_plane_offset])
+   print tbl.row(0)
+   
+   # Peak is off the plane, but does intesect it when radius is made larger
+   tbl = PeaksOnSurface(InputWorkspace=peaks, PeakRadius=1.000,  CoordinateFrame='HKL', Vertex1=[1.0, -1.0, out_of_plane_offset], Vertex2=[-1.0,-1.0,out_of_plane_offset], Vertex3=[-1.0, 1.0,out_of_plane_offset], Vertex4=[1.0, 1.0,out_of_plane_offset])
+   print tbl.row(0)
+   
+Output:
+
+.. testoutput:: PeaksOnSurfaceExample
+
+   {'Distance': 0.0, 'PeakIndex': 0, 'Intersecting': True}
+   {'Distance': -1.0, 'PeakIndex': 0, 'Intersecting': False}
+   {'Distance': -1.0, 'PeakIndex': 0, 'Intersecting': True}
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/PlotAsymmetryByLogValue-v1.rst b/Code/Mantid/docs/source/algorithms/PlotAsymmetryByLogValue-v1.rst
index b83c50c07f5075695843069aa3fa655ffe58faef..0b65fd8ae3dd505b8ba8795215f123b4e5674eaa 100644
--- a/Code/Mantid/docs/source/algorithms/PlotAsymmetryByLogValue-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/PlotAsymmetryByLogValue-v1.rst
@@ -9,11 +9,12 @@
 Description
 -----------
 
-This algorithm calculates asymmetry for a series of muon workspaces. The
+This algorithm calculates asymmetry for a series of Muon workspaces. The
 input workspaces must be in Muon Nexus files which names follow the
 rule: the filename must begin with at least 1 letter and followed by a
 number. The input property FirstRun must be set to the file name with
 the smalest number and the LastRun to the one with the highest number.
+
 If the "Green" property is not set the output workspace will contain a
 single spectrum with asymmetry values. If the "Green" is set the output
 workspace will contain four spectra with asymmetries:
@@ -27,14 +28,117 @@ workspace will contain four spectra with asymmetries:
 +-------------------+------------+------------------------------------+
 | 2                 | 3          | Green only                         |
 +-------------------+------------+------------------------------------+
-| 3                 | 4          | Sum of red and green asymmetries   |
+| 3                 | 4          | Sum of Red and Green               |
 +-------------------+------------+------------------------------------+
 
-If ForwardSpectra and BackwardSpectra are set the muon workspaces will
+If ForwardSpectra and BackwardSpectra are set the Muon workspaces will
 be grouped according to the user input, otherwise the Autogroup option
 of LoadMuonNexus will be used for grouping.
 
-There is a python script PlotAsymmetryByLogValue.py which if called in
-MantidPlot runs the algorithm and plots the results.
+Usage
+-----
+
+.. include:: ../usagedata-note.txt
+
+**Example - Calculating assymetry for a series of MUSR runs:**
+
+.. testcode:: ExSimple
+
+   ws = PlotAsymmetryByLogValue(FirstRun = 'MUSR00015189.nxs',
+                                LastRun = 'MUSR00015191.nxs',
+                                LogValue = 'sample_magn_field',
+                                TimeMin = 0.55,
+                                TimeMax = 12.0);
+
+   print "Y values (asymmetry):", ws.readY(0)
+   print "X values (sample magn. field):", ws.readX(0)
+
+Output:
+
+.. testoutput:: ExSimple
+
+   Y values (asymmetry): [ 0.14500665  0.136374    0.11987909]
+   X values (sample magn. field): [ 1350.  1360.  1370.]
+
+**Example - Using both Red and Green period:**
+
+.. testcode:: ExRedGreen
+
+   ws = PlotAsymmetryByLogValue(FirstRun = 'MUSR00015189.nxs',
+                                LastRun = 'MUSR00015191.nxs',
+                                LogValue = 'sample_magn_field',
+                                TimeMin = 0.55,
+                                TimeMax = 12.0,
+                                Red = 1,
+                                Green = 2);
+
+   print "Y values (difference):", ws.readY(0)
+   print "Y values (red):", ws.readY(1)
+   print "Y values (green):", ws.readY(2)
+   print "Y values (sum):", ws.readY(3)
+   print "X values (sample magn. field):", ws.readX(0)
+
+Output:
+
+.. testoutput:: ExRedGreen
+
+   Y values (difference): [-0.01593431 -0.02579926 -0.04337762]
+   Y values (red): [ 0.14500665  0.136374    0.11987909]
+   Y values (green): [ 0.16056898  0.16160068  0.16239291]
+   Y values (sum): [ 0.30557563  0.29797468  0.282272  ]
+   X values (sample magn. field): [ 1350.  1360.  1370.]
+
+**Example - Using custom grouping to ignore a few detectors:**
+
+.. testcode:: ExCustomGrouping
+
+   # Skip spectra 35
+   fwd_spectra = range(33,35) + range(36,65)
+
+   # Skip spectra 1 and 2
+   bwd_spectra = range(3, 33)
+
+   ws = PlotAsymmetryByLogValue(FirstRun = 'MUSR00015189.nxs',
+                                LastRun = 'MUSR00015191.nxs',
+                                LogValue = 'sample_magn_field',
+                                TimeMin = 0.55,
+                                TimeMax = 12.0,
+                                ForwardSpectra = fwd_spectra,
+                                BackwardSpectra = bwd_spectra)
+
+   print "No of forward spectra used:", len(fwd_spectra)
+   print "No of backward spectra used:", len(bwd_spectra)
+   print "Y values (asymmetry):", ws.readY(0)
+   print "X values (sample magn. field):", ws.readX(0)
+
+Output:
+
+.. testoutput:: ExCustomGrouping
+
+   No of forward spectra used: 31
+   No of backward spectra used: 30
+   Y values (asymmetry): [ 0.1628339   0.15440602  0.13743397]
+   X values (sample magn. field): [ 1350.  1360.  1370.]
+
+**Example - Applying dead time correction stored in the run files:**
+
+.. testcode:: ExDeadTimeCorrection
+
+   ws = PlotAsymmetryByLogValue(FirstRun = 'MUSR00015189.nxs',
+                                LastRun = 'MUSR00015191.nxs',
+                                LogValue = 'sample_magn_field',
+                                TimeMin = 0.55,
+                                TimeMax = 12.0,
+                                DeadTimeCorrType = 'FromRunData');
+
+   print "Y values (asymmetry):", ws.readY(0)
+   print "X values (sample magn. field):", ws.readX(0)
+
+Output:
+
+.. testoutput:: ExDeadTimeCorrection
+
+   Y values (asymmetry): [ 0.14542059  0.13674275  0.12017568]
+   X values (sample magn. field): [ 1350.  1360.  1370.]
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/PolynomialCorrection-v1.rst b/Code/Mantid/docs/source/algorithms/PolynomialCorrection-v1.rst
index aac10373bfe87d0a2af0970fd0fa0d44166becfb..0752f456d460686844b070ccad2d42180f8b3e8e 100644
--- a/Code/Mantid/docs/source/algorithms/PolynomialCorrection-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/PolynomialCorrection-v1.rst
@@ -10,14 +10,60 @@ Description
 -----------
 
 Corrects the data and error values on a workspace by the value of a
-polynomial function:
+polynomial function using the chosen operation. The correction factor is defined by
 
-.. math:: {\rm C0} + {\rm C1} x + {\rm C2} x^2 + ...
+.. math::
 
-which is evaluated at the *x* value of each data point (using the
-mid-point of the bin as the *x* value for histogram data. The data and
-error values are multiplied or divided by the value of this function.
-The order of the polynomial is determined by the length of the
-Coefficients property, which can be of any length.
+   C = \sum_{i}^{N} c_i x_i
+
+where *N* is the order of the polynomial specified by the length of the *Coefficients* property.
+The factor is evaluated at the *x* value of each data point (using the
+mid-point of the bin as the *x* value for histogram data.
+
+
+Usage
+-----
+
+**Example: divide data by a quadratic:**
+
+.. testcode::
+
+   # create histogram workspace
+   dataX = [0,1,2,3,4,5,6,7,8,9] # or use dataX=range(0,10)
+   dataY = [1,2,3,4,5,6,7,8,9]
+   dataE = [1,2,3,4,5,6,7,8,9]
+   data_ws = CreateWorkspace(dataX, dataY, DataE=dataE)
+
+   coefficients = [1., 3., 5.] #  1 + 3x + 5x^2
+   data_ws = PolynomialCorrection(data_ws, coefficients, Operation="Divide")
+
+   print "First 5 y values:", data_ws.readY(0)[0:5]
+   print "First 5 error values:", data_ws.readE(0)[0:5]
+
+.. testoutput::
+
+   First 5 y values: [ 0.26666667  0.11940299  0.0754717   0.05498282  0.04319654]
+   First 5 error values: [ 0.26666667  0.11940299  0.0754717   0.05498282  0.04319654]
+
+**Example: multiply data by a linear:**
+
+.. testcode::
+
+   # create histogram workspace
+   dataX = [0,1,2,3,4,5,6,7,8,9] # or use dataX=range(0,10)
+   dataY = [1,2,3,4,5,6,7,8,9]
+   dataE = [1,2,3,4,5,6,7,8,9]
+   data_ws = CreateWorkspace(dataX, dataY, DataE=dataE)
+
+   coefficients = [2., 4.] #  2 + 4x
+   data_ws = PolynomialCorrection(data_ws, coefficients, Operation="Multiply")
+
+   print "First 5 y values:", data_ws.readY(0)[0:5]
+   print "First 5 error values:", data_ws.readE(0)[0:5]
+
+.. testoutput::
+
+   First 5 y values: [   4.   16.   36.   64.  100.]
+   First 5 error values: [   4.   16.   36.   64.  100.]
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/Power-v1.rst b/Code/Mantid/docs/source/algorithms/Power-v1.rst
index aae191874f7f6f9034fef2da148faecf0628308a..2e1bad56af5b89a31d1b6618b4260dfa3ee15e9c 100644
--- a/Code/Mantid/docs/source/algorithms/Power-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/Power-v1.rst
@@ -14,11 +14,37 @@ Exponent. When acting on an event workspace, the output will be a
 Workspace2D, with the default binning from the original workspace.
 
 Errors
-------
+######
 
 Defining the power algorithm as: :math:`y = \left ( a^b \right )`, we
 can describe the error as: :math:`s_{y} = by\left ( s_{a}/a \right )`,
 where :math:`s_{y}` is the error in the result *y* and :math:`s_{a}` is
 the error in the input *a*.
 
+
+Usage
+-----
+
+**Example - Square each Y value:**
+
+.. testcode::
+
+   # Create a 2 spectrum workspace with Y values 1->8
+   dataX = [0,1,2,3,4,
+            0,1,2,3,4]
+   dataY = [1,2,3,4,
+            5,6,7,8]
+   data_ws = CreateWorkspace(dataX, dataY, NSpec=2)
+   result_ws = Power(data_ws, 2)
+
+   print "Squared values of first spectrum:", result_ws.readY(0)
+   print "Squared values of second spectrum:", result_ws.readY(1)
+
+Output:
+
+.. testoutput::
+
+   Squared values of first spectrum: [  1.   4.   9.  16.]
+   Squared values of second spectrum: [ 25.  36.  49.  64.]
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/PowerMD-v1.rst b/Code/Mantid/docs/source/algorithms/PowerMD-v1.rst
index d9ce647bd6b5762d58921201993e1b2ff43e8d8a..b11dc3a0dbee7b1c7900d134b36b21375f9b3e1e 100644
--- a/Code/Mantid/docs/source/algorithms/PowerMD-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/PowerMD-v1.rst
@@ -9,14 +9,14 @@
 Description
 -----------
 
-This executes the power function on a MDHistoWorkspace.
+This executes the power function on a `MDHistoWorkspace <http://www.mantidproject.org/MDHistoWorkspace>`__.
 
 The signal :math:`a` becomes :math:`f = a^b`
 
 The error :math:`da` becomes :math:`df^2 = f^2 * b^2 * (da^2 / a^2)`
 
 This algorithm cannot be run on a
-`MDEventWorkspace <MDEventWorkspace>`__. Its equivalent on a
-`MatrixWorkspace <MatrixWorkspace>`__ is called :ref:`algm-Power`.
+`MDEventWorkspace <http://www.mantidproject.org/MDEventWorkspace>`__. Its equivalent on a
+`MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`__ is called :ref:`algm-Power`.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/Rebin-v1.rst b/Code/Mantid/docs/source/algorithms/Rebin-v1.rst
index 48369b7dafce710165d14efef5486259ad813ff3..3079cf8041444803068bd5c2fcd0181a10ebac8c 100644
--- a/Code/Mantid/docs/source/algorithms/Rebin-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/Rebin-v1.rst
@@ -16,7 +16,7 @@ create logarithmic binning using the formula
 :math:`x(j+1)=x(j)(1+|\Delta x_i|)\,`
 
 This algorithms is useful both in data reduction, but also in remapping
-`ragged workspaces <Ragged Workspace>`__ to a regular set of bin
+`ragged workspaces <http://www.mantidproject.org/Ragged_Workspace>`__ to a regular set of bin
 boundaries.
 
 Unless the FullBinsOnly option is enabled, the bin immediately before
@@ -26,30 +26,27 @@ be no gaps between bins. Rebin ensures that any of these space filling
 bins cannot be less than 25% or more than 125% of the width that was
 specified.
 
+.. _rebin-example-strings:
+
 Example Rebin param strings
 ###########################
 
--0.0001
-    From min(TOF) to max(TOF) among all events in Logarithmic bins of
-    0.0001
-0,100,20000
-    From 0 rebin in constant size bins of 100 up to 20,000
-2,-0.035,10
-    From 10 rebin in Logarithmic bins of 0.035 up to 10
-0,100,10000,200,20000
-    From 0 rebin in steps of 100 to 10,000 then steps of 200 to 20,000
+* **"-0.0001"**: from min(TOF) to max(TOF) among all events in Logarithmic bins of 0.0001
+* **"*0,100,20000"**: from 0 rebin in constant size bins of 100 up to 20,000
+* **"2,-0.035,10"**: from 10 rebin in Logarithmic bins of 0.035 up to 10
+* **"0,100,10000,200,20000"**: from 0 rebin in steps of 100 to 10,000 then steps of 200 to 20,000
 
 For EventWorkspaces
 ###################
 
-If the input is an `EventWorkspace <EventWorkspace>`__ and the "Preserve
+If the input is an `EventWorkspace <www.mantidproject.org/EventWorkspace>`__ and the "Preserve
 Events" property is True, the rebinning is performed in place, and only
 the X axes of the workspace are set. The actual Y histogram data will
 only be requested as needed, for example, when plotting or displaying
 the data.
 
 If "Preserve Events" is false., then the output workspace will be
-created as a `Workspace2D <Workspace2D>`__, with fixed histogram bins,
+created as a `Workspace2D <http://www.mantidproject.org/Workspace2D>`__, with fixed histogram bins,
 and all Y data will be computed immediately. All event-specific data is
 lost at that point.
 
@@ -58,8 +55,8 @@ For Data-Point Workspaces
 
 If the input workspace contains data points, rather than histograms,
 then Rebin will automatically use the
-:ref:`algm-ConvertToHistogram` and
-:ref:`algm-ConvertToPointData` algorithms before and after
+:ref:`ConvertToHistogram <algm-ConvertToHistogram>` and
+:ref:`ConvertToHistogram <algm-ConvertToPointData>` algorithms before and after
 the rebinning has taken place.
 
 FullBinsOnly option
@@ -80,6 +77,8 @@ following will happen:
 
 Hence the actual *Param* string used is "0, 2, 4, 3, 10".
 
+.. _rebin-usage:
+
 Usage
 -----
 
@@ -98,10 +97,6 @@ Usage
    print "The rebinned X values are: " + str(ws.readX(0))
    print "The rebinned Y values are: " + str(ws.readY(0))
 
-.. testcleanup:: ExHistSimple
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExHistSimple
@@ -123,10 +118,6 @@ Output:
 
    print "The 2nd and 3rd rebinned X values are: " + str(ws.readX(0)[1:3])
 
-.. testcleanup:: ExHistLog
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExHistLog
@@ -147,10 +138,6 @@ Output:
 
    print "The rebinned X values are: " + str(ws.readX(0))
 
-.. testcleanup:: ExHistCustom
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExHistCustom
@@ -172,10 +159,6 @@ Output:
    print "The rebinned X values are: " + str(ws.readX(0))
    print "The rebinned Y values are: " + str(ws.readY(0))
 
-.. testcleanup:: ExHistFullBinsOnly
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExHistFullBinsOnly
@@ -198,10 +181,6 @@ Output:
    print "What type is the workspace after 2nd rebin: " + str(type(ws))
    # note you can also check the type of a workspace using: print isinstance(ws, IEventWorkspace)
 
-.. testcleanup:: ExEventRebin
-
-   DeleteWorkspace(ws)
-
 Output:
 
 .. testoutput:: ExEventRebin
@@ -210,6 +189,4 @@ Output:
    What type is the workspace after 1st rebin: <class 'mantid.api._api.IEventWorkspace'>
    What type is the workspace after 2nd rebin: <class 'mantid.api._api.MatrixWorkspace'>
 
-
-
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/RebinByPulseTimes-v1.rst b/Code/Mantid/docs/source/algorithms/RebinByPulseTimes-v1.rst
index 94ca371866f8c84266a780541865d92b8bb115c6..d53db47cf587a2631588510a9c655e452c1c3b83 100644
--- a/Code/Mantid/docs/source/algorithms/RebinByPulseTimes-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/RebinByPulseTimes-v1.rst
@@ -42,6 +42,38 @@ as a colour map.
 .. figure:: /images/RebinByPulseTime.png
    :alt: RebinByPulseTime.png
 
-   RebinByPulseTime.png
+   Instrument view of WISH with data projected after rebinning by pulse times
+  
+Usage
+-----
+
+**Example - Rebinning an EventWorkspace by pulse times**
+
+Input workspace has raw events
+
+.. testcode:: RebinByPulseTimesExample
+
+   # Load RAW event data
+   event_ws = Load('CNCS_7860_event.nxs')
+   # Start time
+   start_time_in_seconds = 0
+   # End time 
+   end_time_in_seconds = 1e2
+   # Step size
+   time_step_in_seconds = 1 
+   # Perform the rebin
+   pulse_t_ws = RebinByPulseTimes(InputWorkspace=event_ws, Params=[start_time_in_seconds, time_step_in_seconds, end_time_in_seconds])
+
+   print "Events are rebinned into: ",  pulse_t_ws.blocksize(), "bins per histogram"
+   print "X-axis relative start time in seconds: ", pulse_t_ws.readX(0)[0] 
+   print "X-axis relative end time in seconds: ", pulse_t_ws.readX(0)[-1] 
+
+Output:
+   
+.. testoutput:: RebinByPulseTimesExample
+
+   Events are rebinned into:  100 bins per histogram
+   X-axis relative start time in seconds:  0.0
+   X-axis relative end time in seconds:  100.0
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/RecordPythonScript-v1.rst b/Code/Mantid/docs/source/algorithms/RecordPythonScript-v1.rst
index c4554e52ebb2f888fcd67c262dfcbdd19d22bef4..d37f8ad77abf497070d91aad8e8c211ac0de277e 100644
--- a/Code/Mantid/docs/source/algorithms/RecordPythonScript-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/RecordPythonScript-v1.rst
@@ -6,9 +6,6 @@
 
 .. properties::
 
-Description
------------
-
 
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/RemoveExpDecay-v1.rst b/Code/Mantid/docs/source/algorithms/RemoveExpDecay-v1.rst
index 749c0255c773b2df111a22291072632f07dd5b7a..2fcc4280d7a46ce8f23a64b30a0dd65b75ffbc1b 100644
--- a/Code/Mantid/docs/source/algorithms/RemoveExpDecay-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/RemoveExpDecay-v1.rst
@@ -16,7 +16,28 @@ The formula for removing the exponential decay is given by:
 
 .. math:: NewData = (OldData\times{e^\frac{t}{\tau}})/N_0 - 1.0
 
-where Ï„ is the muon lifetime (2.197019e-6 seconds). :math:`N_0` is a
+where :math:`\tau` is the muon lifetime (2.197019e-6 seconds). :math:`N_0` is a
 fitted normalisation constant.
 
+Usage
+-----
+
+**Example - Removing exponential decay:**
+
+.. testcode:: ExSimple
+
+   y = [100, 150, 50, 10, 5]
+   x = [1,2,3,4,5,6]
+   input = CreateWorkspace(x,y)
+
+   output = RemoveExpDecay(input)
+
+   print "Exp. decay removed:", output.readY(0)
+
+Output:
+
+.. testoutput:: ExSimple
+
+   Exp. decay removed: [-0.24271091  0.79071878 -0.05901962 -0.70332224 -0.76615428]
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/RenameWorkspaces-v1.rst b/Code/Mantid/docs/source/algorithms/RenameWorkspaces-v1.rst
index c04dd708d57957384107d414754e7867357ecacc..0f206ba019ebf9ced3bb250b37582177d4dd31c3 100644
--- a/Code/Mantid/docs/source/algorithms/RenameWorkspaces-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/RenameWorkspaces-v1.rst
@@ -16,13 +16,70 @@ RenameWorkspace as a child algorithm having defined the output workspace
 appropriately.
 
 If run on a group workspace, the members of the group will be renamed in
-the same manner as done by RemameWorkspace.
+the same manner as done by RenameWorkspace.
 
 The new names can be either explicitly defined by a comma separated list
 or by adding a prefix, suffix or both a prefix and suffix.
 
-**Warning:** No new name can be the same as any existing workspace, even
-if that existing workspace is also being renamed. Duplicate names may
-cause the loss of a workspace.
+.. warning::
+
+   No new name can be the same as any existing workspace, even if that
+   existing workspace is also being renamed. Duplicate names may cause
+   the loss of a workspace.
+
+Usage
+-----
+
+**Example - New names:**
+
+.. testcode:: ExNewNames
+
+   # Make sure there is nothing in the ADS before we begin
+   mtd.clear()
+
+   names = ['ws1', 'ws2', 'ws3']
+
+   # Create some dummy workspaces
+   for name in names:
+     CreateWorkspace([0], [0], OutputWorkspace=name)
+
+   print 'Workspaces in the ADS _before_ renaming:', mtd.getObjectNames()
+
+   RenameWorkspaces(names, WorkspaceNames=['new_ws1', 'new_ws2', 'new_ws3'])
+
+   print 'Workspaces in the ADS _after_ renaming:', mtd.getObjectNames()
+
+Output:
+
+.. testoutput:: ExNewNames
+
+   Workspaces in the ADS _before_ renaming: ['ws1', 'ws2', 'ws3']
+   Workspaces in the ADS _after_ renaming: ['new_ws1', 'new_ws2', 'new_ws3']
+
+**Example - Using prefix and suffix:**
+
+.. testcode:: ExPrefixAndSuffix
+
+   # Make sure there is nothing in the ADS before we begin
+   mtd.clear()
+
+   names = ['ws1', 'ws2', 'ws3']
+
+   # Create some dummy workspaces
+   for name in names:
+     CreateWorkspace([0], [0], OutputWorkspace=name)
+
+   print 'Workspaces in the ADS _before_ renaming:', mtd.getObjectNames()
+
+   RenameWorkspaces(names, Prefix='new_', Suffix='_name')
+
+   print 'Workspaces in the ADS _after_ renaming:', mtd.getObjectNames()
+
+Output:
+
+.. testoutput:: ExPrefixAndSuffix
+
+   Workspaces in the ADS _before_ renaming: ['ws1', 'ws2', 'ws3']
+   Workspaces in the ADS _after_ renaming: ['new_ws1_name', 'new_ws2_name', 'new_ws3_name']
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SaveDaveGrp-v1.rst b/Code/Mantid/docs/source/algorithms/SaveDaveGrp-v1.rst
index 8f03e315820beca2811e3edf12dffb0cef030b5b..1a406b851b46e7671d605df3bf67f334c3b177e2 100644
--- a/Code/Mantid/docs/source/algorithms/SaveDaveGrp-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SaveDaveGrp-v1.rst
@@ -10,7 +10,7 @@ Description
 -----------
 
 Saves a workspace to a DAVE grp file. A description of the DAVE grouped
-data format can be found at
-`http://www.ncnr.nist.gov/dave/documentation/ascii_help.pdf <http://www.ncnr.nist.gov/dave/documentation/ascii_help.pdf>`__.
+data format can be found
+`here <http://www.ncnr.nist.gov/dave/documentation/ascii_help.pdf>`_.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SaveDetectorsGrouping-v1.rst b/Code/Mantid/docs/source/algorithms/SaveDetectorsGrouping-v1.rst
index e132fc9e7d0bbff0a24b66a63ee6c9b9ecc6f454..24e1cbf9153b5a2dcedd70633009b96cef666423 100644
--- a/Code/Mantid/docs/source/algorithms/SaveDetectorsGrouping-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SaveDetectorsGrouping-v1.rst
@@ -9,38 +9,58 @@
 Description
 -----------
 
-This algorithm is used to save a GroupingWorkspace to a file in XML
-format.
-
-XML File Format
----------------
-
-Parameters
-##########
-
--  "instrument": mandatory attribute of node 'detector-grouping'. It
-   must be valid instrument name.
--  "ID": mandatory attribute of node 'group'. It must be valid group
-   name, and the key to denote group.
--  "detids": a node to define grouping by detectors' ID. Its value must
-   be a list of integers separated by ','. A '-' is used between 2
-   integers to define a range of detectors.
--  "component": a node to define that all detectors belonged to a
-   component in the instrument are to be in a same group. Its value
-   should be a valid component name.
-
-Example 1:
-
-.. raw:: html
-
-   <?xml version="1.0" encoding="UTF-8" ?>
-
-| `` ``\ 
-| ``  ``\ 
-| ``   ``\ \ ``1-30,34-44,47-100``\ 
-| ``  ``\ 
-| ``   ``\ \ ``103-304,344-444,474-5000``\ 
-| ``  ``\ 
-| `` ``\
+This algorithm is used to save a GroupingWorkspace to XML file in a
+format which is accepted by :ref:`algm-LoadDetectorsGroupingFile`.
+
+Usage
+-----
+
+**Example - Saving a custom grouping for MUSR instrument:**
+
+.. testcode:: ExMUSRGrouping
+
+   import os
+
+   result = CreateGroupingWorkspace(InstrumentName = 'MUSR')
+
+   grouping = result[0]
+
+   # Add spectra 1 - 16 to group 1
+   for i in range(0,16):
+     grouping.dataY(i)[0] = 1
+
+   # Add spectra 17 - 33 to group 2
+   for i in range(16,33):
+     grouping.dataY(i)[0] = 2
+
+   # Spectra 34 - 64 are left in group 0, i.e. are left unused
+
+   save_path = os.path.join(config["defaultsave.directory"], "musr_det_grouping.xml")
+
+   SaveDetectorsGrouping(grouping, save_path)
+
+   with open(save_path, 'r') as f:
+     print f.read().replace('\t', '  ').strip()
+
+Output:
+
+.. testoutput:: ExMUSRGrouping
+
+   <?xml version="1.0"?>
+   <detector-grouping instrument="MUSR">
+     <group ID="0">
+       <detids>34-64</detids>
+     </group>
+     <group ID="1">
+       <detids>1-16</detids>
+     </group>
+     <group ID="2">
+       <detids>17-33</detids>
+     </group>
+   </detector-grouping>
+
+.. testcleanup:: ExMUSRGrouping
+
+   os.remove(save_path)
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SaveMask-v1.rst b/Code/Mantid/docs/source/algorithms/SaveMask-v1.rst
index 504808a83955471571b12b0508f41594f018264d..97ae11d1cae3e4777860cf8ad0ebb63cb150c280 100644
--- a/Code/Mantid/docs/source/algorithms/SaveMask-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SaveMask-v1.rst
@@ -10,21 +10,20 @@ Description
 -----------
 
 This algorithm is used to save the masking from a workspace to an XML
-file. This algorithm has previously been renamed from
-`SaveDetectorMasks <SaveDetectorMasks>`__.
+file. This algorithm has previously been renamed from SaveDetectorMasks.
 
 2 Types of Mask Workspace
 -------------------------
 
 There are two types of mask workspace that can serve as input.
 
-1. `MaskWorkspace <MaskWorkspace>`__
+1. `MaskWorkspace <http://www.mantidproject.org/MaskWorkspace>`__
 ####################################
 
 In this case, :ref:`algm-SaveMask` will read Y values to determine
 which detectors are masked;
 
-2. A non-\ `MaskWorkspace <MaskWorkspace>`__ `MatrixWorkspace <MatrixWorkspace>`__ containing `Instrument <Instrument>`__
+2. A non-\ `MaskWorkspace <http://www.mantidproject.org/MaskWorkspace>`__ `MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`__ containing `Instrument <http://www.mantidproject.org/Instrument>`__
 #########################################################################################################################
 
 In this case, :ref:`algm-SaveMask` will scan through all detectors to
@@ -33,26 +32,26 @@ determine which are masked.
 Definition of Mask
 ------------------
 
-| ``* If a pixel is masked, it means that the data from this pixel won't be used.  ``
-| ``  In the masking workspace (i.e., ``\ ```SpecialWorkspace2D`` <SpecialWorkspace2D>`__\ ``), the corresponding value is 1. ``
-| ``* If a pixel is NOT masked, it means that the data from this pixel will be used.  ``
-| ``  In the masking workspace (i.e., ``\ ```SpecialWorkspace2D`` <SpecialWorkspace2D>`__\ ``), the corresponding value is 0.``
+If a pixel is **masked**, it means that the data from this pixel won't be used.
+In the masking workspace (i.e., `SpecialWorkspace2D <http://www.mantidproject.org/SpecialWorkspace2D>`__), the corresponding value is 1. 
+
+If a pixel is **NOT masked**, it means that the data from this pixel will be used.  ``
+In the masking workspace (i.e., `SpecialWorkspace2D <http://www.mantidproject.org/SpecialWorkspace2D>`__), the corresponding value is 0.
 
 XML File Format
 ---------------
 
 Example 1:
 
-.. raw:: html
-
-   <?xml version="1.0" encoding="UTF-8" ?>
+.. code-block:: xml
 
-| `` ``\ 
-| ``  ``\ 
-| ``   ``\ \ ``3,34-44,47``\ 
-| ``   ``\ \ ``bank123``\ 
-| ``   ``\ \ ``bank124``\ 
-| ``  ``\ 
-| `` ``\
+  <?xml version="1.0" encoding="UTF-8" ?>
+  <detector-masking">
+    <group">
+      <detids>3,34-44,47</detids>
+      <component>bank123</component>
+      <component>bank124</component>
+    </group>
+  </detector-masking>
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SignalOverError-v1.rst b/Code/Mantid/docs/source/algorithms/SignalOverError-v1.rst
index b4beb756eef2c265f460d17cda0f0a587a85ddea..815df650ef61379c905f51d5b24ee262641a9710 100644
--- a/Code/Mantid/docs/source/algorithms/SignalOverError-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SignalOverError-v1.rst
@@ -9,7 +9,7 @@
 Description
 -----------
 
-Take a `MatrixWorkspace <MatrixWorkspace>`__ as input, and replaces the
+Take a `MatrixWorkspace <http://www.mantidproject.org/MatrixWorkspace>`__ as input, and replaces the
 Y values by Y/E (signal divided by error)
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SliceMD-v1.rst b/Code/Mantid/docs/source/algorithms/SliceMD-v1.rst
index d78bc52d43f35ae91ee6b90b589140f5a82f5a05..d42cf541aa13861509b7305ba99dd5cb19fef7b9 100644
--- a/Code/Mantid/docs/source/algorithms/SliceMD-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SliceMD-v1.rst
@@ -61,4 +61,69 @@ Only the non-axis aligned slice method can be performed on a
 MDHistoWorkspace! Of course, your basis vectors can be aligned with the
 dimensions, which is equivalent.
 
+Usage
+-----
+
+**Example - Axis aligned binning**
+
+.. testcode:: SliceMDExample
+
+   mdew = CreateMDWorkspace(Dimensions=3, Extents=[-10,10,-10,10,-10,10], Names='A, B, C', Units='U, U, U')
+   FakeMDEventData(mdew, PeakParams=[100000, 0, 0, 0, 1])
+
+   # Slice out all C > 0
+   sliced = SliceMD(InputWorkspace=mdew, AxisAligned=True, AlignedDim0='A,-10,10,10', AlignedDim1='B, -10, 10, 10', AlignedDim2='C,-10, 0, 10',)
+
+   dim0=sliced.getDimension(0)
+   dim1=sliced.getDimension(1)
+   dim2=sliced.getDimension(2)
+
+   print "A extents", dim0.getMinimum(), dim0.getMaximum()
+   print "B extents", dim1.getMinimum(), dim1.getMaximum()
+   print "C extents", dim2.getMinimum(), dim2.getMaximum()
+   print "Original MDEW should have 2*N events in sliced. We get a factor of : ",  int( mdew.getNEvents() / sliced.getNEvents()  )
+
+Output:
+
+.. testoutput:: SliceMDExample
+
+   A extents -10.0 10.0
+   B extents -10.0 10.0
+   C extents -10.0 0.0
+   Original MDEW should have 2*N events in sliced. We get a factor of :  2
+
+**Example - Non-axis aligned binning**
+
+.. testcode:: SliceMDExampleComplex
+
+   import numpy
+
+   # Create a host workspace
+   mdew = CreateMDWorkspace(Dimensions=2, Extents=[-10,10,-10,10], Names='A, B', Units='U, U')
+   # Add a peak at -5,-5
+   FakeMDEventData(mdew, PeakParams=[100000, -5, -5, 1]) 
+   # Add a peak at 5, 5
+   FakeMDEventData(mdew, PeakParams=[100000, 5, 5, 1])
+   # Slice at 45 degrees. BasisVector0 now runs through both peaks
+   sliced = SliceMD(InputWorkspace=mdew, AxisAligned=False, BasisVector0='X, sqrt(2*U^2), 1,1', BasisVector1='Y, sqrt(2*U^2),-1,1',OutputBins=[100,1], OutputExtents=[-10,10,-10,10])
+
+   # Bin it to gather statistics
+   binned = BinMD(sliced, AxisAligned=True,  AlignedDim0='X, 0,10, 100', AlignedDim1='Y,-10,10,1')
+   signals = binned.getSignalArray()
+
+   dim_x = binned.getDimension(0)
+   x_axis= numpy.linspace(dim_x.getMinimum(), dim_x.getMaximum(), dim_x.getNBins())
+   x_at_max = x_axis[numpy.argmax(signals)]
+   print "Brighest region should be at x  = sqrt( 2*5*5 ) = 7.07. Found to be: ", "{0:.2f}".format(x_at_max)
+
+Output:
+
+.. testoutput:: SliceMDExampleComplex
+
+   Brighest region should be at x  = sqrt( 2*5*5 ) = 7.07. Found to be:  7.07
+
 .. categories::
+
+
+
+
diff --git a/Code/Mantid/docs/source/algorithms/SmoothNeighbours-v1.rst b/Code/Mantid/docs/source/algorithms/SmoothNeighbours-v1.rst
index 83e451e82af45866a419e33c1f9b0e71d0e9506f..a307527efc8c2a1c6059323d2528978577f89cd6 100644
--- a/Code/Mantid/docs/source/algorithms/SmoothNeighbours-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SmoothNeighbours-v1.rst
@@ -12,8 +12,8 @@ Description
 This algorithm performs a moving-average smoothing of data by summing
 spectra of nearest neighbours over the face of detectors. The output
 workspace has the same number of spectra as the input workspace. This
-works on both `EventWorkspaces <EventWorkspace>`__ and
-`Workspace2D <Workspace2D>`__'s. It has two main modes of operation.
+works on both `EventWorkspaces <http://mantidproject.org/EventWorkspace>`__ and
+`Workspace2D <http://mantidproject.org/Workspace2D>`__'s. It has two main modes of operation.
 
 Processing Either Generically or Assuming Rectangular Detectors
 ###############################################################
@@ -34,8 +34,8 @@ section below).
 For Instruments With Rectangular Detectors
 ##########################################
 
-The algorithm looks through the `Instrument <Instrument>`__ to find all
-the `RectangularDetectors <RectangularDetector>`__ defined. For each
+The algorithm looks through the `Instrument <http://mantidproject.org/Instrument>`__ to find all
+the `RectangularDetectors <http://mantidproject.org/RectangularDetector>`__ defined. For each
 pixel in each detector, the AdjX\*AdjY neighboring spectra are summed
 together and saved in the output workspace.
 
@@ -54,8 +54,8 @@ All weights are 1. This is completely position in-senitive.
 Linear Weighting
 ################
 
-Weights are calculated according to :math:`w = 1 - r/R`, where w is the
-weighting factor, r is the distance from the detector and R is the
+Weights are calculated according to :math:`w = 1 - r/R`, where :math:`w` is the
+weighting factor, :math:`r` is the distance from the detector and :math:`R` is the
 cut-off radius.
 
 Parabolic Weighting
@@ -101,25 +101,50 @@ that the bin X boundaries match.
 Neighbour Searching
 ###################
 
-File:NNSearchByRadius.jpg\ \|\ *Fig. 1*.
-File:NNSearchIrregularGrid.jpg\ \|\ *Fig. 2*.
-File:NNSearchLimitByRadius.jpg\ \|\ *Fig. 3*
-File:NNSearchLimitByNNs.jpg\ \|\ *Fig. 4* File:NNSearchXY.jpg\ \|\ *Fig.
-5*
++--------+--------+--------+--------+--------+
+| |Fig1| | |Fig2| | |Fig3| | |Fig4| | |Fig5| |
++--------+--------+--------+--------+--------+
+|*Fig. 1*|*Fig. 2*|*Fig. 3*|*Fig. 4*|*Fig. 5*|
++--------+--------+--------+--------+--------+
+
+.. |Fig1| image:: ../images/NNSearchByRadius.jpg
+   :width: 100%
+.. |Fig2| image:: ../images/NNSearchIrregularGrid.jpg
+   :width: 100%
+.. |Fig3| image:: ../images/NNSearchLimitByRadius.jpg
+   :width: 100%
+.. |Fig4| image:: ../images/NNSearchLimitByNNs.jpg
+   :width: 100%
+.. |Fig5| image:: ../images/NNSearchXY.jpg
+   :width: 100%
 
 Property Values of Examples
 ###########################
 
-| *Fig. 1* : Requesting NumberOfNeighbours=36, Radius=3. Algorithm looks
-for 36 nearest neighbours with a cut-off of 3 detector widths.
-| *Fig. 2* : Requesting NumberOfNeighbours=46, Radius=2. Algorithm looks
-for 46 nearest neighbours with a cut-off of 2 detector widths.
-| *Fig. 3* : Requesting NumberOfNeighbours=56, Radius=3. Algorithm looks
-for 56 nearest neighbours with a cut-off of 3 detector widths.
-| *Fig. 4* : Requesting NumberOfNeighbours=8, Radius=3. Algorithm looks
-for 8 nearest neighbours with a cut-off of 3 detector widths.
-| *Fig. 5* : Requesting AdjX=4, AdjY=2, Radius=0. Algorithm fetches
-neighbours in the specified pattern.
+* **Fig. 1:**
+
+  Requesting NumberOfNeighbours=36, Radius=3. Algorithm looks for
+  36 nearest neighbours with a cut-off of 3 detector widths.
+
+* **Fig. 2:**
+
+  Requesting NumberOfNeighbours=46, Radius=2. Algorithm looks
+  for 46 nearest neighbours with a cut-off of 2 detector widths.
+
+* **Fig. 3:**
+
+  Requesting NumberOfNeighbours=56, Radius=3. Algorithm looks
+  for 56 nearest neighbours with a cut-off of 3 detector widths.
+
+* **Fig. 4:**
+
+  Requesting NumberOfNeighbours=8, Radius=3. Algorithm looks
+  for 8 nearest neighbours with a cut-off of 3 detector widths.
+
+* **Fig. 5:**
+
+  Requesting AdjX=4, AdjY=2, Radius=0. Algorithm fetches
+  neighbours in the specified pattern.
 
 How it Works
 ############
@@ -156,4 +181,131 @@ Ignore Masks
 
 The algorithm will ignore masked detectors if this flag is set.
 
+Usage
+-----
+
+**Example - Smooth using radius:**
+
+.. testcode:: ExRadius
+
+   # Create a workspace with a single rectangular bank of size 3x3. One bin only.
+   ws = CreateSampleWorkspace(Function="Flat background",
+                              NumBanks=1,
+                              BankPixelWidth=3,
+                              XMin=0,
+                              XMax=1,
+                              BinWidth=1)
+
+   # Initial values
+   values = [1.0, 1.0, 3.0,
+             4.0, 2.0, 2.0,
+             1.0, 3.0, 3.0]
+
+   for i in range(0,9):
+     ws.dataY(i)[0] = values[i]
+
+   # Run the algorithm
+   output = SmoothNeighbours(ws, Radius = 1.0,
+                             RadiusUnits = 'NumberOfPixels')
+
+   print 'Number of histograms:', output.getNumberHistograms()
+   print 'Smoothed values:'
+   print output.extractY()
+
+Output:
+
+.. testoutput:: ExRadius
+
+   Number of histograms: 9
+   Smoothed values:
+   [[ 2.        ]
+    [ 2.16666667]
+    [ 2.        ]
+    [ 2.        ]
+    [ 2.22222222]
+    [ 2.33333333]
+    [ 2.5       ]
+    [ 2.5       ]
+    [ 2.5       ]]
+
+**Example -  Smooth using AdjX and AdjY:**
+
+.. testcode:: ExAdj
+
+   # Create a workspace with a single rectangular bank of size 3x3. One bin only.
+   ws = CreateSampleWorkspace(Function="Flat background",
+                              NumBanks=1,
+                              BankPixelWidth=3,
+                              XMin=0,
+                              XMax=1,
+                              BinWidth=1)
+
+   # Initial values
+   values = [1.0, 1.0, 3.0,
+             4.0, 2.0, 2.0,
+             1.0, 3.0, 3.0]
+
+   for i in range(0,9):
+     ws.dataY(i)[0] = values[i]
+
+   # Run the algorithm
+   output = SmoothNeighbours(ws, AdjX=1, AdjY=3)
+
+   print 'Number of histograms:', output.getNumberHistograms()
+   print 'Smoothed values:'
+   print output.extractY()
+
+Output:
+
+.. testoutput:: ExAdj
+
+   Number of histograms: 9
+   Smoothed values:
+   [[ 2.16666667]
+    [ 2.16666667]
+    [ 2.16666667]
+    [ 2.22222222]
+    [ 2.22222222]
+    [ 2.22222222]
+    [ 2.5       ]
+    [ 2.5       ]
+    [ 2.5       ]]
+
+**Example -  Smooth and sum using SumPixelsX and SumPixelsY:**
+
+.. testcode:: ExSum
+
+   # Create a workspace with a single rectangular bank of size 3x3. One bin only.
+   ws = CreateSampleWorkspace(Function="Flat background",
+                              NumBanks=1,
+                              BankPixelWidth=3,
+                              XMin=0,
+                              XMax=1,
+                              BinWidth=1)
+
+   # Initial values
+   values = [1.0, 1.0, 3.0,
+             4.0, 2.0, 2.0,
+             1.0, 3.0, 3.0]
+
+   for i in range(0,9):
+     ws.dataY(i)[0] = values[i]
+
+   # Run the algorithm
+   output = SmoothNeighbours(ws, SumPixelsX=3, SumPixelsY=1)
+
+   print 'Number of histograms:', output.getNumberHistograms()
+   print 'Smoothed values:'
+   print output.extractY()
+
+Output:
+
+.. testoutput:: ExSum
+
+   Number of histograms: 3
+   Smoothed values:
+   [[ 6.]
+    [ 6.]
+    [ 8.]]
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SolidAngle-v1.rst b/Code/Mantid/docs/source/algorithms/SolidAngle-v1.rst
index 18a3ab1edb503e569fcd90f829b4adadceb86300..e99cde49499a7bd495a3acbc2c468c3562749b39 100644
--- a/Code/Mantid/docs/source/algorithms/SolidAngle-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SolidAngle-v1.rst
@@ -17,7 +17,7 @@ The solid angle of a detector that has been masked or marked as dead is
 considered to be 0 steradians.
 
 This algorithms can happily accept `ragged
-workspaces <Ragged Workspace>`__ as an input workspace. The result would
+workspaces <http://www.mantidproject.org/Ragged_Workspace>`__ as an input workspace. The result would
 be a ragged output workspace whose X axis values match the lowest and
 highest of each the input spectra.
 
diff --git a/Code/Mantid/docs/source/algorithms/SpatialGrouping-v1.rst b/Code/Mantid/docs/source/algorithms/SpatialGrouping-v1.rst
index d837dc5fee297e13987b5d3ecf06fff7077137b0..06f76a0fcc6eda04c1acbc4a6b4d7dea1185122b 100644
--- a/Code/Mantid/docs/source/algorithms/SpatialGrouping-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SpatialGrouping-v1.rst
@@ -14,12 +14,13 @@ This algorithm creates an XML Grouping file of the form:
 .. code-block:: xml
 
     <?xml version="1.0" encoding="UTF-8" ?>
-    <detector-grouping> 
-    <group name="fwd"><detids val="1,2,17,32"/></group> 
-    <group name="bwd"><detids val="33,36,38,60,64"/> </group>   
+    <detector-grouping>
+    <group name="fwd"><detids val="1,2,17,32"/></group>
+    <group name="bwd"><detids val="33,36,38,60,64"/> </group>
     </detector-grouping>
 
-Based on information retrieved from the `Nearest
-Neighbours <Nearest Neighbours>`__ class in Mantid Geometry.
+Based on information retrieved from the
+`Nearest Neighbours <http://www.mantidproject.org/Nearest_Neighbours>`_
+class in Mantid Geometry.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SpecularReflectionCalculateTheta-v1.rst b/Code/Mantid/docs/source/algorithms/SpecularReflectionCalculateTheta-v1.rst
index 51dcf7e74dd9d1a9f7f35e6e73b0d537455c200c..4f06bced816e2bc85cb1a6fa5f9603ce062da9ce 100644
--- a/Code/Mantid/docs/source/algorithms/SpecularReflectionCalculateTheta-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SpecularReflectionCalculateTheta-v1.rst
@@ -9,14 +9,43 @@
 Description
 -----------
 
-Uses the Specular reflection condition ThetaIn == ThetaOut to calculate
-and return a corrected ThetaIn.
+Uses the Specular reflection condition :math:`\theta_{In} \equiv \theta_{Out}` to calculate and return a corrected :math:`\theta_{In}`. 
 
-:math:`2*ThetaOut = tan^{-1}\frac{UpOffset}{BeamOffset}`
+.. math:: 
+
+   2\centerdot\theta = tan^{-1}\left(\frac{UpOffset}{BeamOffset}\right)
 
 The calculated theta value in degrees is returned by the algorithm.
 
 Also see
 :ref:`algm-SpecularReflectionPositionCorrect`
 
+Usage
+-----
+
+**Example - Point detector theta calculation**
+
+.. testcode:: SpecularReflectionCalculateThetaPointDetectorExample
+
+   # Set up an instrument with a 45 degree final two theta angle.
+   import os
+   instrument_def = os.path.join( config.getInstrumentDirectory() , "INTER_Definition.xml")
+   ws = LoadEmptyInstrument(instrument_def)
+   inst = ws.getInstrument()
+   ref_frame = inst.getReferenceFrame()
+   upoffset = ref_frame.vecPointingUp() 
+   det_position = {ref_frame.pointingUpAxis(): 1.0, ref_frame.pointingAlongBeamAxis(): 1.0, ref_frame.pointingHorizontalAxis():0}
+   MoveInstrumentComponent(ws, 'point-detector',RelativePosition=False, **det_position)
+   MoveInstrumentComponent(ws, 'some-surface-holder',RelativePosition=False,  X=0, Y= 0, Z=0)
+
+   # Calculate the two theta.
+   two_theta = SpecularReflectionCalculateTheta(InputWorkspace=ws, DetectorComponentName='point-detector', AnalysisMode='PointDetectorAnalysis')
+   print two_theta
+   
+Output:
+
+.. testoutput:: SpecularReflectionCalculateThetaPointDetectorExample 
+ 
+   45.0
+  
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/SpecularReflectionPositionCorrect-v1.rst b/Code/Mantid/docs/source/algorithms/SpecularReflectionPositionCorrect-v1.rst
index 13a051fc367a01276d67d331fd5cd83525d60d35..86ac3b2acb43880e71fb5553c6a1e08b581568eb 100644
--- a/Code/Mantid/docs/source/algorithms/SpecularReflectionPositionCorrect-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SpecularReflectionPositionCorrect-v1.rst
@@ -9,16 +9,49 @@
 Description
 -----------
 
-Uses the specular reflection condition along with a supplied theta value
-to vertically shift the detectors into a corrected location.
+Uses the specular reflection condition :math:`\theta_{In} \equiv \theta_{Out}` along with the Beam direction offeset to vertically shift the detectors into a corrected location.
 
-ThetaIn == ThetaOut
+.. math:: 
 
-and
-
-:math:`2*ThetaOut = tan^{-1}\frac{UpOffset}{BeamOffset}`
+   2\centerdot\theta = tan^{-1}\left(\frac{UpOffset}{BeamOffset}\right)
 
 For LineDetectors and MultiDetectors, the algorithm uses an average of
 grouped detector locations to determine the detector position.
 
+Also see
+:ref:`algm-SpecularReflectionCalculateTheta`
+
 .. categories::
+
+Usage
+-----
+
+**Example - Correct Point Detector position example**
+
+.. testcode:: SpecularReflectionPositionCorrectExample
+
+   # Set up an instrument so that the sample is 1.0 distance from the base of a point detector.
+   import os
+   instrument_def = os.path.join( config.getInstrumentDirectory() , "INTER_Definition.xml")
+   ws = LoadEmptyInstrument(instrument_def)
+   inst = ws.getInstrument()
+   ref_frame = inst.getReferenceFrame()
+   vertical_position = {ref_frame.pointingUpAxis(): 0, ref_frame.pointingAlongBeamAxis(): 1.0, ref_frame.pointingHorizontalAxis():0} 
+   MoveInstrumentComponent(ws, 'point-detector',RelativePosition=False, **vertical_position)
+   MoveInstrumentComponent(ws, 'some-surface-holder',RelativePosition=False,  X=0, Y= 0, Z=0)
+
+   # Correct the detector position. Has a 45 degree incident beam angle.
+   corrected_ws = SpecularReflectionPositionCorrect(InputWorkspace=ws, DetectorComponentName='point-detector', AnalysisMode='PointDetectorAnalysis', TwoThetaIn=45.0)
+
+   # Get the detector position post correction. We expect that the vertical offset of the point detector == 1.0
+   inst = corrected_ws.getInstrument()
+   det_pos = inst.getComponentByName('point-detector').getPos()
+   print det_pos
+   
+Output:
+
+.. testoutput:: SpecularReflectionPositionCorrectExample 
+ 
+   [0,1,1]
+
+.. categories::
\ No newline at end of file
diff --git a/Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst b/Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst
index 3a31d45e604b94ca369406cd1c29cd3034aaefe8..86cac5f9f87f8cb2828838eee1fdf771a601ec02 100644
--- a/Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/Stitch1DMD-v1.rst
@@ -9,6 +9,8 @@
 Description
 -----------
 
+Depricated in favour of :ref:`algm-Stitch1D` as of version 3.2 of Mantid.
+
 Performs 1D stitching of Reflectometry 2D MDHistoWorkspaces. Based on
 the Quick script developed at ISIS. This only works on 1D Histogrammed
 MD Workspaces.
diff --git a/Code/Mantid/docs/source/algorithms/Transpose-v1.rst b/Code/Mantid/docs/source/algorithms/Transpose-v1.rst
index 8887a6eefb167cf18caf0f1b665d0e9cf4224f5a..89b0d98cafb4db5a007a1ad784baf2ae48ce89c6 100644
--- a/Code/Mantid/docs/source/algorithms/Transpose-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/Transpose-v1.rst
@@ -12,12 +12,15 @@ Description
 This algorithm transposes a workspace, so that an N1 x N2 workspace
 becomes N2 x N1.
 
-The X-vector-values for the new workspace are taken from the axis value
+The X-vector values for the new workspace are taken from the axis values
 of the old workspace, which is generaly the spectra number but can be
-other values, if say the workspace has gone through ConvertSpectrumAxis.
+other values, if say the workspace has gone through
+:ref:`ConvertSpectrumAxis <algm-ConvertSpectrumAxis>`.
 
-The new axis values are taken from the previous X-vector-values for the
-first specrum in the workspace. For this reason, use with ragged
-workspaces is undefined.
+.. warning::
+
+    The new axis values are taken from the previous X-vector values for the
+    first specrum in the workspace. For this reason, use with ragged
+    workspaces is undefined.
 
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/UpdateScriptRepository-v1.rst b/Code/Mantid/docs/source/algorithms/UpdateScriptRepository-v1.rst
index 6d47c2860e21149825355262e5617011378a76ea..3029a0f8ac3fdf1c925c1dd202e3721627db8ae4 100644
--- a/Code/Mantid/docs/source/algorithms/UpdateScriptRepository-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/UpdateScriptRepository-v1.rst
@@ -9,8 +9,14 @@
 Description
 -----------
 
-It updates the `ScriptRepository <ScriptRepository>`__. It checkout the
-information of the central repository and download all the files marked
-for AutoUpdate.
+Updates the local meta-information about the `script repository <http://www.mantidproject.org/ScriptRepository>`__. Any files
+marked as *AutoUpdate* will be downloaded.
+
+Usage
+-----
+
+.. code-block:: python
+
+    UpdateScriptRepository()
 
 .. categories::
diff --git a/Code/Mantid/docs/source/images/ClusterImage.png b/Code/Mantid/docs/source/images/ClusterImage.png
new file mode 100644
index 0000000000000000000000000000000000000000..4ef353855044bc99d62b297cc675339c2e82e1d7
Binary files /dev/null and b/Code/Mantid/docs/source/images/ClusterImage.png differ
diff --git a/Code/Mantid/docs/source/images/MuonWorkflow.png b/Code/Mantid/docs/source/images/MuonWorkflow.png
new file mode 100644
index 0000000000000000000000000000000000000000..a994cd3a3d291d7bc8e89de6b763c3ffda1a5f3b
Binary files /dev/null and b/Code/Mantid/docs/source/images/MuonWorkflow.png differ
diff --git a/Code/Mantid/docs/source/images/NNSearchByRadius.jpg b/Code/Mantid/docs/source/images/NNSearchByRadius.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a1c45cee5a9e606d60b883ee3cf392c83eb18505
Binary files /dev/null and b/Code/Mantid/docs/source/images/NNSearchByRadius.jpg differ
diff --git a/Code/Mantid/docs/source/images/NNSearchIrregularGrid.jpg b/Code/Mantid/docs/source/images/NNSearchIrregularGrid.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..f7a92bbba9e9d01ab123dce2d533c542eb5f8d48
Binary files /dev/null and b/Code/Mantid/docs/source/images/NNSearchIrregularGrid.jpg differ
diff --git a/Code/Mantid/docs/source/images/NNSearchLimitByNNs.jpg b/Code/Mantid/docs/source/images/NNSearchLimitByNNs.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..24533c8a4f29224bef99767e8e126ad2a6ad1b9d
Binary files /dev/null and b/Code/Mantid/docs/source/images/NNSearchLimitByNNs.jpg differ
diff --git a/Code/Mantid/docs/source/images/NNSearchLimitByRadius.jpg b/Code/Mantid/docs/source/images/NNSearchLimitByRadius.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a6629e4beac3bbe9d825a7a60dedcfcfc2fdc874
Binary files /dev/null and b/Code/Mantid/docs/source/images/NNSearchLimitByRadius.jpg differ
diff --git a/Code/Mantid/docs/source/images/NNSearchXY.jpg b/Code/Mantid/docs/source/images/NNSearchXY.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..9e93c27c9ddfe7ed027d3091bba2fed6a07810fb
Binary files /dev/null and b/Code/Mantid/docs/source/images/NNSearchXY.jpg differ
diff --git a/Code/Mantid/docs/source/index.rst b/Code/Mantid/docs/source/index.rst
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8d546687c7a7f49e270ad7c3f718079b154faf8f 100644
--- a/Code/Mantid/docs/source/index.rst
+++ b/Code/Mantid/docs/source/index.rst
@@ -0,0 +1,17 @@
+.. Documentation master file
+   It contains a hidden root toctree directive so that Sphinx
+   has an internal index of all of the pages and doesn't
+   produce a plethora of warnings about most documents not being in
+   a toctree.
+   See http://sphinx-doc.org/tutorial.html#defining-document-structure
+
+Mantid documentation
+====================
+
+.. toctree::
+   :glob:
+   :hidden:
+   :maxdepth: 1
+
+   algorithms/*
+   functions/*
diff --git a/Code/Mantid/docs/sphinxext/mantiddoc/directives/algorithm.py b/Code/Mantid/docs/sphinxext/mantiddoc/directives/algorithm.py
index 7b05272a2aad1318485cffac163d4c701eeb2551..078d0c51d7eca9b156f94a99288a0a8604026c0a 100644
--- a/Code/Mantid/docs/sphinxext/mantiddoc/directives/algorithm.py
+++ b/Code/Mantid/docs/sphinxext/mantiddoc/directives/algorithm.py
@@ -7,7 +7,12 @@ import re
 
 REDIRECT_TEMPLATE = "redirect.html"
 
-DEPRECATE_USE_ALG_RE = re.compile(r'Use\s([A-Z][a-zA-Z0-9]+)\sinstead')
+DEPRECATE_USE_ALG_RE = re.compile(r"Use\s(([A-Z][a-zA-Z0-9]+)\s(version ([0-9])+)?)\s*instead.")
+
+# Maximum height in pixels a screenshot image
+# Any higher than this an an obvious gap starts to appear between the "Properties" header
+# and the rest
+SCREENSHOT_MAX_HEIGHT = 250
 
 #--------------------------------------------------------------------------
 class AlgorithmDirective(BaseDirective):
@@ -37,8 +42,8 @@ class AlgorithmDirective(BaseDirective):
         Called by Sphinx when the ..algorithm:: directive is encountered
         """
         self._insert_pagetitle()
-        imgpath = self._create_screenshot()
-        self._insert_screenshot_link(imgpath)
+        picture = self._create_screenshot()
+        self._insert_screenshot_link(picture)
         self._insert_toc()
         self._insert_deprecation_warning()
 
@@ -86,13 +91,12 @@ class AlgorithmDirective(BaseDirective):
         The file will be named "algorithmname-vX_dlg.png", e.g. Rebin-v1_dlg.png
 
         Returns:
-          str: The full path to the created image
+          screenshot: A mantiddoc.tools.Screenshot object
         """
-        notfoundimage = "/images/ImageNotFound.png"
         try:
             screenshots_dir = self._screenshot_directory()
         except RuntimeError:
-            return notfoundimage
+            return None
 
         # Generate image
         from mantiddoc.tools.screenshot import algorithm_screenshot
@@ -100,15 +104,15 @@ class AlgorithmDirective(BaseDirective):
             os.makedirs(screenshots_dir)
 
         try:
-            imgpath = algorithm_screenshot(self.algorithm_name(), screenshots_dir, version=self.algorithm_version())
-        except Exception, exc:
+            picture = algorithm_screenshot(self.algorithm_name(), screenshots_dir, version=self.algorithm_version())
+        except RuntimeError, exc:
             env = self.state.document.settings.env
-            env.warn(env.docname, "Unable to generate screenshot for '%s' - %s" % (algorithm_name, str(exc)))
-            imgpath = notfoundimage
+            env.warn(env.docname, "Unable to generate screenshot for '%s' - %s" % (self.algorithm_name(), str(exc)))
+            picture = None
 
-        return imgpath
+        return picture
 
-    def _insert_screenshot_link(self, img_path):
+    def _insert_screenshot_link(self, picture):
         """
         Outputs an image link with a custom :class: style. The filename is
         extracted from the path given and then a relative link to the
@@ -116,35 +120,42 @@ class AlgorithmDirective(BaseDirective):
         the root source directory is formed.
 
         Args:
-          img_path (str): The full path as on the filesystem to the image
+          picture (Screenshot): A Screenshot object
         """
         env = self.state.document.settings.env
         format_str = ".. figure:: %s\n"\
-                     "    :class: screenshot\n"\
-                     "    :align: right\n"\
-                     "    :width: 400px\n\n"\
-                     "    %s\n\n"
+                     "   :class: screenshot\n"\
+                     "   :width: %dpx\n"\
+                     "   :align: right\n\n"\
+                     "   %s\n\n"
         
         # Sphinx assumes that an absolute path is actually relative to the directory containing the
         # conf.py file and a relative path is relative to the directory where the current rst file
         # is located.
+        if picture:
+            filename = os.path.split(picture.imgpath)[1]
+            # Find the width of the image
+            width, height = picture.width, picture.height
 
-        filename = os.path.split(img_path)[1]
-        cfgdir = env.srcdir
+            if height > SCREENSHOT_MAX_HEIGHT:
+                aspect_ratio = float(width)/height
+                width = int(SCREENSHOT_MAX_HEIGHT*aspect_ratio)
+        else:
+            width = 200
 
         try:
             screenshots_dir = self._screenshot_directory()
-            rel_path = os.path.relpath(screenshots_dir, cfgdir)
+            rel_path = os.path.relpath(screenshots_dir, env.srcdir)
             # This is a href link so is expected to be in unix style
             rel_path = rel_path.replace("\\","/")
             # stick a "/" as the first character so Sphinx computes relative location from source directory
             path = "/" + rel_path + "/" + filename
         except RuntimeError:
             # Use path as it is
-            path = img_path
+            path = "/images/ImageNotFound.png"
 
-        caption = "A screenshot of the **" + self.algorithm_name() + "** dialog."
-        self.add_rst(format_str % (path, caption))
+        caption = "**" + self.algorithm_name() + "** dialog."
+        self.add_rst(format_str % (path, width, caption))
 
     def _screenshot_directory(self):
         """
@@ -177,9 +188,18 @@ class AlgorithmDirective(BaseDirective):
 
         # Check for message to use another algorithm an insert a link
         match = DEPRECATE_USE_ALG_RE.search(msg)
-        if match is not None and len(match.groups()) == 1:
-            name = match.group(0)
-            msg = DEPRECATE_USE_ALG_RE.sub(r"Use :ref:`algm-\1` instead.", msg)
+        if match is not None and len(match.groups()) == 4:
+            link_text = match.group(1)
+            alg_name = match.group(2)
+            version = match.group(4)
+            link = "algm-%s%s"
+            if version is not None:
+                link = link % (alg_name, "-v" + str(version))
+            else:
+                link = link % (alg_name, "")
+            replacement = "Use :ref:`%s <%s>` instead." % (link_text, link)
+            msg = DEPRECATE_USE_ALG_RE.sub(replacement, msg)
+        # endif
 
         self.add_rst(".. warning:: %s" % msg)
 
diff --git a/Code/Mantid/docs/sphinxext/mantiddoc/directives/categories.py b/Code/Mantid/docs/sphinxext/mantiddoc/directives/categories.py
index 3c7f777fcebe85a337e8a1c82c6807923211ed1f..2e74404a35d03166f036bf1d19ee2dffb6074c15 100644
--- a/Code/Mantid/docs/sphinxext/mantiddoc/directives/categories.py
+++ b/Code/Mantid/docs/sphinxext/mantiddoc/directives/categories.py
@@ -8,9 +8,11 @@
 """
 from base import BaseDirective, algorithm_name_and_version
 
+import os
+
 CATEGORY_INDEX_TEMPLATE = "category.html"
 # relative to the directory containing the source file
-CATEGORIES_HTML_ROOT = "categories"
+CATEGORIES_DIR = "categories"
 
 class LinkItem(object):
     """
@@ -81,17 +83,14 @@ class Category(LinkItem):
     pages = None
     # Collection of PageRef objects that form subcategories of this category
     subcategories = None
-    # Set to non-empty string to indicate a subdirectory for the final output
-    namespace = ""
 
-    def __init__(self, name, docname, namespace):
+    def __init__(self, name, docname):
         super(Category, self).__init__(name, docname)
 
         # override default link
         self.link = "../categories/%s.html" % name
         self.pages = set([])
         self.subcategories = set([])
-        self.namespace = namespace
 
 #endclass
 
@@ -183,11 +182,9 @@ class CategoriesDirective(BaseDirective):
         if not hasattr(env, "categories"):
             env.categories = {}
 
-        # If no arguments currently assume algorithm
-        if len(self.arguments) == 0:
-            namespace = "algorithms"
-        else:
-            namespace = ""
+        # convert current document path to relative path from cfgdir
+        docdir = os.path.dirname(env.docname)
+        cfgdir = os.path.relpath(env.srcdir, start=os.path.join(env.srcdir, docdir))
 
         link_rst = ""
         ncategs = 0
@@ -201,7 +198,7 @@ class CategoriesDirective(BaseDirective):
             parent = None
             for index, categ_name in enumerate(categs):
                 if categ_name not in env.categories:
-                    category = Category(categ_name, env, namespace)
+                    category = Category(categ_name, env)
                     env.categories[categ_name] = category
                 else:
                     category = env.categories[categ_name]
@@ -209,13 +206,11 @@ class CategoriesDirective(BaseDirective):
 
                 category.pages.add(PageRef(page_name, env.docname))
                 if index > 0: # first is never a child
-                    parent.subcategories.add(Category(categ_name, env.docname, namespace))
+                    parent.subcategories.add(Category(categ_name, env.docname))
                 #endif
 
-                category_dir = CATEGORIES_HTML_ROOT
-                if namespace != "":
-                    category_dir += "/" + namespace
-                link_rst += "`%s <../%s/%s.html>`_ | " % (categ_name, category_dir, categ_name)
+                category_dir = cfgdir + "/" + CATEGORIES_DIR
+                link_rst += "`%s <%s/%s.html>`_ | " % (categ_name, category_dir, categ_name)
                 ncategs += 1
                 parent = category
             # endfor
@@ -272,9 +267,7 @@ def create_category_pages(app):
         context["subcategories"] = sorted(category.subcategories, key = lambda x: x.name[0])
         context["pages"] = sorted(category.pages, key = lambda x: x.name[0])
 
-        outdir = CATEGORIES_HTML_ROOT + "/"
-        if category.namespace != "":
-            outdir += category.namespace + "/"
+        outdir = CATEGORIES_DIR + "/"
         yield (outdir + name, context, template)
 # enddef
 
diff --git a/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py b/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py
index c8883ffcbccdaaffc518782ff798e69378c217a7..358554419b0669dcc1db877aef6bb0c86b6bca66 100644
--- a/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py
+++ b/Code/Mantid/docs/sphinxext/mantiddoc/directives/properties.py
@@ -1,4 +1,5 @@
 from base import BaseDirective
+import string
 
 
 class PropertiesDirective(BaseDirective):
@@ -140,11 +141,16 @@ class PropertiesDirective(BaseDirective):
                 # Fall-back default for anything
                 defaultstr = str(default)
 
-        # replace nonprintable characters with their printable
+        # Replace nonprintable characters with their printable
         # representations, such as \n, \t, ...
         defaultstr = repr(defaultstr)[1:-1]
         defaultstr = defaultstr.replace('\\','\\\\')
 
+        # A special case for single-character default values (e.g. + or *, see MuonLoad). We don't
+        # want them to be interpreted as list items.
+        if len(defaultstr) == 1 and defaultstr in string.punctuation:
+            defaultstr = "\\" + defaultstr
+
         # Replace the ugly default values with "Optional"
         if (defaultstr == "8.9884656743115785e+307") or \
            (defaultstr == "1.7976931348623157e+308") or \
diff --git a/Code/Mantid/docs/sphinxext/mantiddoc/tools/screenshot.py b/Code/Mantid/docs/sphinxext/mantiddoc/tools/screenshot.py
index 8d57701f19aa45687ae81adb7933cfcbd4a7cf18..06c480442988ac1f8346dd00b73b5bdb63fc7a70 100644
--- a/Code/Mantid/docs/sphinxext/mantiddoc/tools/screenshot.py
+++ b/Code/Mantid/docs/sphinxext/mantiddoc/tools/screenshot.py
@@ -10,6 +10,21 @@
     :copyright: Copyright 2014
         ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
 """
+#--------------------------------------------------------------------------
+class Screenshot(object):
+    """
+    Takes a screenshot of widget records the filename + meta information
+    about it.
+    """
+
+    def __init__(self, widget, filename, directory):
+        from mantidplot import screenshot_to_dir, threadsafe_call
+        
+        self.imgpath = screenshot_to_dir(widget=widget, filename=filename, screenshot_dir=directory)
+        self.width = widget.width()
+        self.height = widget.height()
+
+#--------------------------------------------------------------------------
 
 def algorithm_screenshot(name, directory, version = -1, ext = ".png"):
     """
@@ -30,7 +45,7 @@ def algorithm_screenshot(name, directory, version = -1, ext = ".png"):
         return "NoGUI-ImageNotGenerated.png"
 
     import mantidqtpython as mantidqt
-    from mantidplot import screenshot_to_dir, threadsafe_call
+    from mantidplot import threadsafe_call
 
     iface_mgr = mantidqt.MantidQt.API.InterfaceManager()
     # threadsafe_call required for MantidPlot
@@ -39,7 +54,6 @@ def algorithm_screenshot(name, directory, version = -1, ext = ".png"):
     suffix = ("-v%d" % version) if version != -1 else ""
     filename = "%s%s_dlg%s" % (name, suffix, ext)
 
-    img_path = screenshot_to_dir(widget=dlg, filename=filename, screenshot_dir=directory)
+    picture = Screenshot(dlg, filename, directory)
     threadsafe_call(dlg.close)
-
-    return img_path
+    return picture
\ No newline at end of file
diff --git a/Code/Mantid/instrument/MANDI_Definition_2013_08_01.xml b/Code/Mantid/instrument/MANDI_Definition_2013_08_01.xml
index f8585d3053a8a864f78b233a5503dc39d2371404..8aa17675d0548d5ccc1ffd918f3926aa04709c86 100644
--- a/Code/Mantid/instrument/MANDI_Definition_2013_08_01.xml
+++ b/Code/Mantid/instrument/MANDI_Definition_2013_08_01.xml
@@ -3,8 +3,8 @@
      see http://www.mantidproject.org/IDF -->
 <instrument xmlns="http://www.mantidproject.org/IDF/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 Schema/IDFSchema.xsd" 
  name="MANDI" valid-from   ="2013-08-01 00:01:00"
-                         valid-to     ="2100-01-31 23:59:59"
-		         last-modified="2013-08-28 15:00:00">
+                         valid-to     ="2014-07-31 23:59:59"
+		         last-modified="2014-06-06 12:00:00">
   <!--Created by Vickie Lynch-->
   <!--Modified by Vickie Lynch using the MANDI.py script from the Translation Service calibration/geometry/ code. -->
 
diff --git a/Code/Mantid/instrument/MANDI_Definition_2014_08_01.xml b/Code/Mantid/instrument/MANDI_Definition_2014_08_01.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ff3947ba2174e60bfdf83f4f655b5d2b9df1580a
--- /dev/null
+++ b/Code/Mantid/instrument/MANDI_Definition_2014_08_01.xml
@@ -0,0 +1,436 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- For help on the notation used to specify an Instrument Definition File 
+     see http://www.mantidproject.org/IDF -->
+<instrument xmlns="http://www.mantidproject.org/IDF/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 Schema/IDFSchema.xsd" 
+ name="MANDI" valid-from   ="2014-08-01 00:00:00"
+                         valid-to     ="2100-01-31 23:59:59"
+		         last-modified="2014-06-06 12:00:00">
+  <!--Created by Vickie Lynch-->
+  <!--Modified by Vickie Lynch using the MANDI.py script from the Translation Service calibration/geometry/ code. -->
+
+  <!--DEFAULTS-->
+  <defaults>
+    <length unit="metre"/>
+    <angle unit="degree"/>
+    <reference-frame>
+      <along-beam axis="z"/>
+      <pointing-up axis="y"/>
+      <handedness val="right"/>
+    </reference-frame>
+    <default-view view="spherical_y"/>
+  </defaults>
+
+  <!--SOURCE-->
+  <component type="moderator">
+    <location z="-30.0"/>
+  </component>
+  <type name="moderator" is="Source"/>
+
+  <!--SAMPLE-->
+  <component type="sample-position">
+    <location y="0.0" x="0.0" z="0.0"/>
+  </component>
+  <type name="sample-position" is="SamplePos"/>
+
+  <!--MONITORS-->
+  <component type="monitors" idlist="monitors">
+    <location/>
+  </component>
+  <type name="monitors">
+    <component type="monitor">
+      <location z="-2.935" name="monitor1"/>
+    </component>
+    <component type="monitor">
+      <location z="-0.898" name="monitor2"/>
+    </component>
+    <component type="monitor">
+      <location z="1.042" name="monitor3"/>
+    </component>
+  </type>
+  
+<!-- XML Code automatically generated on 2012-10-09 15:04:33.238638 for the Mantid instrument definition file -->
+<component type="panel" idstart="327680" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.409194" t="113.999846" p="-89.999932" name="bank5" rot="-90.000152" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="66.000154">
+    <rot val="90.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="655360" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="31.999979" p="-90.000000" name="bank10" rot="152.080035" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="720896" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="46.678985" p="-46.751571" name="bank11" rot="-171.919938" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="786432" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="74.807731" p="-33.305929" name="bank12" rot="-135.919796" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="851968" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="105.192621" p="-33.305992" name="bank13" rot="-99.919712" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="917504" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="133.320872" p="-46.751427" name="bank14" rot="-63.920201" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="983040" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="148.000021" p="-89.999757" name="bank15" rot="-27.920117" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1048576" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="133.320872" p="-133.248573" name="bank16" rot="8.080272" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1114112" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="105.192621" p="-146.694008" name="bank17" rot="44.079783" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1179648" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="74.807731" p="-146.694071" name="bank18" rot="80.079867" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1245184" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="46.678985" p="-133.248429" name="bank19" rot="116.080009" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1310720" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="23.905622" p="-42.859145" name="bank20" rot="-177.410228" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1376256" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="55.596651" p="-19.516218" name="bank21" rot="-141.410201" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1441792" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="90.000202" p="-16.000018" name="bank22" rot="-105.410002" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1507328" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="124.403098" p="-19.516157" name="bank23" rot="-69.410491" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1572864" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="156.094224" p="-42.858824" name="bank24" rot="-33.410407" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1638400" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="156.094224" p="-137.141176" name="bank25" rot="2.589982" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1703936" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="124.403098" p="-160.483843" name="bank26" rot="38.590066" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1769472" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="90.000202" p="-163.999982" name="bank27" rot="74.589577" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1835008" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="55.596651" p="-160.483782" name="bank28" rot="110.589776" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="1900544" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="23.905622" p="-137.140855" name="bank29" rot="146.589803" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2031616" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.395000" t="36.000027" p="0.000000" name="bank31" rot="-143.999973" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="45.000000">
+    <rot val="0.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2097152" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.395000" t="72.000168" p="0.000000" name="bank32" rot="-107.999832" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="45.000000">
+    <rot val="0.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2162688" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.395000" t="108.000253" p="0.000000" name="bank33" rot="-71.999747" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="45.000000">
+    <rot val="0.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2228224" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.395000" t="143.999764" p="0.000000" name="bank34" rot="-36.000236" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="45.000000">
+    <rot val="0.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2359296" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.395000" t="143.999764" p="180.000000" name="bank36" rot="36.000236" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="45.000000">
+    <rot val="0.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2424832" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.395000" t="108.000253" p="180.000000" name="bank37" rot="71.999747" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="45.000000">
+    <rot val="0.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2490368" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.395000" t="72.000168" p="180.000000" name="bank38" rot="107.999832" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="45.000000">
+    <rot val="0.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2555904" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.395000" t="36.000027" p="180.000000" name="bank39" rot="143.999973" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="45.000000">
+    <rot val="0.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2621440" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="23.905622" p="42.859145" name="bank40" rot="-146.589803" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2686976" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="55.596651" p="19.516218" name="bank41" rot="-110.589776" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2752512" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="90.000202" p="16.000018" name="bank42" rot="-74.589577" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2818048" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="124.403098" p="19.516157" name="bank43" rot="-38.590066" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2883584" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="156.094224" p="42.858824" name="bank44" rot="-2.589982" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="2949120" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="156.094224" p="137.141176" name="bank45" rot="33.410407" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3014656" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="124.403098" p="160.483843" name="bank46" rot="69.410491" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3080192" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="90.000202" p="163.999982" name="bank47" rot="105.410002" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3145728" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="55.596651" p="160.483782" name="bank48" rot="141.410201" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3211264" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.425000" t="23.905622" p="137.140855" name="bank49" rot="177.410228" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="47.178655">
+    <rot val="-22.073524" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3276800" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="31.999979" p="90.000000" name="bank50" rot="-152.080035" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3342336" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="46.678985" p="46.751571" name="bank51" rot="-116.080009" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3407872" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="74.807731" p="33.305929" name="bank52" rot="-80.079867" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3473408" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="105.192621" p="33.305992" name="bank53" rot="-44.079783" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3538944" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="133.320872" p="46.751427" name="bank54" rot="-8.080272" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3604480" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="148.000021" p="89.999757" name="bank55" rot="27.919812" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3670016" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="133.320872" p="133.248573" name="bank56" rot="63.920201" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3735552" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="105.192621" p="146.694008" name="bank57" rot="99.919712" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3801088" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="74.807731" p="146.694071" name="bank58" rot="135.919796" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<component type="panel" idstart="3866624" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.455000" t="46.678985" p="133.248429" name="bank59" rot="171.919938" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="53.154399">
+    <rot val="-41.466968" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component> 
+<!-- List of all the bank names:
+bank10,bank11,bank12,bank13,bank14,bank15,bank16,bank17,bank18,bank19,bank20,bank21,bank22,bank23,bank24,bank25,bank26,bank27,bank28,bank29,bank31,bank32,bank33,bank34,bank36,bank37,bank38,bank39,bank40,bank41,bank42,bank43,bank44,bank45,bank46,bank47,bank48,bank49,bank50,bank51,bank52,bank53,bank54,bank55,bank56,bank57,bank58,bank59
+-->
+
+<!-- NOTE: This detector is the same as the SNAP detector -->
+<!-- Rectangular Detector Panel -->
+<type name="panel" is="rectangular_detector" type="pixel"
+    xpixels="256" xstart="-0.078795" xstep="+0.000618"
+    ypixels="256" ystart="-0.078795" ystep="+0.000618" >
+  <properties/>
+</type>
+
+  <!-- Pixel for Detectors-->
+  <type is="detector" name="pixel">
+    <cuboid id="pixel-shape">
+      <left-front-bottom-point y="-0.000309" x="-0.000309" z="0.0"/>
+      <left-front-top-point y="0.000309" x="-0.000309" z="0.0"/>
+      <left-back-bottom-point y="-0.000309" x="-0.000309" z="-0.0001"/>
+      <right-front-bottom-point y="-0.000309" x="0.000309" z="0.0"/>
+    </cuboid>
+    <algebra val="pixel-shape"/>
+  </type>
+
+  <!-- Shape for Monitors-->
+  <!-- TODO: Update to real shape -->
+  <type is="monitor" name="monitor">
+    <cylinder id="some-shape">
+      <centre-of-bottom-base p="0.0" r="0.0" t="0.0"/>
+      <axis y="0.0" x="0.0" z="1.0"/>
+      <radius val="0.01"/>
+      <height val="0.03"/>
+    </cylinder>
+    <algebra val="some-shape"/>
+  </type>
+
+  <!--MONITOR IDs-->
+  <idlist idname="monitors">
+    <id val="-1"/>
+    <id val="-2"/>
+    <id val="-3"/>
+  </idlist>
+</instrument>
diff --git a/Code/Mantid/instrument/MANDI_Parameters.xml b/Code/Mantid/instrument/MANDI_Parameters.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9e62bfeb4d4e783cf70f28055ca663de798a1318
--- /dev/null
+++ b/Code/Mantid/instrument/MANDI_Parameters.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<parameter-file instrument = "MANDI" valid-from = "2014-08-01T00:00:00">
+
+<component-link name = "MANDI">
+
+<!-- Specify that any banks not in NeXus file are to be removed -->
+<parameter name="remove-unused-banks">
+  <value val="1"/>
+</parameter>
+
+</component-link>
+
+</parameter-file>
+
diff --git a/Code/Mantid/scripts/Interface/ui/diffraction/diffraction_run_setup.ui b/Code/Mantid/scripts/Interface/ui/diffraction/diffraction_run_setup.ui
index 6b637b560a2b30359b990eb0cf918a8b3bba6f84..9be6e5e9d01bc32c41eeb1e5a7a215dfeab8378f 100644
--- a/Code/Mantid/scripts/Interface/ui/diffraction/diffraction_run_setup.ui
+++ b/Code/Mantid/scripts/Interface/ui/diffraction/diffraction_run_setup.ui
@@ -561,6 +561,11 @@
               <property name="toolTip">
                <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose the file formats to save the reduced data as. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
               </property>
+              <item>
+               <property name="text">
+                <string>fullprof</string>
+               </property>
+              </item>
               <item>
                <property name="text">
                 <string>gsas</string>
@@ -568,12 +573,17 @@
               </item>
               <item>
                <property name="text">
-                <string>fullprof</string>
+                <string>nexus</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>topas</string>
                </property>
               </item>
               <item>
                <property name="text">
-                <string>gsas and fullprof</string>
+                <string>gsas and fullprof and topas</string>
                </property>
               </item>
               <item>
@@ -581,6 +591,11 @@
                 <string>gsas and fullprof and pdfgetn</string>
                </property>
               </item>
+              <item>
+               <property name="text">
+                <string>gsas and fullprof and pdfgetn and topas</string>
+               </property>
+              </item>
              </widget>
             </item>
             <item>
diff --git a/Code/Mantid/scripts/Interface/ui/diffraction/ui_diffraction_run_setup.py b/Code/Mantid/scripts/Interface/ui/diffraction/ui_diffraction_run_setup.py
index a4a71c05d4ece0787391e0170db42b652b4a63e4..019e616e3d4f85dc17661a8542a5c78974e641e8 100644
--- a/Code/Mantid/scripts/Interface/ui/diffraction/ui_diffraction_run_setup.py
+++ b/Code/Mantid/scripts/Interface/ui/diffraction/ui_diffraction_run_setup.py
@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'diffraction_run_setup.ui'
 #
-# Created: Wed Apr 17 13:41:11 2013
+# Created: Wed May 28 09:11:22 2014
 #      by: PyQt4 UI code generator 4.9.1
 #
 # WARNING! All changes made in this file will be lost!
@@ -206,6 +206,9 @@ class Ui_Frame(object):
         self.saveas_combo.addItem(_fromUtf8(""))
         self.saveas_combo.addItem(_fromUtf8(""))
         self.saveas_combo.addItem(_fromUtf8(""))
+        self.saveas_combo.addItem(_fromUtf8(""))
+        self.saveas_combo.addItem(_fromUtf8(""))
+        self.saveas_combo.addItem(_fromUtf8(""))
         self.horizontalLayout_8.addWidget(self.saveas_combo)
         spacerItem6 = QtGui.QSpacerItem(80, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
         self.horizontalLayout_8.addItem(spacerItem6)
@@ -405,10 +408,13 @@ class Ui_Frame(object):
         self.label_2.setToolTip(QtGui.QApplication.translate("Frame", "<html><head/><body><p>File format(s) to save. </p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
         self.label_2.setText(QtGui.QApplication.translate("Frame", "Save As", None, QtGui.QApplication.UnicodeUTF8))
         self.saveas_combo.setToolTip(QtGui.QApplication.translate("Frame", "<html><head/><body><p>Choose the file formats to save the reduced data as. </p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
-        self.saveas_combo.setItemText(0, QtGui.QApplication.translate("Frame", "gsas", None, QtGui.QApplication.UnicodeUTF8))
-        self.saveas_combo.setItemText(1, QtGui.QApplication.translate("Frame", "fullprof", None, QtGui.QApplication.UnicodeUTF8))
-        self.saveas_combo.setItemText(2, QtGui.QApplication.translate("Frame", "gsas and fullprof", None, QtGui.QApplication.UnicodeUTF8))
-        self.saveas_combo.setItemText(3, QtGui.QApplication.translate("Frame", "gsas and fullprof and pdfgetn", None, QtGui.QApplication.UnicodeUTF8))
+        self.saveas_combo.setItemText(0, QtGui.QApplication.translate("Frame", "fullprof", None, QtGui.QApplication.UnicodeUTF8))
+        self.saveas_combo.setItemText(1, QtGui.QApplication.translate("Frame", "gsas", None, QtGui.QApplication.UnicodeUTF8))
+        self.saveas_combo.setItemText(2, QtGui.QApplication.translate("Frame", "nexus", None, QtGui.QApplication.UnicodeUTF8))
+        self.saveas_combo.setItemText(3, QtGui.QApplication.translate("Frame", "topas", None, QtGui.QApplication.UnicodeUTF8))
+        self.saveas_combo.setItemText(4, QtGui.QApplication.translate("Frame", "gsas and fullprof and topas", None, QtGui.QApplication.UnicodeUTF8))
+        self.saveas_combo.setItemText(5, QtGui.QApplication.translate("Frame", "gsas and fullprof and pdfgetn", None, QtGui.QApplication.UnicodeUTF8))
+        self.saveas_combo.setItemText(6, QtGui.QApplication.translate("Frame", "gsas and fullprof and pdfgetn and topas", None, QtGui.QApplication.UnicodeUTF8))
         self.label_6.setToolTip(QtGui.QApplication.translate("Frame", "<html><head/><body><p>Final unit of the output workspace. </p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
         self.label_6.setText(QtGui.QApplication.translate("Frame", "Final Unit", None, QtGui.QApplication.UnicodeUTF8))
         self.unit_combo.setToolTip(QtGui.QApplication.translate("Frame", "<html><head/><body><p>Choose the final unit of output workspace.</p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
diff --git a/Code/Mantid/scripts/Interface/ui/reflectometer/refl_save.py b/Code/Mantid/scripts/Interface/ui/reflectometer/refl_save.py
index 7197c608265e57ef0c97dba80768312a9db93cde..82d2bbdf05273a9feaf9d308ecac1540c77fe77b 100644
--- a/Code/Mantid/scripts/Interface/ui/reflectometer/refl_save.py
+++ b/Code/Mantid/scripts/Interface/ui/reflectometer/refl_save.py
@@ -17,6 +17,8 @@ except AttributeError:
 class Ui_SaveWindow(object):
     def __init__(self):
         
+        self.__has_mount_point = True;
+        
         self.__instrument = config['default.instrument'].strip().upper()
         
         try:
@@ -24,7 +26,7 @@ class Ui_SaveWindow(object):
             self.__mountpoint = usersettings.get_named_setting("DataMountPoint")
         except KeyError:
             print "DataMountPoint is missing from the config.xml file."
-            raise
+            self.__has_mount_point = False;
 
     def setupUi(self, SaveWindow):
         self.SavePath=""
@@ -245,28 +247,31 @@ class Ui_SaveWindow(object):
             if (self.SavePath!=''):
                 self.lineEdit.setText(self.SavePath)
             else:
-                base_path = os.path.join(self.__mountpoint, 'NDX'+  self.__instrument, 'Instrument','logs','journal')
-                print base_path
-                main_journal_path = os.path.join(base_path, 'journal_main.xml')
-                tree1=xml.parse(main_journal_path)
-                root1=tree1.getroot()
-                currentJournal=root1[len(root1)-1].attrib.get('name')
-                cycle_journal_path = os.path.join(base_path, currentJournal)
-                tree=xml.parse(cycle_journal_path)
-                root=tree.getroot()
-                
-                i=0
-                try:
-                    while root[i][4].text!=str(RB_Number):
-                        i+=1
-                    if root[i][1].text.find(',')>0:
-                        user=root[i][1].text[0:root[i][1].text.find(',')]
-                    else:
-                        user=root[i][1].text[0:root[i][1].text.find(' ')]
-                    SavePath = os.path.join('U:', user)
-                    self.lineEdit.setText(SavePath)
-                except LookupError:
-                    print "Not found!"
+                if self.__has_mount_point:
+                    try:
+                        base_path = os.path.join(self.__mountpoint, 'NDX'+  self.__instrument, 'Instrument','logs','journal')
+                        print "Loading journal from", base_path
+                        main_journal_path = os.path.join(base_path, 'journal_main.xml')
+                        tree1=xml.parse(main_journal_path)
+                        root1=tree1.getroot()
+                        currentJournal=root1[len(root1)-1].attrib.get('name')
+                        cycle_journal_path = os.path.join(base_path, currentJournal)
+                        tree=xml.parse(cycle_journal_path)
+                        root=tree.getroot()
+                        i=0
+                        try:
+                            while root[i][4].text!=str(RB_Number):
+                                i+=1
+                            if root[i][1].text.find(',')>0:
+                                user=root[i][1].text[0:root[i][1].text.find(',')]
+                            else:
+                                user=root[i][1].text[0:root[i][1].text.find(' ')]
+                            SavePath = os.path.join('U:', user)
+                            self.lineEdit.setText(SavePath)
+                        except LookupError:
+                            print "Couldn't find user name in archives!"
+                    except:
+                        print "Journal does not exist or is unreachable, please check your network connection."
 
 #--------- If "Save" button pressed, selcted workspaces are saved -------------
     def buttonClickHandler1(self):
diff --git a/Code/Mantid/scripts/Reflectometry/isis_reflectometry/combineMulti.py b/Code/Mantid/scripts/Reflectometry/isis_reflectometry/combineMulti.py
index cb15ac62416451e9b438a0bbc34eae4c21f4317e..5276292d80d0346a226c7b79767f6ef205ba0b37 100644
--- a/Code/Mantid/scripts/Reflectometry/isis_reflectometry/combineMulti.py
+++ b/Code/Mantid/scripts/Reflectometry/isis_reflectometry/combineMulti.py
@@ -74,17 +74,22 @@ def stitch2(ws1, ws2, output_ws_name, begoverlap,endoverlap,Qmin,Qmax,binning,sc
 	scalehigh: if True, scale ws2, otherwise scale ws1
 	scalefactor: Use the manual scaling factor provided if > 0
 	"""
+	if scalefactor > 0.0:
+		manual_scalefactor = True
+	else:
+		manual_scalefactor = False
+		scalefactor = 1.0
 	# Interally use the Stitch1D algorithm.
 	outputs = Stitch1D(LHSWorkspace=ws1, RHSWorkspace=ws2, 
 			OutputWorkspace=output_ws_name, StartOverlap=begoverlap, EndOverlap=endoverlap, 
-			UseManualScaleFactor=(not scalefactor == -1),
+			UseManualScaleFactor=manual_scalefactor,
 			ManualScaleFactor=scalefactor, Params="%f,%f,%f" % (Qmin, binning, Qmax))
 	
 	return outputs
 	
 
 def combine2(wksp1,wksp2,outputwksp,begoverlap,endoverlap,Qmin,Qmax,binning,scalehigh=True,scalefactor=-1.0):
-    """
+	"""
 	Function stitches two workspaces together and returns a stitched workspace name along with the scale factor
 	
 	wksp1: First workspace name to stitch
@@ -98,17 +103,21 @@ def combine2(wksp1,wksp2,outputwksp,begoverlap,endoverlap,Qmin,Qmax,binning,scal
 	scalehigh: if True, scale ws2, otherwise scale ws1
 	scalefactor: Use the manual scaling factor provided if > 0
 	"""
-    
-    # Interally use the Stitch1D algorithm.
-    outputs = Stitch1D(LHSWorkspace=mtd[wksp1], RHSWorkspace=mtd[wksp2], 
+	if scalefactor > 0.0:
+		manual_scalefactor = True
+	else:
+		manual_scalefactor = False
+		scalefactor = 1.0
+	# Interally use the Stitch1D algorithm.
+	outputs = Stitch1D(LHSWorkspace=mtd[wksp1], RHSWorkspace=mtd[wksp2], 
 			OutputWorkspace=outputwksp, StartOverlap=begoverlap, EndOverlap=endoverlap, 
-			UseManualScaleFactor=(not scalefactor == -1),
+			UseManualScaleFactor=manual_scalefactor,
 			ManualScaleFactor=scalefactor, Params="%f,%f,%f" % (Qmin, binning, Qmax))
-    
-    outscalefactor = outputs[1]
-    
-    return (outputwksp, outscalefactor)
-		
+
+	outscalefactor = outputs[1]
+
+	return (outputwksp, outscalefactor)
+
 def getWorkspace(wksp):
 	"""
 	Get the workspace if it is not a group workspace. If it is a group workspace, get the first period.
diff --git a/Code/Mantid/scripts/WikiMaker/ScreenshotAlgDialogs.py b/Code/Mantid/scripts/WikiMaker/ScreenshotAlgDialogs.py
deleted file mode 100644
index ff9be6948c72ded96bfb3c9350b127a55214e371..0000000000000000000000000000000000000000
--- a/Code/Mantid/scripts/WikiMaker/ScreenshotAlgDialogs.py
+++ /dev/null
@@ -1,46 +0,0 @@
-import mantidqtpython
-import os
-import tempfile
-from mantidplotpy.proxies import threadsafe_call
-
-# Where to save the screenshots.
-screenshotdir = get_screenshot_dir()
-print "Writing screenshots to " + screenshotdir
-
-"""
-Take a screenshot of the algorithm dialog associated with the algorithmDeprecationMessage
-@param alg_name : Name of the algorithm to create the dialog for
-"""
-def screenShotAlgorithm(alg_name):
-	interface_manager = mantidqtpython.MantidQt.API.InterfaceManager()
-	dlg = threadsafe_call( interface_manager.createDialogFromName, alg_name, True)
-	filename = alg_name + "_dlg.png"
-	screenshot_to_dir(widget=dlg, filename=filename, screenshot_dir=screenshotdir)
-	threadsafe_call(dlg.close)
-	file_abs = os.path.join(screenshotdir, filename)
-
-"""
-Screenshot all registered algorithms.
-"""
-def screenShotAll():
-	include_hidden_algorithms = True
-	algs = AlgorithmFactory.getRegisteredAlgorithms(include_hidden_algorithms)
-	for alg_name, versions in algs.iteritems():
-		if specialization_exists(name):
-			continue
-		try:
-			screenShotAlgorithm(alg_name)
-		except Exception:
-			print "Failed to generate dialog for " + alg_name
-			continue
-			
-#Execute the 	
-screenShotAll();
-
-
-
-
-
-
-
-
diff --git a/Test/AutoTestData/CNCS_7860.nxt b/Test/AutoTestData/UsageData/CNCS_7860.nxt
similarity index 100%
rename from Test/AutoTestData/CNCS_7860.nxt
rename to Test/AutoTestData/UsageData/CNCS_7860.nxt
diff --git a/Test/AutoTestData/CNCS_7860_bmon1_histo.dat b/Test/AutoTestData/UsageData/CNCS_7860_bmon1_histo.dat
similarity index 100%
rename from Test/AutoTestData/CNCS_7860_bmon1_histo.dat
rename to Test/AutoTestData/UsageData/CNCS_7860_bmon1_histo.dat
diff --git a/Test/AutoTestData/CNCS_7860_bmon2_histo.dat b/Test/AutoTestData/UsageData/CNCS_7860_bmon2_histo.dat
similarity index 100%
rename from Test/AutoTestData/CNCS_7860_bmon2_histo.dat
rename to Test/AutoTestData/UsageData/CNCS_7860_bmon2_histo.dat
diff --git a/Test/AutoTestData/CNCS_7860_bmon3_histo.dat b/Test/AutoTestData/UsageData/CNCS_7860_bmon3_histo.dat
similarity index 100%
rename from Test/AutoTestData/CNCS_7860_bmon3_histo.dat
rename to Test/AutoTestData/UsageData/CNCS_7860_bmon3_histo.dat
diff --git a/Test/AutoTestData/CNCS_7860_cvinfo.xml b/Test/AutoTestData/UsageData/CNCS_7860_cvinfo.xml
similarity index 100%
rename from Test/AutoTestData/CNCS_7860_cvinfo.xml
rename to Test/AutoTestData/UsageData/CNCS_7860_cvinfo.xml
diff --git a/Test/AutoTestData/CNCS_7860_event.nxs b/Test/AutoTestData/UsageData/CNCS_7860_event.nxs
similarity index 100%
rename from Test/AutoTestData/CNCS_7860_event.nxs
rename to Test/AutoTestData/UsageData/CNCS_7860_event.nxs
diff --git a/Test/AutoTestData/CNCS_7860_neutron_event.dat b/Test/AutoTestData/UsageData/CNCS_7860_neutron_event.dat
similarity index 100%
rename from Test/AutoTestData/CNCS_7860_neutron_event.dat
rename to Test/AutoTestData/UsageData/CNCS_7860_neutron_event.dat
diff --git a/Test/AutoTestData/CNCS_7860_pulseid.dat b/Test/AutoTestData/UsageData/CNCS_7860_pulseid.dat
similarity index 100%
rename from Test/AutoTestData/CNCS_7860_pulseid.dat
rename to Test/AutoTestData/UsageData/CNCS_7860_pulseid.dat
diff --git a/Test/AutoTestData/CNCS_7860_runinfo.xml b/Test/AutoTestData/UsageData/CNCS_7860_runinfo.xml
similarity index 100%
rename from Test/AutoTestData/CNCS_7860_runinfo.xml
rename to Test/AutoTestData/UsageData/CNCS_7860_runinfo.xml