diff --git a/Code/Mantid/Build/CMake/DarwinSetup.cmake b/Code/Mantid/Build/CMake/DarwinSetup.cmake
index 24ac3dbe55a9ff722bd08fe720c5b3dd7ea45c70..be401f1f73519712edb72677a1a6ccc0048d6220 100644
--- a/Code/Mantid/Build/CMake/DarwinSetup.cmake
+++ b/Code/Mantid/Build/CMake/DarwinSetup.cmake
@@ -80,7 +80,7 @@ endif ()
 # Force 64-bit compiler as that's all we support
 ###########################################################################
 
-set ( CLANG_WARNINGS "-Wall -Wextra -pedantic -Winit-self -Wpointer-arith -Wcast-qual -fno-common  -Wno-deprecated-register")
+set ( CLANG_WARNINGS "-Wall -Wextra -pedantic -Winit-self -Wpointer-arith -Wcast-qual -fno-common  -Wno-deprecated-register -Wno-deprecated-declarations")
 
 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 ${CLANG_WARNINGS}" )
 set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=c++0x" )
@@ -131,10 +131,6 @@ if (OSX_VERSION VERSION_LESS 10.9)
 else()
  set(CMAKE_MACOSX_RPATH 1)
  # Assume we are using homebrew for now
- # set Deployment target to 10.8
- set ( CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk )
- set ( CMAKE_OSX_ARCHITECTURES x86_64 )
- set ( CMAKE_OSX_DEPLOYMENT_TARGET 10.8 )
  # Follow symlinks so cmake copies the file
  # PYQT4_PATH, SITEPACKAGES_PATH, OPENSSL_ROOT_DIR may be defined externally (cmake -D)
  # it would be good do not overwrite them (important for the compilation with macports)
diff --git a/Code/Mantid/Build/class_maker.py b/Code/Mantid/Build/class_maker.py
index 69d516c5e87ec42e60da2c207b8bbf920958f197..c929a4ec446d8a1e53aa54bcb16f2f68ec5237f9 100755
--- a/Code/Mantid/Build/class_maker.py
+++ b/Code/Mantid/Build/class_maker.py
@@ -23,7 +23,8 @@ def write_header(subproject, classname, filename, args):
     print "Writing header file to %s" % filename
     f = open(filename, 'w')
 
-    guard = "MANTID_%s_%s_H_" % (subproject.upper(), classname.upper())
+    subproject_upper = subproject.upper()
+    guard = "MANTID_%s_%s_H_" % (subproject_upper, classname.upper())
 
     # Create an Algorithm header; will not use it if not an algo
     algorithm_header = """
@@ -37,13 +38,6 @@ private:
   void exec();
 """
 
-    # ---- Find the author, default to blank string ----
-    author = ""
-    try:
-        author = commands.getoutput('git config user.name')
-    except:
-        pass
-
     alg_class_declare = " : public API::Algorithm"
     alg_include = '#include "MantidAPI/Algorithm.h"'
 
@@ -56,7 +50,7 @@ private:
     s = """#ifndef %s
 #define %s
 
-#include "MantidKernel/System.h"
+#include "Mantid%s/DllConfig.h"
 %s
 namespace Mantid {
 namespace %s {
@@ -84,7 +78,7 @@ namespace %s {
   File change history is stored at: <https://github.com/mantidproject/mantid>
   Code Documentation is available at: <http://doxygen.mantidproject.org>
 */
-class DLLExport %s%s {
+class MANTID_%s_DLL %s%s {
 public:
   %s();
   virtual ~%s();
@@ -93,9 +87,9 @@ public:
 } // namespace %s
 } // namespace Mantid
 
-#endif /* %s */""" % (guard, guard,
+#endif /* %s */""" % (guard, guard, subproject,
        alg_include, subproject, classname,
-       datetime.datetime.now().date().year, classname, alg_class_declare,
+       datetime.datetime.now().date().year, subproject_upper, classname, alg_class_declare,
        classname, classname, algorithm_header, subproject, guard)
 
     f.write(s)
@@ -205,29 +199,27 @@ def write_test(subproject, classname, filename, args):
 
   void test_exec()
   {
-    // Name of the output workspace.
-    std::string outWSName("%sTest_OutputWS");
+    // Create test input if necessary
+    MatrixWorkspace_sptr inputWS = //-- Fill in appropriate code. Consider using TestHelpers/WorkspaceCreationHelpers.h --
 
     %s alg;
+    // Don't put output in ADS by default
+    alg.setChild(true);
     TS_ASSERT_THROWS_NOTHING( alg.initialize() )
     TS_ASSERT( alg.isInitialized() )
-    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("REPLACE_PROPERTY_NAME_HERE!!!!", "value") );
-    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", outWSName) );
+    TS_ASSERT_THROWS_NOTHING( alg.setProperty("InputWorkspace", inputWS) );
+    TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", "_unused_for_child") );
     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;
-
-    // TODO: Check the results
-
-    // Remove workspace from the data service.
-    AnalysisDataService::Instance().remove(outWSName);
+    // Retrieve the workspace from the algorithm. The type here will probably need to change. It should
+    // be the type using in declareProperty for the "OutputWorkspace" type.
+    // We can't use auto as it's an implicit conversion.
+    Workspace_sptr outputWS = alg.getProperty("OutputWorkspace");
+    TS_ASSERT(outputWS);
+    TS_FAIL("TODO: Check the results and remove this line");
   }
-  """ % (classname,classname,classname);
+  """ % (classname,classname);
 
     if not args.alg:
         algorithm_test = ""
@@ -240,7 +232,6 @@ 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 {
 public:
@@ -252,7 +243,7 @@ public:
 %s
   void test_Something()
   {
-    TSM_ASSERT( "You forgot to write a test!", 0);
+    TS_FAIL( "You forgot to write a test!");
   }
 
 
diff --git a/Code/Mantid/CMakeLists.txt b/Code/Mantid/CMakeLists.txt
index a1e87c99bb9148f03e2db88253e8fcd265dd2e65..7b900fa00967478684248f591c58070baf151823 100644
--- a/Code/Mantid/CMakeLists.txt
+++ b/Code/Mantid/CMakeLists.txt
@@ -78,21 +78,7 @@ ENDIF()
 # Set paths to Third_Party for Mac builds
 ###########################################################################
 IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-
-  if ( NOT 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}." )
-
-  # Check that the 3rd party directory exists.
-  if (NOT IS_DIRECTORY "${THIRD_PARTY}")
-    message ( WARNING "Specified THIRD_PARTY directory doesn't exist!" )
-  endif()
-
   include ( DarwinSetup )
-
 ENDIF()
 
 # We probably don't want this to run on every build.
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/IMaskWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/IMaskWorkspace.h
index 637f2147389e4682757b202894e5108856299ca3..c8e3a06affc012b287b457a49b71b10399175864 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/IMaskWorkspace.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/IMaskWorkspace.h
@@ -6,6 +6,7 @@
 #include <boost/shared_ptr.hpp>
 #include <set>
 #include <string>
+#include <memory>
 
 namespace Mantid {
 namespace API {
@@ -49,12 +50,17 @@ public:
   /// Set / remove masks of all detectors in a set
   virtual void setMasked(const std::set<detid_t> &detectorIDs,
                          const bool mask = true) = 0;
-
+  /// Returns a clone of the workspace
+  std::unique_ptr<IMaskWorkspace> clone() const {
+    return std::unique_ptr<IMaskWorkspace>(doInterfaceClone());
+  }
 protected:
   /// Protected copy constructor. May be used by childs for cloning.
   IMaskWorkspace(const IMaskWorkspace &other) { (void)other; }
   /// Protected copy assignment operator. Assignment not implemented.
   IMaskWorkspace &operator=(const IMaskWorkspace &other);
+  /// returns a clone of the workspace as the interface
+  virtual IMaskWorkspace* doInterfaceClone() const = 0;
 };
 
 /// shared pointer to the matrix workspace base class
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/ISpectrum.h b/Code/Mantid/Framework/API/inc/MantidAPI/ISpectrum.h
index 6ac92f6f80a44c5b6d9f6faece3a15e44e1a903c..dcc407470f34fbea87f7e035067244eff8421921 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/ISpectrum.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/ISpectrum.h
@@ -119,6 +119,10 @@ public:
   virtual void lockData() const;
   virtual void unlockData() const;
 
+  //-------------------------------------------------------
+  virtual bool hasDx() const;
+  virtual void resetHasDx();
+
 protected:
   /// The spectrum number of this spectrum
   specid_t m_specNo;
@@ -131,6 +135,9 @@ protected:
 
   /// Copy-on-write pointer to the Dx (X error) vector.
   MantidVecPtr refDx;
+
+  /// Flag to indicate if Dx (X error) is being used or not
+  mutable bool m_hasDx;
 };
 
 } // namespace API
diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h b/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
index 094cfc1355897d25cdf597d3ca5816eb6a296c27..6a473630755b94046dcaf99241e514d3b9c59cdc 100644
--- a/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
+++ b/Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
@@ -247,6 +247,11 @@ public:
     return getSpectrum(index)->ptrX();
   }
 
+  /// Returns a pointer to the dX  (X Error) data
+  virtual Kernel::cow_ptr<MantidVec> refDx(const std::size_t index) const {
+    return getSpectrum(index)->ptrDx();
+  }
+
   /// Set the specified X array to point to the given existing array
   virtual void setX(const std::size_t index, const MantidVec &X) {
     getSpectrum(index)->setX(X);
@@ -265,6 +270,24 @@ public:
     invalidateCommonBinsFlag();
   }
 
+  /// Set the specified Dx (X Error) array to point to the given existing array
+  virtual void setDx(const std::size_t index, const MantidVec &Dx) {
+    getSpectrum(index)->setDx(Dx);
+    invalidateCommonBinsFlag();
+  }
+
+  /// Set the specified Dx (X Error) array to point to the given existing array
+  virtual void setDx(const std::size_t index, const MantidVecPtr &Dx) {
+    getSpectrum(index)->setDx(Dx);
+    invalidateCommonBinsFlag();
+  }
+
+  /// Set the specified Dx (X Error) array to point to the given existing array
+  virtual void setDx(const std::size_t index, const MantidVecPtr::ptr_type &Dx) {
+    getSpectrum(index)->setX(Dx);
+    invalidateCommonBinsFlag();
+  }
+
   /** Sets the data in the workspace
   @param index :: the workspace index to set.
   @param Y :: Y vector  */
@@ -290,6 +313,14 @@ public:
     getSpectrum(index)->setData(Y, E);
   }
 
+  /**
+   * Probes if DX (X Error) values were set on a particular spectrum
+   * @param index: the spectrum index
+   */
+  virtual bool hasDx(const std::size_t index) const {
+    return getSpectrum(index)->hasDx();
+  }
+
   /// Generate the histogram or rebin the existing histogram.
   virtual void generateHistogram(const std::size_t index, const MantidVec &X,
                                  MantidVec &Y, MantidVec &E,
diff --git a/Code/Mantid/Framework/API/src/ISpectrum.cpp b/Code/Mantid/Framework/API/src/ISpectrum.cpp
index 6c28805c4c352e5d0acf5635612de2f061913116..3bbc77e112c0fa17b21b8957b01f35af5123f8b9 100644
--- a/Code/Mantid/Framework/API/src/ISpectrum.cpp
+++ b/Code/Mantid/Framework/API/src/ISpectrum.cpp
@@ -7,20 +7,20 @@ namespace API {
 //----------------------------------------------------------------------------------------------
 /** Constructor
  */
-ISpectrum::ISpectrum() : m_specNo(0), detectorIDs(), refX(), refDx() {}
+ISpectrum::ISpectrum() : m_specNo(0), detectorIDs(), refX(), refDx(),m_hasDx(false) {}
 
 /** Constructor with spectrum number
  * @param specNo :: spectrum # of the spectrum
  */
 ISpectrum::ISpectrum(const specid_t specNo)
-    : m_specNo(specNo), detectorIDs(), refX(), refDx() {}
+    : m_specNo(specNo), detectorIDs(), refX(), refDx(), m_hasDx(false) {}
 
 //----------------------------------------------------------------------------------------------
 /** Copy constructor
  */
 ISpectrum::ISpectrum(const ISpectrum &other)
     : m_specNo(other.m_specNo), detectorIDs(other.detectorIDs),
-      refX(other.refX), refDx(other.refDx) {}
+    refX(other.refX), refDx(other.refDx), m_hasDx(other.m_hasDx) {}
 
 //----------------------------------------------------------------------------------------------
 /** Copy spectrum number and detector IDs, but not X vector, from another
@@ -54,7 +54,10 @@ void ISpectrum::setX(const MantidVec &X) { refX.access() = X; }
 
 /// Sets the x error data.
 /// @param Dx :: vector of X error data
-void ISpectrum::setDx(const MantidVec &Dx) { refDx.access() = Dx; }
+void ISpectrum::setDx(const MantidVec &Dx) {
+  refDx.access() = Dx;
+  m_hasDx = true;
+}
 
 /// Sets the x data.
 /// @param X :: vector of X data
@@ -62,7 +65,10 @@ void ISpectrum::setX(const MantidVecPtr &X) { refX = X; }
 
 /// Sets the x error data.
 /// @param Dx :: vector of X error data
-void ISpectrum::setDx(const MantidVecPtr &Dx) { refDx = Dx; }
+void ISpectrum::setDx(const MantidVecPtr &Dx) {
+  refDx = Dx;
+  m_hasDx = true;
+}
 
 /// Sets the x data
 /// @param X :: vector of X data
@@ -70,7 +76,10 @@ void ISpectrum::setX(const MantidVecPtr::ptr_type &X) { refX = X; }
 
 /// Sets the x data error
 /// @param Dx :: vector of X error data
-void ISpectrum::setDx(const MantidVecPtr::ptr_type &Dx) { refDx = Dx; }
+void ISpectrum::setDx(const MantidVecPtr::ptr_type &Dx) {
+  refDx = Dx;
+  m_hasDx = true;
+}
 
 // =============================================================================================
 /// Returns the x data
@@ -82,7 +91,10 @@ MantidVec &ISpectrum::dataX() { return refX.access(); }
  *  using X errors. It may result in the breaking of sharing between
  *  Dx vectors and a significant and unnecessary bloating of memory usage.
  */
-MantidVec &ISpectrum::dataDx() { return refDx.access(); }
+MantidVec &ISpectrum::dataDx() {
+  m_hasDx = true;
+  return refDx.access();
+}
 
 /// Returns the x data const
 const MantidVec &ISpectrum::dataX() const { return *refX; }
@@ -106,7 +118,10 @@ const MantidVec &ISpectrum::readE() const { return this->dataE(); }
 MantidVecPtr ISpectrum::ptrX() const { return refX; }
 
 /// Returns a pointer to the x data
-MantidVecPtr ISpectrum::ptrDx() const { return refDx; }
+MantidVecPtr ISpectrum::ptrDx() const {
+  m_hasDx = true;
+  return refDx;
+}
 
 // =============================================================================================
 // --------------------------------------------------------------------------
@@ -213,5 +228,21 @@ void ISpectrum::lockData() const {}
  */
 void ISpectrum::unlockData() const {}
 
+//---------------------------------------------------------
+/**
+ * Gets the value of the use flag.
+ * @returns true if DX has been set, else false
+ */
+bool ISpectrum::hasDx() const {
+  return m_hasDx;
+}
+
+/**
+ * Resets the hasDx flag
+ */
+void ISpectrum::resetHasDx() {
+  m_hasDx = false;
+}
+
 } // namespace Mantid
 } // namespace API
diff --git a/Code/Mantid/Framework/API/test/ISpectrumTest.h b/Code/Mantid/Framework/API/test/ISpectrumTest.h
index 90d3605206a82ef71f54aa2c0621c81aa9a91210..189b014b34cf91d1c51833e4bd11338fa99886c7 100644
--- a/Code/Mantid/Framework/API/test/ISpectrumTest.h
+++ b/Code/Mantid/Framework/API/test/ISpectrumTest.h
@@ -95,6 +95,58 @@ public:
   }
 
 
+  void test_use_dx_flag_being_set_when_accessing_dx_with_non_const() {
+    // non-const dataDx()
+    SpectrumTester s;
+    s.dataDx();
+    TS_ASSERT(s.hasDx());
+
+    // non-const ptrDx()
+    SpectrumTester s2;
+    s2.ptrDx();
+    TS_ASSERT(s2.hasDx());
+
+    // setDX vesion 1
+    SpectrumTester s3;
+    Mantid::MantidVec Dx;
+    s3.setDx(Dx);
+    TS_ASSERT(s3.hasDx());
+
+    // setDX vesion 2
+    SpectrumTester s4;
+    Mantid::MantidVecPtr::ptr_type Dx_vec_ptr_type;
+    s4.setDx(Dx_vec_ptr_type);
+    TS_ASSERT(s4.hasDx());
+
+    // setDX version 3
+    SpectrumTester s5;
+    Mantid::MantidVecPtr Dx_vec_ptr;
+    s5.setDx(Dx_vec_ptr);
+    TS_ASSERT(s5.hasDx());
+  }
+
+  void test_use_dx_flag_not_being_set_when_accessing_dx_with_const() {
+    // const dataDx()
+    const SpectrumTester s;
+    s.dataDx();
+    TS_ASSERT(!s.hasDx());
+  }
+
+
+  void test_use_dx_flag_is_copied_during_copy_construction() {
+    // Copy spectrum which had the flag set
+    SpectrumTester s;
+    s.dataDx();
+    TS_ASSERT(s.hasDx());
+
+    SpectrumTester s2(s);
+    TS_ASSERT(s2.hasDx());
+
+    // Copy spectrum which did not have the flag set
+    SpectrumTester s3;
+    SpectrumTester s4(s);
+    TS_ASSERT(!s3.hasDx());
+  }
 };
 
 
diff --git a/Code/Mantid/Framework/Algorithms/CMakeLists.txt b/Code/Mantid/Framework/Algorithms/CMakeLists.txt
index 040ca6492018dc305eac9d17a1e5eb6ae3b222a6..e9556ffcea3cf13a22056726f40fb23eaa1c5835 100644
--- a/Code/Mantid/Framework/Algorithms/CMakeLists.txt
+++ b/Code/Mantid/Framework/Algorithms/CMakeLists.txt
@@ -179,6 +179,7 @@ set ( SRC_FILES
 	src/PolynomialCorrection.cpp
 	src/Power.cpp
 	src/PowerLawCorrection.cpp
+	src/ProcessIndirectFitParameters.cpp
 	src/Q1D2.cpp
 	src/Q1DWeighted.cpp
 	src/Qhelper.cpp
@@ -451,6 +452,7 @@ set ( INC_FILES
 	inc/MantidAlgorithms/PolynomialCorrection.h
 	inc/MantidAlgorithms/Power.h
 	inc/MantidAlgorithms/PowerLawCorrection.h
+	inc/MantidAlgorithms/ProcessIndirectFitParameters.h
 	inc/MantidAlgorithms/Q1D2.h
 	inc/MantidAlgorithms/Q1DWeighted.h
 	inc/MantidAlgorithms/Qhelper.h
@@ -722,6 +724,7 @@ set ( TEST_FILES
 	PolynomialCorrectionTest.h
 	PowerLawCorrectionTest.h
 	PowerTest.h
+	ProcessIndirectFitParametersTest.h
 	Q1D2Test.h
 	Q1DWeightedTest.h
 	QxyTest.h
@@ -781,8 +784,8 @@ set ( TEST_FILES
 	SumNeighboursTest.h
 	SumRowColumnTest.h
 	SumSpectraTest.h
-	TOFSANSResolutionByPixelTest.h
 	TOFSANSResolutionByPixelCalculatorTest.h
+	TOFSANSResolutionByPixelTest.h
 	TimeAtSampleStrategyDirectTest.h
 	TimeAtSampleStrategyElasticTest.h
 	TimeAtSampleStrategyIndirectTest.h
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ProcessIndirectFitParameters.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ProcessIndirectFitParameters.h
new file mode 100644
index 0000000000000000000000000000000000000000..533e75b88b660d4d337bbb58269098599ceea25c
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ProcessIndirectFitParameters.h
@@ -0,0 +1,59 @@
+#ifndef MANTID_ALGORITHMS_PROCESSINDIRECTFITPARAMETERS_H_
+#define MANTID_ALGORITHMS_PROCESSINDIRECTFITPARAMETERS_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/Algorithm.h"
+namespace Mantid {
+namespace Algorithms {
+
+/** ProcessIndirectFitParameters : Convert a parameter table output by
+  PlotPeakByLogValue to a MatrixWorkspace. This will make a spectrum for each
+  parameter name using the x_column vairable as the x values for the spectrum.
+
+  @author Elliot Oram, ISIS, RAL
+  @date 12/08/2015
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  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 ProcessIndirectFitParameters : public API::Algorithm {
+public:
+  ProcessIndirectFitParameters();
+  virtual ~ProcessIndirectFitParameters();
+
+  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();
+  std::vector<std::string> listToVector(std::string &);
+  std::vector<std::string> searchForFitParams(const std::string &,
+                                              const std::vector<std::string> &);
+  std::vector<std::vector<std::string>>
+  reorder2DVector(const std::vector<std::vector<std::string>> &);
+};
+} // namespace Algorithms
+} // namespace Mantid
+
+#endif /* MANTID_ALGORITHMS_PROCESSINDIRECTFITPARAMETERS_H_ */
\ No newline at end of file
diff --git a/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp b/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
index 9e3a6de3cfac8853d63d3945c8c9cbb2b6dfb0c3..8d3585304e8c43cf9d972af12777e7adeb20ae92 100644
--- a/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/CreateSampleWorkspace.cpp
@@ -83,7 +83,8 @@ void CreateSampleWorkspace::init() {
   m_preDefinedFunctionmap.insert(std::pair<std::string, std::string>(
       "Exp Decay", "name=ExpDecay, Height=100, Lifetime=1000;"));
   m_preDefinedFunctionmap.insert(std::pair<std::string, std::string>(
-      "Powder Diffraction", "name= LinearBackground,A0=0.0850208,A1=-4.89583e-06;"
+      "Powder Diffraction",
+      "name= LinearBackground,A0=0.0850208,A1=-4.89583e-06;"
       "name=Gaussian,Height=0.584528,PeakCentre=$PC1$,Sigma=14.3772;"
       "name=Gaussian,Height=1.33361,PeakCentre=$PC2$,Sigma=15.2516;"
       "name=Gaussian,Height=1.74691,PeakCentre=$PC3$,Sigma=15.8395;"
@@ -93,6 +94,18 @@ void CreateSampleWorkspace::init() {
       "name=Gaussian,Height=2.8998,PeakCentre=$PC7$,Sigma=21.1127;"
       "name=Gaussian,Height=2.05237,PeakCentre=$PC8$,Sigma=21.9932;"
       "name=Gaussian,Height=8.40976,PeakCentre=$PC9$,Sigma=25.2751;"));
+  m_preDefinedFunctionmap.insert(std::pair<std::string, std::string>(
+      "Quasielastic", "name=Lorentzian,FWHM=0.3,PeakCentre=$PC5$,Amplitude=0.8;"
+                      "name=Lorentzian,FWHM=0.1,PeakCentre=$PC5$,Amplitude=1;"
+                      "name=LinearBackground,A0=0.1"));
+  m_preDefinedFunctionmap.insert(std::pair<std::string, std::string>(
+      "Quasielastic Tunnelling",
+      "name=LinearBackground,A0=0.1;"
+      "name=Lorentzian,FWHM=0.1,PeakCentre=$PC5$,Amplitude=1;"
+      "name=Lorentzian,FWHM=0.05,PeakCentre=$PC7$,Amplitude=0.04;"
+      "name=Lorentzian,FWHM=0.05,PeakCentre=$PC3$,Amplitude=0.04;"
+      "name=Lorentzian,FWHM=0.05,PeakCentre=$PC8$,Amplitude=0.02;"
+      "name=Lorentzian,FWHM=0.05,PeakCentre=$PC2$,Amplitude=0.02"));
   m_preDefinedFunctionmap.insert(
       std::pair<std::string, std::string>("User Defined", ""));
   std::vector<std::string> functionOptions;
@@ -112,7 +125,8 @@ void CreateSampleWorkspace::init() {
                   "The Number of banks in the instrument (default:2)");
   declareProperty("BankPixelWidth", 10,
                   boost::make_shared<BoundedValidator<int>>(0, 10000),
-                  "The number of pixels in horizontally and vertically in a bank (default:10)");
+                  "The number of pixels in horizontally and vertically in a "
+                  "bank (default:10)");
   declareProperty("NumEvents", 1000,
                   boost::make_shared<BoundedValidator<int>>(0, 100000),
                   "The number of events per detector, this is only used for "
@@ -192,8 +206,8 @@ void CreateSampleWorkspace::exec() {
 
   // Create an instrument with one or more rectangular banks.
   Instrument_sptr inst = createTestInstrumentRectangular(
-      numBanks, bankPixelWidth, pixelSpacing, 
-      bankDistanceFromSample,sourceSampleDistance);
+      numBanks, bankPixelWidth, pixelSpacing, bankDistanceFromSample,
+      sourceSampleDistance);
 
   int num_bins = static_cast<int>((xMax - xMin) / binWidth);
   MatrixWorkspace_sptr ws;
@@ -421,8 +435,7 @@ void CreateSampleWorkspace::replaceAll(std::string &str,
  */
 Instrument_sptr CreateSampleWorkspace::createTestInstrumentRectangular(
     int num_banks, int pixels, double pixelSpacing,
-    const double bankDistanceFromSample,
-    const double sourceSampleDistance) {
+    const double bankDistanceFromSample, const double sourceSampleDistance) {
   boost::shared_ptr<Instrument> testInst(new Instrument("basic_rect"));
   // The instrument is going to be set up with z as the beam axis and y as the
   // vertical axis.
diff --git a/Code/Mantid/Framework/Algorithms/src/ExtractSpectra.cpp b/Code/Mantid/Framework/Algorithms/src/ExtractSpectra.cpp
index 84050147560c09e2268ba1594ab78ab04416cb4a..352ebf45503ecdaee412e1f1733d1bd1dd4a5226 100644
--- a/Code/Mantid/Framework/Algorithms/src/ExtractSpectra.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/ExtractSpectra.cpp
@@ -149,17 +149,28 @@ void ExtractSpectra::execHistogram() {
     const MantidVec &oldX = m_inputWorkspace->readX(m_workspaceIndexList.front());
     newX.access().assign(oldX.begin() + m_minX, oldX.begin() + m_maxX);
   }
+
   Progress prog(this, 0.0, 1.0, (m_workspaceIndexList.size()));
   // Loop over the required workspace indices, copying in the desired bins
   for (int j = 0; j < static_cast<int>(m_workspaceIndexList.size()); ++j) {
     auto i = m_workspaceIndexList[j];
+
+    bool hasDx = m_inputWorkspace->hasDx(i);
+
     // Preserve/restore sharing if X vectors are the same
     if (m_commonBoundaries) {
       outputWorkspace->setX(j, newX);
+      if (hasDx) {
+        const MantidVec &oldDx = m_inputWorkspace->readDx(i);
+        outputWorkspace->dataDx(j).assign(oldDx.begin() + m_minX, oldDx.begin() + m_maxX);
+      }
     } else {
       // Safe to just copy whole vector 'cos can't be cropping in X if not
       // common
       outputWorkspace->setX(j, m_inputWorkspace->refX(i));
+      if (hasDx) {
+        outputWorkspace->setDx(j, m_inputWorkspace->refDx(i));
+      }
     }
 
     const MantidVec &oldY = m_inputWorkspace->readY(i);
@@ -323,13 +334,26 @@ void ExtractSpectra::execEvent() {
     // Copy spectrum number & detector IDs
     outEL.copyInfoFrom(el);
 
-    if (!m_commonBoundaries)
+    bool hasDx = eventW->hasDx(i);
+
+    if (!m_commonBoundaries) {
       // If the X axis is NOT common, then keep the initial X axis, just clear
       // the events
       outEL.setX(el.dataX());
-    else
+      if (hasDx) {
+        outEL.setDx(el.dataDx());
+      }
+    }
+    else {
       // Common bin boundaries get all set to the same value
       outEL.setX(XValues_new);
+      if (hasDx) {
+        const MantidVec &oldDx = m_inputWorkspace->readDx(i);
+        cow_ptr<MantidVec> DxValues_new;
+        DxValues_new.access().assign(oldDx.begin() + m_minX, oldDx.begin() + m_maxX);
+        outEL.setDx(DxValues_new);
+      }
+    }
 
     // Propagate bin masking if there is any
     if (m_inputWorkspace->hasMaskedBins(i)) {
diff --git a/Code/Mantid/Framework/Algorithms/src/ProcessIndirectFitParameters.cpp b/Code/Mantid/Framework/Algorithms/src/ProcessIndirectFitParameters.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..640f206330d886e962377478cd751184372f8b7f
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/src/ProcessIndirectFitParameters.cpp
@@ -0,0 +1,263 @@
+#include "MantidAlgorithms/ProcessIndirectFitParameters.h"
+
+#include "MantidAPI/ITableWorkspace.h"
+#include "MantidAPI/TextAxis.h"
+
+#include "MantidKernel/MandatoryValidator.h"
+#include "MantidKernel/ListValidator.h"
+#include "MantidKernel/UnitFactory.h"
+
+namespace Mantid {
+namespace Algorithms {
+
+using namespace API;
+using namespace Kernel;
+
+// Register the algorithm into the AlgorithmFactory
+DECLARE_ALGORITHM(ProcessIndirectFitParameters)
+
+//----------------------------------------------------------------------------------------------
+/** Constructor
+ */
+ProcessIndirectFitParameters::ProcessIndirectFitParameters() {}
+
+//----------------------------------------------------------------------------------------------
+/** Destructor
+ */
+ProcessIndirectFitParameters::~ProcessIndirectFitParameters() {}
+
+//----------------------------------------------------------------------------------------------
+
+/// Algorithms name for identification. @see Algorithm::name
+const std::string ProcessIndirectFitParameters::name() const {
+  return "ProcessIndirectFitParameters";
+}
+
+/// Algorithm's version for identification. @see Algorithm::version
+int ProcessIndirectFitParameters::version() const { return 1; }
+
+/// Algorithm's category for identification. @see Algorithm::category
+const std::string ProcessIndirectFitParameters::category() const {
+  return "Workflow\\MIDAS";
+}
+
+/// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
+const std::string ProcessIndirectFitParameters::summary() const {
+  return "Convert a parameter table output by PlotPeakByLogValue to a "
+         "MatrixWorkspace.";
+}
+
+//----------------------------------------------------------------------------------------------
+/** Initialize the algorithm's properties.
+ */
+void ProcessIndirectFitParameters::init() {
+
+  std::vector<std::string> unitOptions = UnitFactory::Instance().getKeys();
+  unitOptions.push_back("");
+
+  declareProperty(new WorkspaceProperty<ITableWorkspace>(
+                      "InputWorkspace", "", Direction::Input),
+                  "The table workspace to convert to a MatrixWorkspace.");
+
+  declareProperty(
+      "ColumnX", "", boost::make_shared<MandatoryValidator<std::string>>(),
+      "The column in the table to use for the x values.", Direction::Input);
+
+  declareProperty("ParameterNames", "",
+                  boost::make_shared<MandatoryValidator<std::string>>(),
+                  "List of the parameter names to add to the workspace.",
+                  Direction::Input);
+
+    declareProperty("XAxisUnit", "",
+                  boost::make_shared<StringListValidator>(unitOptions),
+                  "The unit to assign to the X Axis");
+
+  declareProperty(new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "",
+                                                         Direction::Output),
+                  "The name to give the output workspace");
+}
+
+//----------------------------------------------------------------------------------------------
+/** Execute the algorithm.
+ */
+void ProcessIndirectFitParameters::exec() {
+  // Get Properties
+  ITableWorkspace_sptr inputWs = getProperty("InputWorkspace");
+  std::string xColumn = getProperty("ColumnX");
+  std::string parameterNamesProp = getProperty("ParameterNames");
+  auto parameterNames = listToVector(parameterNamesProp);
+  std::string xUnit = getProperty("XAxisUnit");
+  MatrixWorkspace_sptr outputWsName = getProperty("OutputWorkspace");
+
+  // Search for any parameters in the table with the given parameter names,
+  // ignoring their function index and output them to a workspace
+  auto workspaceNames = std::vector<std::vector<std::string>>();
+  const size_t totalNames = parameterNames.size();
+  for (size_t i = 0; i < totalNames; i++) {
+    auto const allColumnNames = inputWs->getColumnNames();
+    auto columns = searchForFitParams(parameterNames.at(i), allColumnNames);
+    auto errColumns =
+        searchForFitParams((parameterNames.at(i) + "_Err"), allColumnNames);
+
+    auto paramWorkspaces = std::vector<std::string>();
+    size_t min = columns.size();
+    if (errColumns.size() < min) {
+      min = errColumns.size();
+    }
+    auto convertToMatrix =
+        createChildAlgorithm("ConvertTableToMatrixWorkspace", -1, -1, true);
+    convertToMatrix->setAlwaysStoreInADS(true);
+
+    for (size_t j = 0; j < min; j++) {
+      convertToMatrix->setProperty("InputWorkspace", inputWs);
+      convertToMatrix->setProperty("ColumnX", xColumn);
+      convertToMatrix->setProperty("ColumnY", columns.at(j));
+      convertToMatrix->setProperty("ColumnE", errColumns.at(j));
+      convertToMatrix->setProperty("OutputWorkspace", columns.at(j));
+      convertToMatrix->executeAsChildAlg();
+      paramWorkspaces.push_back(columns.at(j));
+    }
+    workspaceNames.push_back(paramWorkspaces);
+  }
+
+  // Transpose list of workspaces, ignoring unequal length of lists
+  // this handles the case where a parameter occurs only once in the whole
+  // workspace
+  workspaceNames = reorder2DVector(workspaceNames);
+
+  // Join all the parameters for each peak into a single workspace per peak
+  auto tempWorkspaces = std::vector<std::string>();
+  auto conjoin = createChildAlgorithm("ConjoinWorkspaces", -1, -1, true);
+  conjoin->setAlwaysStoreInADS(true);
+  conjoin->setProperty("CheckOverlapping", false);
+  const size_t wsMax = workspaceNames.size();
+  for (size_t j = 0; j < wsMax; j++) {
+    std::string tempPeakWs = workspaceNames.at(j).at(0);
+    const size_t paramMax = workspaceNames.at(j).size();
+    for (size_t k = 1; k < paramMax; k++) {
+      auto paramWs = workspaceNames.at(j).at(k);
+      conjoin->setProperty("InputWorkspace1", tempPeakWs);
+      conjoin->setProperty("InputWorkspace2", paramWs);
+      conjoin->executeAsChildAlg();
+      tempPeakWs = std::string(conjoin->getProperty("InputWorkspace1"));
+    }
+    tempWorkspaces.push_back(tempPeakWs);
+  }
+
+  // Join all peaks into a single workspace
+  std::string tempWorkspace = tempWorkspaces.at(0);
+  for (auto it = tempWorkspaces.begin() + 1; it != tempWorkspaces.end(); ++it) {
+    conjoin->setProperty("InputWorkspace1", tempWorkspace);
+    conjoin->setProperty("InputWorkspace2", *it);
+    conjoin->executeAsChildAlg();
+    tempWorkspace = std::string(conjoin->getProperty("InputWorkspace1"));
+  }
+
+  // Rename the workspace to the specified outputName
+  auto renamer = createChildAlgorithm("RenameWorkspace", -1, -1, true);
+  renamer->setProperty("InputWorkspace", tempWorkspace);
+  renamer->setProperty("OutputWorkspace", outputWsName);
+  renamer->executeAsChildAlg();
+  Workspace_sptr renameWs = renamer->getProperty("OutputWorkspace");
+  auto outputWs = boost::dynamic_pointer_cast<MatrixWorkspace>(renameWs);
+
+  // Replace axis on workspaces with text axis
+  auto axis = new TextAxis(outputWs->getNumberHistograms());
+  size_t offset = 0;
+  for (size_t j = 0; j < workspaceNames.size(); j++) {
+    auto peakWs = workspaceNames.at(j);
+    for (size_t k = 0; k < peakWs.size(); k++) {
+      axis->setLabel((k + offset), peakWs.at(k));
+    }
+    offset += peakWs.size();
+  }
+  outputWs->replaceAxis(1, axis);
+
+  // Set units for the xAxis
+  if(xUnit.compare("") != 0){
+	outputWs->getAxis(0)->setUnit(xUnit);
+  }
+  
+  setProperty("OutputWorkspace", outputWs);
+}
+
+/**
+ * Transforms a comma separated list into a vector of strings
+ * @param commaList - The comma separated list to be separated
+ * @return - The vector of string composed of the elements of the comma list
+ */
+std::vector<std::string>
+ProcessIndirectFitParameters::listToVector(std::string &commaList) {
+  auto listVector = std::vector<std::string>();
+  auto pos = commaList.find(",");
+  while (pos != std::string::npos) {
+    std::string nextItem = commaList.substr(0, pos);
+    listVector.push_back(nextItem);
+    commaList = commaList.substr(pos + 1, commaList.size());
+    pos = commaList.find(",");
+  }
+  if (commaList.compare("") != 0) {
+    listVector.push_back(commaList);
+  }
+  return listVector;
+}
+
+/**
+ * Searchs for a particular word within all of the fit params in the columns of
+ * a table workspace (note: This method only matches strings that are at the end
+ * of a column name this is to ensure that "Amplitude" will match
+ * "f0.f0.f1.Amplitude" but not f0.f0.f1.Amplitude_Err")
+ * @param suffix - The string to search for
+ * @param columns - A string vector of all the column names in a table workspace
+ * @return - The full column names in which the string is present
+ */
+std::vector<std::string> ProcessIndirectFitParameters::searchForFitParams(
+    const std::string &suffix, const std::vector<std::string> &columns) {
+  auto fitParams = std::vector<std::string>();
+  const size_t totalColumns = columns.size();
+  for (size_t i = 0; i < totalColumns; i++) {
+    auto pos = columns.at(i).rfind(suffix);
+    if (pos != std::string::npos) {
+      auto endCheck = pos + suffix.size();
+      if (endCheck == columns.at(i).size()) {
+        fitParams.push_back(columns.at(i));
+      }
+    }
+  }
+  return fitParams;
+}
+
+/**
+ * Changes the ordering of a 2D vector of strings such that
+ * [[1a,2a,3a], [1b,2b,3b], [1c,2c,3c]]
+ * becomes
+ * [[1a,1b,1c], [2a,2b,2c], [3a,3b,3c]]
+ * @param original - The original vector to be transformed
+ * @return - The vector after it has been transformed
+ */
+std::vector<std::vector<std::string>>
+ProcessIndirectFitParameters::reorder2DVector(
+    const std::vector<std::vector<std::string>> &original) {
+  size_t maximumLength = original.at(0).size();
+  for (size_t i = 1; i < original.size(); i++) {
+    if (original.at(i).size() > maximumLength) {
+      maximumLength = original.at(i).size();
+    }
+  }
+
+  auto reorderedVector = std::vector<std::vector<std::string>>();
+  for (size_t i = 0; i < maximumLength; i++) {
+    std::vector<std::string> temp;
+    for (size_t j = 0; j < original.size(); j++) {
+      if (original.at(j).size() > i) {
+        temp.push_back(original.at(j).at(i));
+      }
+    }
+    reorderedVector.push_back(temp);
+  }
+
+  return reorderedVector;
+}
+
+} // namespace Algorithms
+} // namespace Mantid
\ No newline at end of file
diff --git a/Code/Mantid/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp b/Code/Mantid/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
index d2750c072444cb7bb4ebccc5e613f1aa181fbab1..623cc9cae2eeae69be611527bff3f226280b19e0 100644
--- a/Code/Mantid/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
+++ b/Code/Mantid/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
@@ -44,16 +44,16 @@ void TOFSANSResolutionByPixel::init() {
                   "Name of the newly created workspace which contains the Q resolution.");
   auto positiveDouble = boost::make_shared<BoundedValidator<double>>();
   positiveDouble->setLower(0);
-  declareProperty("DeltaR", 0.0, positiveDouble, "Pixel size (mm).");
+  declareProperty("DeltaR", 0.0, positiveDouble, "Virtual ring width on the detector (mm).");
   declareProperty("SampleApertureRadius", 0.0, positiveDouble,
-                  "Sample aperture radius (mm).");
+                  "Sample aperture radius, R2 (mm).");
   declareProperty("SourceApertureRadius", 0.0, positiveDouble,
-                  "Source aperture radius (mm).");
+                  "Source aperture radius, R1 (mm).");
   declareProperty(new WorkspaceProperty<>(
                       "SigmaModerator", "", Direction::Input,
                       boost::make_shared<WorkspaceUnitValidator>("Wavelength")),
-                  "Sigma moderator spread in units of microsec as a function "
-                  "of wavelength.");
+                  "Moderator time spread (microseconds) as a"
+                  "function of wavelength (Angstroms).");
   declareProperty("CollimationLength", 0.0, positiveDouble, "Collimation length (m)");
   declareProperty("AccountForGravity", false,
                   "Whether to correct for the effects of gravity");
diff --git a/Code/Mantid/Framework/Algorithms/test/ExtractSpectraTest.h b/Code/Mantid/Framework/Algorithms/test/ExtractSpectraTest.h
index 2fc6324ecc801cdad33e5f1ba0b111a3f0b2a068..caf31ae87f09bdc4d2fc450cf8d5bf4c5b0155e4 100644
--- a/Code/Mantid/Framework/Algorithms/test/ExtractSpectraTest.h
+++ b/Code/Mantid/Framework/Algorithms/test/ExtractSpectraTest.h
@@ -187,6 +187,18 @@ public:
     params.testDetectorList(*ws);
   }
 
+  void test_with_dx_data() {
+    // Arrange
+    Parameters params("histo-dx");
+
+    // Act
+    auto ws = runAlgorithm(params);
+    if (!ws) return;
+
+    // Assert
+    TS_ASSERT_EQUALS(ws->blocksize(), nBins);
+    params.testDx(*ws);
+  }
 
 
   // ---- test event ----
@@ -290,7 +302,7 @@ public:
   }
 
 
-    void test_index_and_detector_list_event()
+  void test_index_and_detector_list_event()
   {
     Parameters params("event-detector");
     params.setDetectorList().setIndexRange();
@@ -326,6 +338,13 @@ public:
     params.testDetectorList(*ws);
   }
 
+  void test_with_dx_data_event() {
+    Parameters params("event-dx");
+    auto ws = runAlgorithm(params);
+
+    if (!ws) return;
+    params.testDx(*ws);
+  }
 
   // ---- test histo-ragged ----
 
@@ -373,6 +392,7 @@ public:
     auto ws = runAlgorithm(params, false);
   }
 
+
 private:
 
   // -----------------------  helper methods ------------------------
@@ -393,6 +413,10 @@ private:
       return createInputWithDetectors("histo");
     else if (workspaceType == "event-detector")
       return createInputWithDetectors("event");
+    else if (workspaceType == "histo-dx")
+      return createInputWorkspaceHistWithDx();
+    else if (workspaceType == "event-dx")
+      return createInputWorkspaceEventWithDx();
     throw std::runtime_error("Undefined workspace type");
   }
 
@@ -410,6 +434,18 @@ private:
     return space;
   }
 
+  MatrixWorkspace_sptr createInputWorkspaceHistWithDx() const {
+    auto ws = createInputWorkspaceHisto();
+    // Add the delta x values
+    for (size_t j = 0; j < nSpec; ++j) {
+      for (size_t k = 0; k <= nBins; ++k) {
+        // Add a constant error to all spectra
+        ws->dataDx(j)[k] = sqrt(double(k));
+      }
+    }
+    return ws;
+  }
+
   MatrixWorkspace_sptr createInputWorkspaceHistoRagged() const
   {
     // Set up a small workspace for testing
@@ -436,6 +472,21 @@ private:
     return ws;
   }
 
+  MatrixWorkspace_sptr createInputWorkspaceEventWithDx() const {
+    auto ws = createInputWorkspaceEvent();
+    // Add the delta x values
+    for (size_t j = 0; j < nSpec; ++j) {
+      Mantid::MantidVecPtr dXvals;
+      Mantid::MantidVec &dX = dXvals.access();
+      dX.resize(nBins + 1, 0.0);
+      for (size_t k = 0; k <= nBins; ++k) {
+        dX[k] = sqrt(double(k)) + 1;
+      }
+      ws->setDx(j, dXvals);
+    }
+    return ws;
+  }
+
   MatrixWorkspace_sptr createInputWithDetectors(std::string workspaceType) const
   {
     MatrixWorkspace_sptr ws;
@@ -456,8 +507,6 @@ private:
     return ws;
   }
 
-
-
   struct Parameters
   {
     Parameters(const std::string& workspaceType = "histo")
@@ -612,6 +661,30 @@ private:
       StartWorkspaceIndex = 1000;
       EndWorkspaceIndex = 1002;
     }
+
+    // ---- test Dx -------
+    void testDx(const MatrixWorkspace& ws) const {
+      if (wsType == "histo-dx") {
+        TS_ASSERT(ws.hasDx(0));
+        TS_ASSERT_EQUALS(ws.readDx(0)[0], 0.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[1], 1.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[2], sqrt(2.0));
+        TS_ASSERT_EQUALS(ws.readDx(0)[3], sqrt(3.0));
+        // Check that the length of x and dx is the same
+        auto x = ws.readX(0);
+        auto dX = ws.readDx(0);
+        TS_ASSERT_EQUALS(x.size(), dX.size());
+
+      } else if (wsType == "event-dx"){
+        TS_ASSERT(ws.hasDx(0));
+        TS_ASSERT_EQUALS(ws.readDx(0)[0], 0.0 + 1.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[1], 1.0 + 1.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[2], sqrt(2.0) + 1.0);
+        TS_ASSERT_EQUALS(ws.readDx(0)[3], sqrt(3.0) + 1.0);
+      } else {
+        TSM_ASSERT("Should never reach here", false);
+      }
+    }
   };
 
   MatrixWorkspace_sptr runAlgorithm(const Parameters& params, bool expectSuccess = true) const
diff --git a/Code/Mantid/Framework/Algorithms/test/ProcessIndirectFitParametersTest.h b/Code/Mantid/Framework/Algorithms/test/ProcessIndirectFitParametersTest.h
new file mode 100644
index 0000000000000000000000000000000000000000..07ddc16419e8f761369d23d691b823997537a8c9
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/test/ProcessIndirectFitParametersTest.h
@@ -0,0 +1,250 @@
+#ifndef MANTID_ALGORITHMS_PROCESSINDIRECTFITPARAMETERSTEST_H_
+#define MANTID_ALGORITHMS_PROCESSINDIRECTFITPARAMETERSTEST_H_
+
+#include <cxxtest/TestSuite.h>
+
+#include "MantidAlgorithms/ProcessIndirectFitParameters.h"
+#include "MantidAPI/ITableWorkspace.h"
+#include "MantidAPI/TableRow.h"
+
+using Mantid::Algorithms::ProcessIndirectFitParameters;
+using namespace Mantid::API;
+
+class ProcessIndirectFitParametersTest : public CxxTest::TestSuite {
+
+private:
+  ITableWorkspace_sptr createTable() {
+    auto tableWs = WorkspaceFactory::Instance().createTable();
+    tableWs->addColumn("double", "axis-1");
+    tableWs->addColumn("double", "f0.A0");
+    tableWs->addColumn("double", "f0.A0_Err");
+    tableWs->addColumn("double", "f1.f1.f0.Height");
+    tableWs->addColumn("double", "f1.f1.f0.Height_Err");
+    tableWs->addColumn("double", "f1.f1.f0.Amplitude");
+    tableWs->addColumn("double", "f1.f1.f0.Amplitude_Err");
+    tableWs->addColumn("double", "f1.f1.f0.PeakCentre");
+    tableWs->addColumn("double", "f1.f1.f0.PeakCentre_Err");
+
+    size_t n = 5;
+    for (size_t i = 0; i < n; ++i) {
+      TableRow row = tableWs->appendRow();
+      double ax1 = int(i) * 1.0;
+      double a0 = 0.0;
+      double a0e = 0.0;
+      double h = int(i) * 1.02;
+      double he = sqrt(h);
+      double am = int(i) * 2.43;
+      double ame = sqrt(am);
+      double pc = -0.0567;
+      double pce = sqrt(pc);
+      row << ax1 << a0 << a0e << h << he << am << ame << pc << pce;
+    }
+    return tableWs;
+  }
+
+  ITableWorkspace_sptr createIrregularTable() {
+    auto tableWs = WorkspaceFactory::Instance().createTable();
+    tableWs->addColumn("double", "axis-1");
+    tableWs->addColumn("double", "f1.f1.f0.Height");
+    tableWs->addColumn("double", "f1.f1.f0.Height_Err");
+    tableWs->addColumn("double", "f1.f1.f0.Amplitude");
+    tableWs->addColumn("double", "f1.f1.f0.Amplitude_Err");
+    tableWs->addColumn("double", "f1.f1.f1.Height");
+    tableWs->addColumn("double", "f1.f1.f1.Height_Err");
+    tableWs->addColumn("double", "f1.f1.f2.Height");
+    tableWs->addColumn("double", "f1.f1.f2.Height_Err");
+
+    size_t n = 5;
+    for (size_t i = 0; i < n; ++i) {
+      TableRow row = tableWs->appendRow();
+      double ax1 = int(i) * 1.0;
+      double h = int(i) * 1.02;
+      double he = sqrt(h);
+      double am = int(i) * 2.43;
+      double ame = sqrt(am);
+      double h1 = -0.0567;
+      double he1 = sqrt(h);
+      double h2 = int(i) * -0.25;
+      double he2 = sqrt(h2);
+      row << ax1 << h << he << am << ame << h1 << he1 << h2 << he2;
+    }
+    return tableWs;
+  }
+
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static ProcessIndirectFitParametersTest *createSuite() {
+    return new ProcessIndirectFitParametersTest();
+  }
+  static void destroySuite(ProcessIndirectFitParametersTest *suite) {
+    delete suite;
+  }
+
+  void test_empty_input_is_not_allowed() {
+    Mantid::Algorithms::ProcessIndirectFitParameters alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize());
+
+    TS_ASSERT_THROWS(alg.setPropertyValue("InputWorkspace", ""),
+                     std::invalid_argument);
+  }
+
+  void test_empty_x_column_is_not_allowed() {
+    Mantid::Algorithms::ProcessIndirectFitParameters alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize());
+
+    TS_ASSERT_THROWS(alg.setPropertyValue("ColumnX", ""),
+                     std::invalid_argument);
+  }
+
+  void test_empty_param_names_is_not_allowed() {
+    Mantid::Algorithms::ProcessIndirectFitParameters alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize());
+
+    TS_ASSERT_THROWS(alg.setPropertyValue("ParameterNames", ""),
+                     std::invalid_argument);
+  }
+
+  void test_empty_output_is_not_allowed() {
+    Mantid::Algorithms::ProcessIndirectFitParameters alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize());
+
+    TS_ASSERT_THROWS(alg.setPropertyValue("OutputWorkspace", ""),
+                     std::invalid_argument);
+  }
+
+  void test_property_input() {
+    auto tableWs = createTable();
+    std::string xColumn = "axis-1";
+    std::string parameterValues = "Amplitude";
+    std::string inAxis = "Degrees";
+    std::string outputName = "outMatrix";
+
+    Mantid::Algorithms::ProcessIndirectFitParameters alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize());
+    TS_ASSERT(alg.isInitialized());
+    alg.setProperty("InputWorkspace", tableWs);
+    alg.setPropertyValue("ColumnX", xColumn);
+    alg.setPropertyValue("ParameterNames", parameterValues);
+    alg.setPropertyValue("XAxisUnit", inAxis);
+    alg.setProperty("OutputWorkspace", outputName);
+
+    ITableWorkspace_sptr tableProp = alg.getProperty("InputWorkspace");
+
+    TS_ASSERT_EQUALS(tableProp, tableWs);
+    TS_ASSERT_EQUALS(std::string(alg.getProperty("ColumnX")), xColumn);
+    TS_ASSERT_EQUALS(std::string(alg.getProperty("ParameterNames")),
+                     parameterValues);
+    TS_ASSERT_EQUALS(std::string(alg.getProperty("XAxisUnit")), inAxis);
+    TS_ASSERT_EQUALS(std::string(alg.getProperty("OutputWorkspace")),
+                     outputName);
+  }
+
+  void test_output_of_regular_shaped_table_workspace() {
+    auto tableWs = createTable();
+    std::string xColumn = "axis-1";
+    std::string parameterValues = "Height,Amplitude";
+    std::string inAxis = "Degrees";
+    std::string outputName = "outMatrix";
+
+    Mantid::Algorithms::ProcessIndirectFitParameters alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize());
+    alg.setProperty("InputWorkspace", tableWs);
+    alg.setPropertyValue("ColumnX", xColumn);
+    alg.setPropertyValue("ParameterNames", parameterValues);
+    alg.setPropertyValue("XAxisUnit", inAxis);
+    alg.setProperty("OutputWorkspace", outputName);
+
+    alg.execute();
+
+    MatrixWorkspace_sptr outWs;
+    TS_ASSERT_THROWS_NOTHING(
+        outWs = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
+            outputName));
+    size_t const histNum = outWs->getNumberHistograms();
+    TS_ASSERT_EQUALS(histNum, 2);
+    TS_ASSERT_EQUALS(outWs->getAxis(1)->label(0), "f1.f1.f0.Height");
+    TS_ASSERT_EQUALS(outWs->getAxis(1)->label(1), "f1.f1.f0.Amplitude");
+
+    // 5 = The initial number of rows in the table workspace
+    TS_ASSERT_EQUALS(outWs->blocksize(), 5);
+
+    // Test output values
+    auto heightY = outWs->readY(0);
+    auto heightTest = std::vector<double>();
+    tableWs->getColumn("f1.f1.f0.Height")->numeric_fill(heightTest);
+    TS_ASSERT_EQUALS(heightY, heightTest);
+
+    auto ampY = outWs->readY(1);
+    auto ampTest = std::vector<double>();
+    tableWs->getColumn("f1.f1.f0.Amplitude")->numeric_fill(ampTest);
+    TS_ASSERT_EQUALS(ampY, ampTest);
+
+    // Test axis units
+    std::string outAxis = outWs->getAxis(0)->unit()->unitID();
+    TS_ASSERT_EQUALS(inAxis, outAxis);
+
+    AnalysisDataService::Instance().remove(outputName);
+  }
+
+  void test_output_of_irregular_shaped_table_workspace() {
+    auto tableWs = createIrregularTable();
+    std::string xColumn = "axis-1";
+    std::string parameterValues = "Height,Amplitude";
+    std::string inAxis = "Degrees";
+    std::string outputName = "outMatrix";
+
+    Mantid::Algorithms::ProcessIndirectFitParameters alg;
+    TS_ASSERT_THROWS_NOTHING(alg.initialize());
+    alg.setProperty("InputWorkspace", tableWs);
+    alg.setPropertyValue("ColumnX", xColumn);
+    alg.setPropertyValue("ParameterNames", parameterValues);
+    alg.setPropertyValue("XAxisUnit", inAxis);
+    alg.setProperty("OutputWorkspace", outputName);
+
+    alg.execute();
+
+    MatrixWorkspace_sptr outWs;
+    TS_ASSERT_THROWS_NOTHING(
+        outWs = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
+            outputName));
+    size_t const histNum = outWs->getNumberHistograms();
+    TS_ASSERT_EQUALS(histNum, 4);
+    TS_ASSERT_EQUALS(outWs->getAxis(1)->label(0), "f1.f1.f0.Height");
+    TS_ASSERT_EQUALS(outWs->getAxis(1)->label(1), "f1.f1.f0.Amplitude");
+    TS_ASSERT_EQUALS(outWs->getAxis(1)->label(2), "f1.f1.f1.Height");
+    TS_ASSERT_EQUALS(outWs->getAxis(1)->label(3), "f1.f1.f2.Height");
+
+    // 5 = The initial number of rows in the table workspace
+    TS_ASSERT_EQUALS(outWs->blocksize(), 5);
+
+    // Test output values
+    auto heightY = outWs->readY(0);
+    auto heightTest = std::vector<double>();
+    tableWs->getColumn("f1.f1.f0.Height")->numeric_fill(heightTest);
+    TS_ASSERT_EQUALS(heightY, heightTest);
+
+    auto ampY = outWs->readY(1);
+    auto ampTest = std::vector<double>();
+    tableWs->getColumn("f1.f1.f0.Amplitude")->numeric_fill(ampTest);
+    TS_ASSERT_EQUALS(ampY, ampTest);
+
+    auto height1Y = outWs->readY(2);
+    auto height1Test = std::vector<double>();
+    tableWs->getColumn("f1.f1.f1.Height")->numeric_fill(height1Test);
+    TS_ASSERT_EQUALS(height1Y, height1Test);
+
+    auto height2Y = outWs->readY(3);
+    auto height2Test = std::vector<double>();
+    tableWs->getColumn("f1.f1.f2.Height")->numeric_fill(height2Test);
+    TS_ASSERT_EQUALS(height2Y, height2Test);
+
+    // Test axis units
+    std::string outAxis = outWs->getAxis(0)->unit()->unitID();
+    TS_ASSERT_EQUALS(inAxis, outAxis);
+
+    AnalysisDataService::Instance().remove(outputName);
+  }
+};
+
+#endif /* MANTID_ALGORITHMS_PROCESSINDIRECTFITPARAMETERSTEST_H_ */
\ No newline at end of file
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
index ac3e99696f9b5a9f780a374fd116fe57a3115a74..04f4d559cefd4d001ef2d330d6e24d3658694be9 100644
--- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
@@ -91,6 +91,9 @@ private:
 
   // Remove lines from an input stream
   void skipLines(std::istream &strm, int nlines);
+
+  /// Check if we the data set stores an X-Error values
+  bool hasXerror(std::ifstream &stream);
 };
 }
 }
diff --git a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
index 0f3e2b96133d120c4e2ba53d32a9bf8d2ecddac7..9cffd124a302840793b0f2b8940737be8335fe0f 100644
--- a/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
+++ b/Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
@@ -5,6 +5,7 @@
 // Includes
 //----------------------------------------------------------------------
 #include "MantidAPI/Algorithm.h"
+#include "MantidDataObjects/Workspace2D.h"
 
 namespace Mantid {
 namespace DataHandling {
@@ -105,6 +106,9 @@ private:
   /// Overwrites Algorithm method
   void exec();
 
+  /// Saves out x errors
+  void saveXerrors(std::ofstream& stream, const Mantid::DataObjects::Workspace2D_sptr workspace, const size_t numberOfHist);
+
   /// The name of the file used for storing the workspace
   std::string m_filename;
 
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
index 6ee8786c72d63f3509a54a30fa83296af7899a76..c05af4bfa3f47d33cf42caed4f993dd1f14aa589 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadRKH.cpp
@@ -26,6 +26,45 @@ using namespace Mantid::Kernel;
 
 DECLARE_FILELOADER_ALGORITHM(LoadRKH)
 
+namespace {
+void readLinesForRKH1D(std::istream& stream, int readStart, int readEnd, std::vector<double>& columnOne,
+                       std::vector<double>& ydata, std::vector<double>& errdata, Progress& prog) {
+  std::string fileline = "";
+  for (int index = 1; index <= readEnd; ++index) {
+    getline(stream, fileline);
+    if (index < readStart)
+      continue;
+    double x(0.), y(0.), yerr(0.);
+    std::istringstream datastr(fileline);
+    datastr >> x >> y >> yerr;
+    columnOne.push_back(x);
+    ydata.push_back(y);
+    errdata.push_back(yerr);
+    prog.report();
+  }
+}
+
+void readLinesWithXErrorForRKH1D(std::istream& stream, int readStart, int readEnd, std::vector<double>& columnOne,
+                                 std::vector<double>& ydata, std::vector<double>& errdata, std::vector<double>& xError,
+                                 Progress& prog) {
+  std::string fileline = "";
+  for (int index = 1; index <= readEnd; ++index) {
+    getline(stream, fileline);
+    if (index < readStart)
+      continue;
+    double x(0.), y(0.), yerr(0.), xerr(0.);
+    std::istringstream datastr(fileline);
+    datastr >> x >> y >> yerr>>xerr;
+    columnOne.push_back(x);
+    ydata.push_back(y);
+    errdata.push_back(yerr);
+    xError.push_back(xerr);
+    prog.report();
+  }
+}
+}
+
+
 /**
  * Return the confidence with with this algorithm can load the file
  * @param descriptor A descriptor for the file
@@ -221,24 +260,22 @@ const API::MatrixWorkspace_sptr LoadRKH::read1D() {
 
   int pointsToRead = readEnd - readStart + 1;
   // Now stream sits at the first line of data
-  fileline = "";
-  std::vector<double> columnOne, ydata, errdata;
+  std::vector<double> columnOne, ydata, errdata, xError;
   columnOne.reserve(readEnd);
   ydata.reserve(readEnd);
   errdata.reserve(readEnd);
 
+  auto hasXError = hasXerror(m_fileIn);
+
   Progress prog(this, 0.0, 1.0, readEnd);
-  for (int index = 1; index <= readEnd; ++index) {
-    getline(m_fileIn, fileline);
-    if (index < readStart)
-      continue;
-    double x(0.), y(0.), yerr(0.);
-    std::istringstream datastr(fileline);
-    datastr >> x >> y >> yerr;
-    columnOne.push_back(x);
-    ydata.push_back(y);
-    errdata.push_back(yerr);
-    prog.report();
+
+  if (hasXError) {
+    xError.reserve(readEnd);
+    readLinesWithXErrorForRKH1D(m_fileIn, readStart, readEnd,
+                                columnOne, ydata, errdata, xError,  prog);
+  } else {
+    readLinesForRKH1D(m_fileIn, readStart, readEnd,
+                      columnOne, ydata, errdata, prog);
   }
   m_fileIn.close();
 
@@ -246,6 +283,10 @@ const API::MatrixWorkspace_sptr LoadRKH::read1D() {
   assert(pointsToRead == static_cast<int>(ydata.size()));
   assert(pointsToRead == static_cast<int>(errdata.size()));
 
+  if (hasXError) {
+    assert(pointsToRead == static_cast<int>(xError.size()));
+  }
+
   if (colIsUnit) {
     MatrixWorkspace_sptr localworkspace = WorkspaceFactory::Instance().create(
         "Workspace2D", 1, pointsToRead, pointsToRead);
@@ -254,7 +295,9 @@ const API::MatrixWorkspace_sptr LoadRKH::read1D() {
     localworkspace->dataX(0) = columnOne;
     localworkspace->dataY(0) = ydata;
     localworkspace->dataE(0) = errdata;
-
+    if (hasXError) {
+      localworkspace->dataDx(0) = xError;
+    }
     return localworkspace;
   } else {
     MatrixWorkspace_sptr localworkspace =
@@ -266,6 +309,12 @@ const API::MatrixWorkspace_sptr LoadRKH::read1D() {
       localworkspace->dataY(index)[0] = ydata[index];
       localworkspace->dataE(index)[0] = errdata[index];
     }
+
+    if (hasXError) {
+      for (int index = 0; index < pointsToRead; ++index) {
+        localworkspace->dataDx(index)[0] = xError[index];
+      }
+    }
     return localworkspace;
   }
 }
@@ -480,5 +529,27 @@ void LoadRKH::binCenter(const MantidVec oldBoundaries,
                         MantidVec &toCenter) const {
   VectorHelper::convertToBinCentre(oldBoundaries, toCenter);
 }
+
+/**
+ * Checks if there is an x error present in the data set
+ * @param stream:: the stream object 
+ */
+bool LoadRKH::hasXerror(std::ifstream &stream) {
+  auto containsXerror = false;
+  auto currentPutLocation = stream.tellg();
+  std::string line;
+  getline(stream, line);
+
+  std::string x,y, yerr, xerr;
+  std::istringstream datastr(line);
+  datastr >> x >> y >> yerr >> xerr;
+  if (!xerr.empty()) {
+    containsXerror = true;
+  }
+  // Reset the original location of the stream
+  stream.seekg(currentPutLocation, stream.beg);
+  return containsXerror;
+}
+
 }
 }
diff --git a/Code/Mantid/Framework/DataHandling/src/SaveCSV.cpp b/Code/Mantid/Framework/DataHandling/src/SaveCSV.cpp
index 8f38c1b278723052cb99cc8c932cece6d1407b38..b3212a59e0d2a63a6d59d4f22013029cb856c0b1 100644
--- a/Code/Mantid/Framework/DataHandling/src/SaveCSV.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SaveCSV.cpp
@@ -70,6 +70,11 @@ void SaveCSV::init() {
   declareProperty("LineSeparator", "\n",
                   "The string to place at the end of lines (default new line\n"
                   "character)");
+  declareProperty(
+      new PropertyWithValue<bool>("SaveXerrors", 0, Direction::Input),
+      "This option saves out the x errors if any are present. If you have x errors\n"
+      "in your workspace and you do not select this option, then the x errors\n"
+      "are not saved to the file.");
 }
 
 /** Executes the algorithm. Retrieve the Filename, separator and Lineseparator
@@ -179,6 +184,11 @@ void SaveCSV::exec() {
       p.report();
     }
 
+    // Potentially save the x errors
+    if (getProperty("SaveXerrors")) {
+      saveXerrors(outCSV_File, localworkspace, numberOfHist);
+    }
+
   } else {
     outCSV_File.close(); // and should probably delete file from disk as well
     throw Exception::NotImplementedError(
@@ -189,5 +199,26 @@ void SaveCSV::exec() {
   return;
 }
 
+
+void SaveCSV::saveXerrors(std::ofstream& stream, const Mantid::DataObjects::Workspace2D_sptr workspace, const size_t numberOfHist) {
+  // If there isn't a dx values present in the first entry then return
+  if (!workspace->hasDx(0)) {
+    return;
+  }
+  Progress p(this, 0.0, 1.0, numberOfHist);
+  stream << "\nXERRORS\n";
+  for (size_t i = 0; i < numberOfHist; i++) {
+    const MantidVec &dXvalue = workspace->dataDx(i);
+
+    stream << i;
+
+    for (int j = 0; j < (int)dXvalue.size(); j++) {
+      stream<< std::setw(15) << dXvalue[j] << m_separator;
+    }
+    stream << m_lineSeparator;
+    p.report("Saving x errors...");
+  }
+}
+
 } // namespace DataHandling
 } // namespace Mantid
diff --git a/Code/Mantid/Framework/DataHandling/src/SaveRKH.cpp b/Code/Mantid/Framework/DataHandling/src/SaveRKH.cpp
index f590b3c5574ade374d69378aef6e0c2e7ccca526..3e7ff6d9eadb67d3ac57bf088bedf4ae3369b038 100644
--- a/Code/Mantid/Framework/DataHandling/src/SaveRKH.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SaveRKH.cpp
@@ -164,18 +164,35 @@ void SaveRKH::write1D() {
       specid = static_cast<specid_t>(i + 1);
     }
 
+    auto hasDx = m_workspace->hasDx(i);
+    //hasDx = false;
+    // We only want to access the dx values if they exist. In case they don't exist
+    // set the dXData const reference to the X value. The value will not be used later on.
+    const auto &dXdata = hasDx ? m_workspace->readDx(i) : m_workspace->readX(i);
+
     for (size_t j = 0; j < nbins; ++j) {
       // Calculate/retrieve the value to go in the first column
       double xval(0.0);
+      double dXval(0.0);
       if (horizontal)
         xval = histogram ? 0.5 * (xdata[j] + xdata[j + 1]) : xdata[j];
       else {
         xval = static_cast<double>(specid);
       }
 
+      if (hasDx) {
+        dXval = histogram ? 0.5 * (dXdata[j] + dXdata[j + 1]) : dXdata[j];
+      }
+
       m_outRKH << std::fixed << std::setw(12) << std::setprecision(5) << xval
                << std::scientific << std::setw(16) << std::setprecision(6)
-               << ydata[j] << std::setw(16) << edata[j] << "\n";
+               << ydata[j] << std::setw(16) << edata[j];
+
+      if (hasDx) {
+        m_outRKH << std::setw(16) << dXval;
+      }
+
+      m_outRKH << "\n";
 
       prg.report();
     }
diff --git a/Code/Mantid/Framework/DataHandling/test/LoadRKHTest.h b/Code/Mantid/Framework/DataHandling/test/LoadRKHTest.h
index 477928bc782545467c3036d240d5e2693cbd4fa9..d8d05bde20282ba2c9222e7f2e95a67e379d205f 100644
--- a/Code/Mantid/Framework/DataHandling/test/LoadRKHTest.h
+++ b/Code/Mantid/Framework/DataHandling/test/LoadRKHTest.h
@@ -21,7 +21,7 @@ public:
   static void destroySuite(LoadRKHTest *suite) { delete suite; }
 
   // A sample file is in the repository
-  LoadRKHTest() : dataFile(""), tempFile("LoadRKH_test_file_2D")
+  LoadRKHTest() : dataFile(""), tempFile("LoadRKH_test_file_2D"), tempFile2("LoadRKH_test_file_1D_with_DX")
   {    
     dataFile = "DIRECT.041";
   }
@@ -38,6 +38,7 @@ public:
 
   void testInit()
   {
+    Mantid::DataHandling::LoadRKH loadrkh;
     TS_ASSERT_THROWS_NOTHING( loadrkh.initialize());
     TS_ASSERT( loadrkh.isInitialized() );
   }
@@ -46,7 +47,7 @@ public:
   {
     // Set the facility
     ConfigService::Instance().setString("default.facility", "ISIS");
-
+     Mantid::DataHandling::LoadRKH loadrkh;
     if ( !loadrkh.isInitialized() ) loadrkh.initialize();
 
     //No parameters have been set yet, so it should throw
@@ -66,7 +67,7 @@ public:
     //Should now throw nothing
     TS_ASSERT_THROWS_NOTHING( loadrkh.execute() );
     TS_ASSERT( loadrkh.isExecuted() );
-    
+
     using namespace Mantid::API;
     using namespace Mantid::DataObjects;
     //Now need to test the resultant workspace, first retrieve it
@@ -108,8 +109,8 @@ public:
     TS_ASSERT_DELTA( data->dataE(0)[0], 0.122346, tolerance );
     TS_ASSERT_DELTA( data->dataE(0)[25], 0.018345, tolerance );
     TS_ASSERT_DELTA( data->dataE(0)[99], 0.0, tolerance );
-
   }
+
   void test2D()
   {
     // Set the facility
@@ -185,9 +186,69 @@ public:
     remove(tempFile.c_str());
   }
 
+
+  void test1DWithDx()
+  {
+
+    // Arrange
+    ConfigService::Instance().setString("default.facility", "ISIS");
+    writeTestFileWithDx();
+    std::string outputSpace = "outer_1d_with_dx";
+
+    // Act
+    Mantid::DataHandling::LoadRKH rkhAlg;
+    rkhAlg.initialize();
+    rkhAlg.setPropertyValue("Filename", tempFile2);
+    rkhAlg.setPropertyValue("OutputWorkspace", outputSpace);
+
+    // Assert
+    std::string result;
+    TS_ASSERT_THROWS_NOTHING( result = rkhAlg.getPropertyValue("Filename") )
+    TS_ASSERT_THROWS_NOTHING( result = rkhAlg.getPropertyValue("OutputWorkspace") )
+    TS_ASSERT( result == outputSpace );
+    TS_ASSERT_THROWS_NOTHING( rkhAlg.execute() );
+    TS_ASSERT( rkhAlg.isExecuted() );
+
+    using namespace Mantid::API;
+    using namespace Mantid::DataObjects;
+    //Now need to test the resultant workspace, first retrieve it
+    Workspace_sptr rkhspace;
+
+    TS_ASSERT_THROWS_NOTHING( rkhspace = AnalysisDataService::Instance().retrieve(outputSpace) );
+    Workspace2D_sptr data = boost::dynamic_pointer_cast<Workspace2D>(rkhspace);
+
+    TS_ASSERT_EQUALS( data->getNumberHistograms(), 1);
+
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataX(0).size()), 10);
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataDx(0).size()), 10);
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataY(0).size()), 10);
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataY(0).size()), 10);
+    TS_ASSERT_EQUALS( static_cast<int>(data->dataE(0).size()), 10);
+
+    double tolerance(1e-06);
+
+    TS_ASSERT_DELTA( data->dataX(0)[0], 0.5, tolerance );
+    TS_ASSERT_DELTA( data->dataX(0)[1], 1.5 , tolerance );
+    TS_ASSERT_DELTA( data->dataX(0)[2], 2.5, tolerance ); 
+
+    TS_ASSERT_DELTA( data->dataY(0)[0], 1.000000e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataY(0)[1], 1.000000e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataY(0)[1], 1.000000e+00, tolerance );
+
+    TS_ASSERT_DELTA( data->dataE(0)[1], 1.000000e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataE(0)[0], 1.000000e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataE(0)[1], 1.000000e+00, tolerance );
+
+
+    TS_ASSERT_DELTA( data->dataDx(0)[0], 5.000000e-01, tolerance );
+    TS_ASSERT_DELTA( data->dataDx(0)[1], 1.207107e+00, tolerance );
+    TS_ASSERT_DELTA( data->dataDx(0)[2], 1.573132e+00, tolerance ); 
+
+    remove(tempFile2.c_str());
+  }
+
 private:
-  Mantid::DataHandling::LoadRKH loadrkh;
-  std::string dataFile, tempFile;
+  std::string dataFile, tempFile, tempFile2;
   
   /** Create a tiny 2x2 workspace in a tempory file that should
   *  be deleted
@@ -213,6 +274,26 @@ private:
       file << "1 2 3 4\n";
       file.close();
     }
+
+  void writeTestFileWithDx() {
+      std::ofstream file(tempFile2.c_str());
+      file << "        Thu 20-AUG-2015 08:30 Workspace: testInputThree\n";
+      file << " \n";
+      file << "   10    0    0    0    1   10    0\n";
+      file << "         0         0         0         0\n";
+      file << " 3 (F12.5,2E16.6)\n";
+      file << "     0.50000    1.000000e+00    1.000000e+00    5.000000e-01\n";
+      file << "     1.50000    1.000000e+00    1.000000e+00    1.207107e+00\n";
+      file << "     2.50000    1.000000e+00    1.000000e+00    1.573132e+00\n";
+      file << "     3.50000    1.000000e+00    1.000000e+00    1.866025e+00\n";
+      file << "     4.50000    1.000000e+00    1.000000e+00    2.118034e+00\n";
+      file << "     5.50000    1.000000e+00    1.000000e+00    2.342779e+00\n";
+      file << "     6.50000    1.000000e+00    1.000000e+00    2.547621e+00\n";
+      file << "     7.50000    1.000000e+00    1.000000e+00    2.737089e+00\n";
+      file << "     8.50000    1.000000e+00    1.000000e+00    2.914214e+00\n";
+      file << "     9.50000    1.000000e+00    1.000000e+00    3.081139e+00\n";
+      file.close();
+  }
 };
 
 
diff --git a/Code/Mantid/Framework/DataHandling/test/SaveCSVTest.h b/Code/Mantid/Framework/DataHandling/test/SaveCSVTest.h
index 85c77742ab8cc57aa7150346fdfd451c29d8b358..4d5f8a8059d17e5f66efa616bc4dd12b7cd9a11c 100644
--- a/Code/Mantid/Framework/DataHandling/test/SaveCSVTest.h
+++ b/Code/Mantid/Framework/DataHandling/test/SaveCSVTest.h
@@ -23,6 +23,11 @@ using namespace Mantid::DataObjects;
 // Notice also that currently no tests have been added to test
 // this class when trying to save a 2D workspace with SaveCSV. 
 
+namespace {
+  const size_t nBins = 3;
+}
+
+
 class SaveCSVTest : public CxxTest::TestSuite
 {
 public: 
@@ -46,8 +51,7 @@ public:
     
     AnalysisDataService::Instance().add("SAVECSVTEST-testSpace", localWorkspace);
   }
-  
-  
+
   void testInit()
   {
     TS_ASSERT_THROWS_NOTHING(algToBeTested.initialize());
@@ -104,19 +108,156 @@ public:
     TS_ASSERT_DELTA(d2, 0.1, 1e-5);
     TS_ASSERT_DELTA(d3, 0.2, 1e-5);
     TS_ASSERT_EQUALS( number_plus_comma, "0.3," );
-    
-    
+
     // remove file created by this algorithm
     Poco::File(outputFile).remove();
     AnalysisDataService::Instance().remove("SAVECSVTEST-testSpace");
-  
   }
 
-  
+
+  void test_saving_1D_error_with_x_error() {
+    std::string fileName = "test_save_csv_with_x_errors_1D.csv";
+    const size_t numberOfSpectra = 1;
+    runTestWithDx(fileName, numberOfSpectra);
+  }
+
+  void test_saving_2D_error_with_x_error() {
+    std::string fileName = "test_save_csv_with_x_errors_2D.csv";
+    const size_t numberOfSpectra = 3;
+    runTestWithDx(fileName, numberOfSpectra);
+  }
+
 private:
   SaveCSV algToBeTested;
   std::string outputFile;
-  
+
+  MatrixWorkspace_sptr createWorkspaceWithDxValues(const size_t nSpec) const {
+    auto ws = WorkspaceFactory::Instance().create("Workspace2D", nSpec, nBins+1, nBins);
+    for (size_t j = 0; j < nSpec; ++j) {
+      for (size_t k = 0; k < nBins + 1; ++k) {
+        ws->dataX(j)[k] = double(k);
+      }
+      ws->dataY(j).assign(nBins, double(j));
+      ws->dataE(j).assign(nBins, sqrt(double(j)));
+      ws->dataDx(j).assign(nBins + 1, sqrt(double(j)));
+    }
+    return ws;
+  }
+
+  void runTestWithDx(std::string fileName, const size_t nSpec) {
+     // Arrange
+    auto ws = createWorkspaceWithDxValues(nSpec);
+
+    // Act
+    SaveCSV saveCSV;
+    TS_ASSERT_THROWS_NOTHING(saveCSV.initialize());
+    TS_ASSERT(saveCSV.isInitialized());
+    saveCSV.setProperty("InputWorkspace", ws);
+    saveCSV.setProperty("SaveXerrors", true);
+    saveCSV.setPropertyValue("Filename", fileName);
+    fileName = saveCSV.getPropertyValue("Filename");
+
+    TS_ASSERT_THROWS_NOTHING(saveCSV.execute());
+    TS_ASSERT(saveCSV.isExecuted() );  
+
+    // Assert
+    TS_ASSERT( Poco::File(fileName).exists() );
+    evaluateFileWithDX(fileName, nSpec);
+
+    // Clean up
+    Poco::File(fileName).remove();
+  }
+
+  void evaluateFileWithDX(std::string fileName, const size_t nSpec) const {
+    std::ifstream stream(fileName.c_str());
+    std::istringstream dataStream;
+    std::string line;
+
+    std::string stringMarker;
+    double indexMarker;
+    double d1, d2, d3, dEnd; // There are 3 bins
+    std::string separator;
+
+    // Evalute the first line. We are expecting only one line for the Xvalues here.
+    getline(stream, line);
+    dataStream.str(std::string());
+    dataStream.clear();
+    dataStream.str(line);
+    dataStream >> stringMarker >> d1 >> separator >> d2 >> separator >> d3 >> separator >> dEnd >> separator;
+
+    TS_ASSERT_EQUALS(stringMarker,"A" );
+    TS_ASSERT_EQUALS(separator,"," );
+    TS_ASSERT_DELTA(d1, 0.0, 1e-5);
+    TS_ASSERT_DELTA(d2, 1.0, 1e-5);
+    TS_ASSERT_DELTA(d3, 2.0, 1e-5);
+    TS_ASSERT_DELTA(dEnd, 3.0, 1e-5);
+
+    // Now evaluate the Y value entries which follow directly after
+    for (size_t spec = 0; spec < nSpec; ++spec) {
+      getline(stream, line);
+      dataStream.str(std::string());
+      dataStream.clear();
+      dataStream.str(line);
+      dataStream >> indexMarker >> d1 >> separator >> d2 >> separator >> d3 >> separator;
+      TS_ASSERT_EQUALS(indexMarker, double(spec));
+      TS_ASSERT_EQUALS(separator,"," );
+      TS_ASSERT_DELTA(d1, double(spec), 1e-5);
+      TS_ASSERT_DELTA(d2, double(spec), 1e-5);
+      TS_ASSERT_DELTA(d3, double(spec), 1e-5);
+    }
+
+    // We expect an empty line here
+    getline(stream, line);
+
+    // Check the ERROR identifier
+    getline(stream, line);
+    dataStream.str(std::string());
+    dataStream.clear();
+    dataStream.str(line);
+    dataStream >> stringMarker;
+    TS_ASSERT_EQUALS(stringMarker,"ERRORS" );
+
+    // Check the y errors
+    for (size_t spec = 0; spec < nSpec; ++spec) {
+      getline(stream, line);
+      dataStream.str(std::string());
+      dataStream.clear();
+      dataStream.str(line);
+      dataStream >> indexMarker >> d1 >> separator >> d2 >> separator >> d3 >> separator;
+      TS_ASSERT_EQUALS(indexMarker, spec);
+      TS_ASSERT_EQUALS(separator,"," );
+      TS_ASSERT_DELTA(d1, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(d2, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(d3, sqrt(double(spec)), 1e-5);
+    }
+
+    // We expect an empty line here
+    getline(stream, line);
+
+    // Check the XERROR identifier
+    getline(stream, line);
+    dataStream.str(std::string());
+    dataStream.clear();
+    dataStream.str(line);
+    dataStream >> stringMarker;
+    TS_ASSERT_EQUALS(stringMarker,"XERRORS" );
+
+    // Check the x errors
+    for (size_t spec = 0; spec < nSpec; ++spec) {
+      getline(stream, line);
+      dataStream.str(std::string());
+      dataStream.clear();
+      dataStream.str(line);
+      dataStream >> indexMarker >> d1 >> separator >> d2 >> separator >> d3 >> separator >> dEnd >> separator;
+      TS_ASSERT_EQUALS(indexMarker, spec);
+      TS_ASSERT_EQUALS(separator,"," );
+      TS_ASSERT_DELTA(d1, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(d2, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(d3, sqrt(double(spec)), 1e-5);
+      TS_ASSERT_DELTA(dEnd, sqrt(double(spec)), 1e-5);
+    }
+    stream.close();
+  }
 };
   
 #endif /*SAVECSVTEST_H_*/
diff --git a/Code/Mantid/Framework/DataHandling/test/SaveRKHTest.h b/Code/Mantid/Framework/DataHandling/test/SaveRKHTest.h
index 75a0ee1b7c4bd483b8943194ada32344e80d6669..3b943100d9ce28ee3bb935223065c0b59abcfddc 100644
--- a/Code/Mantid/Framework/DataHandling/test/SaveRKHTest.h
+++ b/Code/Mantid/Framework/DataHandling/test/SaveRKHTest.h
@@ -7,12 +7,19 @@
 
 #include <fstream>
 #include <Poco/File.h>
+using namespace Mantid::API;
+
+namespace {
+  const size_t nSpec = 1;
+  const size_t nBins = 10;
+}
+
 
 class SaveRKHTest : public CxxTest::TestSuite
 {
 public:
 
-    static SaveRKHTest *createSuite() { return new SaveRKHTest(); }
+  static SaveRKHTest *createSuite() { return new SaveRKHTest(); }
   static void destroySuite(SaveRKHTest *suite) { delete suite; }
   ///Constructor
   SaveRKHTest() : outputFile("SAVERKH.out")
@@ -34,7 +41,6 @@ public:
  
     TS_ASSERT_THROWS_NOTHING(testAlgorithm2.initialize());
     TS_ASSERT_EQUALS(testAlgorithm2.isInitialized(), true);
- 
   }
 
   void testExecHorizontal()
@@ -43,9 +49,7 @@ public:
     
     //No parameters have been set yet, so it should throw
     TS_ASSERT_THROWS(testAlgorithm1.execute(), std::runtime_error);
-    
     //Need a test workspace to use as input
-    using namespace Mantid::API;
     MatrixWorkspace_sptr inputWS1 = WorkspaceCreationHelper::Create2DWorkspaceBinned(1, 10, 1.0);
     inputWS1->isDistribution(true);
 
@@ -177,12 +181,107 @@ public:
     file2.close();
   }
 
+  void testExecWithDx() {
+
+    if ( !testAlgorithm3.isInitialized() ) testAlgorithm3.initialize();
+
+    //No parameters have been set yet, so it should throw
+    TS_ASSERT_THROWS(testAlgorithm3.execute(), std::runtime_error);
+    //Need a test workspace to use as input
+    auto inputWS3 = createInputWorkspaceHistoWithXerror();
+    inputWS3->isDistribution(false);
+
+    //Register workspace
+    AnalysisDataService::Instance().add("testInputThree", inputWS3);
+
+    testAlgorithm3.setPropertyValue("InputWorkspace", "testInputThree");
+    testAlgorithm3.setPropertyValue("Filename", outputFile);
+    outputFile = testAlgorithm3.getPropertyValue("Filename"); //get absolute path
+    testAlgorithm3.setProperty<bool>("Append", false);
+
+    //Execute the algorithm
+    TS_ASSERT_THROWS_NOTHING( testAlgorithm3.execute() );
+    TS_ASSERT( testAlgorithm3.isExecuted() );
+
+    //Check if the file exists
+    TS_ASSERT( Poco::File(outputFile).exists() );
+
+    //Open it and check a few lines
+    std::ifstream file(outputFile.c_str());
+
+    TS_ASSERT(file);
+
+    //Bury the first 5 lines and then read the next
+    int count(0);
+    std::string fileline;
+    while( ++count < 7 )
+    {
+      getline(file, fileline);
+    }
+    std::istringstream strReader(fileline);
+    double x(0.0), y(0.0), err(0.0), dx(0.0);
+    strReader >> x >> y >> err >> dx;
+
+    //Test values
+    TSM_ASSERT_DELTA("Expecting mean of 0 and 1", x, 0.5, 1e-08);  
+    TSM_ASSERT_DELTA("Expecting mean of 1 and 1", y, 1.0, 1e-08);
+    TSM_ASSERT_DELTA("Expecting mean of 1 and 1",err, 1.0, 1e-06);
+    TSM_ASSERT_DELTA("Expecting mean of sqrt(0) and sqrt(1)",dx, 0.5, 1e-06);
+
+    //We are at the first data entry now. We step over
+    // Three more entries
+    count = 0;
+    while( ++count < 4)
+    {
+      getline(file, fileline);
+    }
+
+    x = 0.0;
+    y = 0.0;
+    err = 0.0;
+    dx = 0.0;
+    strReader.clear();
+    strReader.str(fileline.c_str());
+    strReader >> x >> y >> err >> dx;
+
+    //Test values
+    TSM_ASSERT_DELTA("Expecting mean of 3 and 4", x, 3.5, 1e-08);  
+    TSM_ASSERT_DELTA("Expecting mean of 1 and 1", y, 1.0, 1e-08);
+    TSM_ASSERT_DELTA("Expecting mean of 1 and 1",err, 1.0, 1e-06);
+    TSM_ASSERT_DELTA("Expecting mean of sqrt(3) and sqrt(4)",dx, (sqrt(3) + sqrt(4))/2, 1e-06);
+
+    file.close();
+  }
+
 private:
   ///The algorithm object
-  Mantid::DataHandling::SaveRKH testAlgorithm1, testAlgorithm2;
+  Mantid::DataHandling::SaveRKH testAlgorithm1, testAlgorithm2, testAlgorithm3;
 
   ///The name of the file to use as output
   std::string outputFile;
+
+  /// Provides a workpace with a x error value
+  MatrixWorkspace_sptr createInputWorkspaceHistoWithXerror(std::string type = "histo") const
+  {
+    size_t x_length = 0;
+    size_t y_length = nBins;
+    if (type == "histo") {
+      x_length = nBins + 1;
+    } else  {
+      x_length = nBins;
+    }
+    // Set up a small workspace for testing
+    MatrixWorkspace_sptr ws = WorkspaceFactory::Instance().create("Workspace2D", nSpec, x_length, y_length);
+    for (size_t j = 0; j < nSpec; ++j) {
+      for (size_t k = 0; k < x_length; ++k) {
+        ws->dataX(j)[k] = double(k);
+        ws->dataDx(j)[k] = sqrt(double(k));
+      }
+      ws->dataY(j).assign(y_length, double(1));
+      ws->dataE(j).assign(y_length, double(1));
+    }
+    return ws;
+  }
 };
 
 #endif  //SAVERKHTEST_H_
diff --git a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/MaskWorkspace.h b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/MaskWorkspace.h
index b118982fdd98d0016683e4cfd6d8a81f570771ff..1669d410c291fc4c35c8aa9533d92262f1a55d57 100644
--- a/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/MaskWorkspace.h
+++ b/Code/Mantid/Framework/DataObjects/inc/MantidDataObjects/MaskWorkspace.h
@@ -53,6 +53,7 @@ protected:
 private:
   virtual MaskWorkspace *doClone() const { return new MaskWorkspace(*this); }
 
+  virtual IMaskWorkspace *doInterfaceClone() const { return doClone(); };
   /// Clear original incorrect mask
   void clearMask();
 
diff --git a/Code/Mantid/Framework/DataObjects/src/ReflectometryTransform.cpp b/Code/Mantid/Framework/DataObjects/src/ReflectometryTransform.cpp
index 14677dc7f6140450390c6a649d6503d8e8b06df1..82e5d37386822fafb0d2c9de606b8996809d538c 100644
--- a/Code/Mantid/Framework/DataObjects/src/ReflectometryTransform.cpp
+++ b/Code/Mantid/Framework/DataObjects/src/ReflectometryTransform.cpp
@@ -272,22 +272,23 @@ MatrixWorkspace_sptr ReflectometryTransform::executeNormPoly(
     const double thetaUpper = theta + thetaHalfWidth;
 
     const MantidVec &X = inputWS->readX(0);
-
+    
     for (size_t j = 0; j < nBins; ++j) {
       const double lamLower = X[j];
       const double lamUpper = X[j + 1];
 
       // fractional rebin
       m_calculator->setThetaFinal(thetaLower);
-      const V2D ll(m_calculator->calculateDim0(lamLower),
-                   m_calculator->calculateDim1(lamLower));
+      const V2D ur(m_calculator->calculateDim0(lamLower), //highest qx 
+                   m_calculator->calculateDim1(lamLower)); 
       const V2D lr(m_calculator->calculateDim0(lamUpper),
-                   m_calculator->calculateDim1(lamUpper));
+                   m_calculator->calculateDim1(lamUpper)); //lowest qz 
       m_calculator->setThetaFinal(thetaUpper);
       const V2D ul(m_calculator->calculateDim0(lamLower),
-                   m_calculator->calculateDim1(lamLower));
-      const V2D ur(m_calculator->calculateDim0(lamUpper),
-                   m_calculator->calculateDim1(lamUpper));
+                   m_calculator->calculateDim1(lamLower)); //highest qz 
+      const V2D ll(m_calculator->calculateDim0(lamUpper),  //lowest qx  
+                   m_calculator->calculateDim1(lamUpper)); 
+               
 
       Quadrilateral inputQ(ll, lr, ur, ul);
       FractionalRebinning::rebinToFractionalOutput(inputQ, inputWS, i, j, outWS,
@@ -319,6 +320,7 @@ MatrixWorkspace_sptr ReflectometryTransform::executeNormPoly(
   return outWS;
 }
 
+
 /**
  * A map detector ID and Q ranges
  * This method looks unnecessary as it could be calculated on the fly but
@@ -335,7 +337,7 @@ void ReflectometryTransform::initAngularCaches(
 
   auto inst = workspace->getInstrument();
   const auto samplePos = inst->getSample()->getPos();
-  const PointingAlong upDir = inst->getReferenceFrame()->pointingUp();
+  const V3D upDirVec = inst->getReferenceFrame()->vecPointingUp();
 
   for (size_t i = 0; i < nhist; ++i) // signed for OpenMP
   {
@@ -356,9 +358,8 @@ void ReflectometryTransform::initAngularCaches(
       continue;
     }
     // We have to convert theta from radians to degrees
-    const double theta = workspace->detectorTwoTheta(det) * 180.0 / M_PI;
+    const double theta = workspace->detectorSignedTwoTheta(det) * 180.0 / M_PI;
     m_theta[i] = theta;
-
     /**
      * Determine width from shape geometry. A group is assumed to contain
      * detectors with the same shape & r, theta value, i.e. a ring mapped-group
@@ -370,7 +371,7 @@ void ReflectometryTransform::initAngularCaches(
       auto dets = group->getDetectors();
       det = dets[0];
     }
-    const auto pos = det->getPos();
+    const auto pos = det->getPos() - samplePos;
     double l2(0.0), t(0.0), p(0.0);
     pos.getSpherical(l2, t, p);
     // Get the shape
@@ -380,10 +381,12 @@ void ReflectometryTransform::initAngularCaches(
     BoundingBox bbox = shape->getBoundingBox();
     auto maxPoint(bbox.maxPoint());
     rot.rotate(maxPoint);
-    double boxWidth = maxPoint[upDir];
+    double halfBoxHeight = maxPoint.scalar_prod(upDirVec);
 
-    m_thetaWidths[i] = std::fabs(2.0 * std::atan(boxWidth / l2)) * 180.0 / M_PI;
-  }
+    m_thetaWidths[i] = 2.0 * std::fabs(std::atan(halfBoxHeight / l2)) * 180.0 / M_PI;
+ 
+
+}
 }
 }
 }
diff --git a/Code/Mantid/Framework/DataObjects/src/Workspace2D.cpp b/Code/Mantid/Framework/DataObjects/src/Workspace2D.cpp
index d63a72f2eba438acbf9526767f4ef40b0f43d7cb..cdf82094ac054330ad6032445e9d0d749135c346 100644
--- a/Code/Mantid/Framework/DataObjects/src/Workspace2D.cpp
+++ b/Code/Mantid/Framework/DataObjects/src/Workspace2D.cpp
@@ -67,6 +67,7 @@ void Workspace2D::init(const std::size_t &NVectors, const std::size_t &XLength,
     // Set the data and X
     spec->setX(t1);
     spec->setDx(t1);
+    spec->resetHasDx();
     // Y,E arrays populated
     spec->setData(t2, t2);
     // Default spectrum number = starts at 1, for workspace index 0.
diff --git a/Code/Mantid/Framework/Kernel/src/DateAndTime.cpp b/Code/Mantid/Framework/Kernel/src/DateAndTime.cpp
index 6a3189f807723f5ae9013bbb9c075d527c5e057f..b8d7f7bc480f4d73ef3d1b056deaa33503bdf191 100644
--- a/Code/Mantid/Framework/Kernel/src/DateAndTime.cpp
+++ b/Code/Mantid/Framework/Kernel/src/DateAndTime.cpp
@@ -144,9 +144,8 @@ DateAndTime::DateAndTime(const int64_t total_nanoseconds) {
 /** Construct a time from an ISO8601 string
  *
  * @param ISO8601_string: and ISO8601 formatted string.
- *    "yyyy-mm-ddThh:mm:ss[Z+-]tz:tz"; although the T can be replaced by a
- *space,
- *    and the time is optional, as is the time-zone specification.
+ *    "yyyy-mm-ddThh:mm:ss[Z+-]tz:tz"; although the T can be replaced by a space.
+ *    The time must included, but the time-zone specification is optional.
  */
 DateAndTime::DateAndTime(const std::string ISO8601_string) : _nanoseconds(0) {
   this->setFromISO8601(ISO8601_string);
@@ -452,8 +451,7 @@ void DateAndTime::setFromISO8601(const std::string str) {
   // seem to accept only a date as valid, whereas later versions do not. We want
   // the
   // string to always denote the full timestamp so we check for a colon and if
-  // it is
-  // not present then assume the time has not been given
+  // it is not present then throw an exception.
   if (time.find(":") == std::string::npos)
     throw std::invalid_argument("Error interpreting string '" + str +
                                 "' as a date/time.");
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp
index 3ba4d526f37ef259948aaadc8dc1cb5d6f836a6f..d0ed6e752334db375786afe1b5e911c796266b7a 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ISpectrum.cpp
@@ -26,5 +26,7 @@ void export_ISpectrum() {
       .def("clearDetectorIDs", &ISpectrum::clearDetectorIDs,
            "Clear the set of detector IDs")
       .def("setSpectrumNo", &ISpectrum::setSpectrumNo,
-           "Set the spectrum number for this spectrum");
+           "Set the spectrum number for this spectrum")
+      .def("hasDx", &ISpectrum::hasDx,
+           "Returns True if the spectrum uses the DX (X Error) array, else False.");
 }
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
index 6437dcc7a4a8fb622c1e5324a189aa1a4e73f83d..fbd249555c005b3d792c150b4c195d1a2876b5be 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
@@ -103,6 +103,18 @@ void setEFromPyObject(MatrixWorkspace &self, const size_t wsIndex,
   setSpectrumFromPyObject(self, &MatrixWorkspace::dataE, wsIndex, values);
 }
 
+
+/**
+ * Set the Dx values from an python array-style object
+ * @param self :: A reference to the calling object
+ * @param wsIndex :: The workspace index for the spectrum to set
+ * @param values :: A numpy array. The length must match the size of the
+ */
+void setDxFromPyObject(MatrixWorkspace &self, const size_t wsIndex,
+                      numeric::array values) {
+  setSpectrumFromPyObject(self, &MatrixWorkspace::dataDx, wsIndex, values);
+}
+
 /**
  * Adds a deprecation warning to the getNumberBins call to warn about using
  * blocksize instead
@@ -229,7 +241,8 @@ void export_MatrixWorkspace() {
            args("self", "workspaceIndex"), "Creates a read-only numpy wrapper "
                                            "around the original Dx data at the "
                                            "given index")
-
+      .def("hasDx", &MatrixWorkspace::hasDx,args("self", "workspaceIndex"),
+           "Returns True if the spectrum uses the DX (X Error) array, else False.")
       //--------------------------------------- Write spectrum data
       //------------------------
       .def("dataX", (data_modifier)&MatrixWorkspace::dataX,
@@ -257,6 +270,9 @@ void export_MatrixWorkspace() {
       .def("setE", &setEFromPyObject, args("self", "workspaceIndex", "e"),
            "Set E values from a python list or numpy array. It performs a "
            "simple copy into the array.")
+      .def("setDx", &setDxFromPyObject, args("self", "workspaceIndex", "dX"),
+           "Set Dx values from a python list or numpy array. It performs a "
+           "simple copy into the array.")
 
       // --------------------------------------- Extract data
       // ------------------------------
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py
new file mode 100644
index 0000000000000000000000000000000000000000..6a70ed51afaec5d2ecacf8eacb5d21b0b2296442
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/DNSFlippingRatioCorr.py
@@ -0,0 +1,352 @@
+# pylint: disable=too-many-locals
+import mantid.simpleapi as api
+from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty
+from mantid.kernel import Direction, FloatBoundedValidator
+import numpy as np
+
+
+class DNSFlippingRatioCorr(PythonAlgorithm):
+    """
+    Peforms flipping ratio correction of the given dataset
+    using the NiCr data
+    This algorithm is written for the DNS @ MLZ,
+    but can be adjusted for other instruments if needed.
+    """
+    properties_to_compare = ['deterota', 'wavelength', 'slit_i_left_blade_position',
+                             'slit_i_right_blade_position', 'slit_i_lower_blade_position',
+                             'slit_i_upper_blade_position']
+
+    def __init__(self):
+        """
+        Init
+        """
+        PythonAlgorithm.__init__(self)
+        self.input_workspaces = {}
+        self.sf_outws_name = None
+        self.nsf_outws_name = None
+        self.dfr = 0.05
+
+    def category(self):
+        """
+        Returns category
+        """
+        return 'PythonAlgorithms\\MLZ\\DNS;CorrectionFunctions'
+
+    def name(self):
+        """
+        Returns name
+        """
+        return "DNSFlippingRatioCorr"
+
+    def summary(self):
+        return "Peforms flipping ratio correction on a given dataset using the NiCr data."
+
+    def PyInit(self):
+        self.declareProperty(MatrixWorkspaceProperty("SFDataWorkspace", "", direction=Direction.Input),
+                             doc="A workspace with spin-flip experimental data from sample.")
+        self.declareProperty(MatrixWorkspaceProperty("NSFDataWorkspace", "", direction=Direction.Input),
+                             doc="A workspace with non spin-flip experimental data from sample.")
+        self.declareProperty(MatrixWorkspaceProperty("SFNiCrWorkspace", "", direction=Direction.Input),
+                             doc="A workspace with spin-flip NiCr data.")
+        self.declareProperty(MatrixWorkspaceProperty("NSFNiCrWorkspace", "", direction=Direction.Input),
+                             doc="A workspace with non spin-flip NiCr data.")
+        self.declareProperty(MatrixWorkspaceProperty("SFBkgrWorkspace", "", direction=Direction.Input),
+                             doc="A workspace with spin-flip background for NiCr.")
+        self.declareProperty(MatrixWorkspaceProperty("NSFBkgrWorkspace", "", direction=Direction.Input),
+                             doc="A workspace with non spin-flip background for NiCr.")
+        self.declareProperty(MatrixWorkspaceProperty("SFOutputWorkspace", "", direction=Direction.Output),
+                             doc="A workspace to save the corrected spin-flip data.")
+        self.declareProperty(MatrixWorkspaceProperty("NSFOutputWorkspace", "", direction=Direction.Output),
+                             doc="A workspace to save the corrected non spin-flip data.")
+        self.declareProperty("DoubleSpinFlipScatteringProbability", 0.05, FloatBoundedValidator(lower=0, upper=1.0),
+                             doc="Probability of the double spin-flip scattering. Number between 0 and 1.")
+
+        return
+
+    def _dimensions_valid(self):
+        """
+        Checks validity of the workspace dimensions:
+        all given workspaces must have the same number of dimensions
+        and the same number of histograms
+        and the same number of bins
+        """
+        ndims = []
+        nhists = []
+        nbins = []
+        for wsname in self.input_workspaces.values():
+            wks = api.AnalysisDataService.retrieve(wsname)
+            ndims.append(wks.getNumDims())
+            nhists.append(wks.getNumberHistograms())
+            nbins.append(wks.blocksize())
+
+        ndi = ndims[0]
+        nhi = nhists[0]
+        nbi = nbins[0]
+        if ndims.count(ndi) == len(ndims) and nhists.count(nhi) == len(nhists) and nbins.count(nbi) == len(nbins):
+            return True
+        else:
+            message = "Input workspaces have different dimensions. Cannot correct flipping ratio."
+            self.log().error(message)
+            raise RuntimeError(message)
+
+    def _ws_exist(self):
+        """
+        Checks whether the workspaces and their normalization workspaces exist
+        """
+        # normws for data workspaces are not required
+        dataws_names = [self.input_workspaces['SF_Data'], self.input_workspaces['NSF_Data']]
+        for wsname in self.input_workspaces.values():
+            if not api.AnalysisDataService.doesExist(wsname):
+                message = "Workspace " + wsname + " does not exist! Cannot correct flipping ratio."
+                self.log().error(message)
+                raise RuntimeError(message)
+            if not api.AnalysisDataService.doesExist(wsname + '_NORM'):
+                if wsname not in dataws_names:
+                    message = "Workspace " + wsname + "_NORM does not exist! Cannot correct flipping ratio."
+                    self.log().error(message)
+                    raise RuntimeError(message)
+
+        return True
+
+    def _same_polarisation(self):
+        """
+        Checks whether all workspaces have the same polarisation.
+        Raises error if not.
+        """
+        pols = []
+        for wsname in self.input_workspaces.values():
+            wks = api.AnalysisDataService.retrieve(wsname)
+            run = wks.getRun()
+            if run.hasProperty('polarisation'):
+                pols.append(run.getProperty('polarisation').value)
+            else:
+                message = \
+                    " Workspace " + wks.getName() + " does not have property polarisation! Cannot correct flipping ratio."
+                self.log().error(message)
+                raise RuntimeError(message)
+        polarisation = pols[0]
+        if pols.count(polarisation) == len(pols):
+            self.log().information("The polarisation is " + polarisation)
+            return True
+        else:
+            message = "Cannot apply correction to workspaces with different polarisation!"
+            self.log().error(message)
+            raise RuntimeError(message)
+
+    def _cleanup(self, wslist):
+        """
+        deletes workspaces from list
+        """
+        for wsname in wslist:
+            api.DeleteWorkspace(wsname)
+        return
+
+    def _flipper_valid(self):
+        """
+        checks whether SF workspaces have flipper on
+        and NSF workspaces have flipper OFF
+        """
+        # sort workspaces for sf and nsf
+        nsf = []
+        for key in self.input_workspaces.keys():
+            if 'NSF' in key:
+                nsf.append(key)
+        for key in self.input_workspaces.keys():
+            wks = api.AnalysisDataService.retrieve(self.input_workspaces[key])
+            run = wks.getRun()
+            if not run.hasProperty('flipper'):
+                message = "Workspace " + wks.getName() + " does not have flipper sample log!"
+                self.log().error(message)
+                raise RuntimeError(message)
+            flipper = run.getProperty('flipper').value
+            if key in nsf:
+                needed = 'OFF'
+            else:
+                needed = 'ON'
+            if flipper != needed:
+                message = "Workspace " + wks.getName() + " must have flipper " + needed + ", but it is " + flipper
+                self.log().error(message)
+                raise RuntimeError(message)
+
+        return True
+
+    def _can_correct(self):
+        """
+        checks whether FR correction is possible with the given list of workspaces
+        """
+        # list of workspaces must not be empty
+        if not self.input_workspaces:
+            message = "No workspace names has been specified! Nothing for FR correction."
+            self.log().error(message)
+            raise RuntimeError(message)
+        # workspaces and normalization workspaces must exist
+        self._ws_exist()
+
+        # they must have the same dimensions
+        self._dimensions_valid()
+
+        # and the same polarisation
+        self._same_polarisation()
+
+        # check validity of flipper status
+        self._flipper_valid()
+
+        # algorithm must warn if some properties_to_compare are different
+        ws1 = api.AnalysisDataService.retrieve(self.input_workspaces.values()[0])
+        run1 = ws1.getRun()
+        for wsname in self.input_workspaces.values()[1:]:
+            wks = api.AnalysisDataService.retrieve(wsname)
+            run = wks.getRun()
+            self._check_properties(run1, run)
+        return True
+
+    def _fr_correction(self):
+        """
+        applies flipping ratio correction
+        creates the corrected workspaces
+        """
+        wslist = []
+        # 1. normalize NiCr and Background
+        sf_nicr_normws = api.AnalysisDataService.retrieve(self.input_workspaces['SF_NiCr'] + '_NORM')
+        sf_nicr = api.AnalysisDataService.retrieve(self.input_workspaces['SF_NiCr'])
+        _sf_nicr_norm_ = api.Divide(sf_nicr, sf_nicr_normws)
+        wslist.append(_sf_nicr_norm_.getName())
+
+        nsf_nicr_normws = api.AnalysisDataService.retrieve(self.input_workspaces['NSF_NiCr'] + '_NORM')
+        nsf_nicr = api.AnalysisDataService.retrieve(self.input_workspaces['NSF_NiCr'])
+        _nsf_nicr_norm_ = api.Divide(nsf_nicr, nsf_nicr_normws)
+        wslist.append(_nsf_nicr_norm_.getName())
+
+        sf_bkgr_normws = api.AnalysisDataService.retrieve(self.input_workspaces['SF_Background'] + '_NORM')
+        sf_bkgr = api.AnalysisDataService.retrieve(self.input_workspaces['SF_Background'])
+        _sf_bkgr_norm_ = api.Divide(sf_bkgr, sf_bkgr_normws)
+        wslist.append(_sf_bkgr_norm_.getName())
+
+        nsf_bkgr_normws = api.AnalysisDataService.retrieve(self.input_workspaces['NSF_Background'] + '_NORM')
+        nsf_bkgr = api.AnalysisDataService.retrieve(self.input_workspaces['NSF_Background'])
+        _nsf_bkgr_norm_ = api.Divide(nsf_bkgr, nsf_bkgr_normws)
+        wslist.append(_nsf_bkgr_norm_.getName())
+
+        # 2. subtract background from NiCr
+        _sf_nicr_bg_ = _sf_nicr_norm_ - _sf_bkgr_norm_
+        wslist.append(_sf_nicr_bg_.getName())
+        _nsf_nicr_bg_ = _nsf_nicr_norm_ - _nsf_bkgr_norm_
+        wslist.append(_nsf_nicr_bg_.getName())
+        # check negative values, throw exception
+        sf_arr = np.array(_sf_nicr_bg_.extractY()).flatten()
+        nsf_arr = np.array(_nsf_nicr_bg_.extractY()).flatten()
+        sf_neg_values = np.where(sf_arr < 0)[0]
+        nsf_neg_values = np.where(nsf_arr < 0)[0]
+        if len(sf_neg_values) or len(nsf_neg_values):
+            self._cleanup(wslist)
+            message = "Background is higher than NiCr signal!"
+            self.log().error(message)
+            raise RuntimeError(message)
+
+        # 3. calculate correction coefficients
+        _coef_ws_ = api.Divide(LHSWorkspace=_nsf_nicr_bg_, RHSWorkspace=_sf_nicr_bg_, WarnOnZeroDivide=True)
+        wslist.append(_coef_ws_.getName())
+        # 4. apply correction raw data (not normalized!)
+        sf_data_ws = api.AnalysisDataService.retrieve(self.input_workspaces['SF_Data'])
+        nsf_data_ws = api.AnalysisDataService.retrieve(self.input_workspaces['NSF_Data'])
+        # NSF_corr[i] = NSF[i] - SF[i]/c[i]
+        _tmp_ws_ = api.Divide(LHSWorkspace=sf_data_ws, RHSWorkspace=_coef_ws_, WarnOnZeroDivide=True,)
+        api.Minus(LHSWorkspace=nsf_data_ws, RHSWorkspace=_tmp_ws_, OutputWorkspace=self.nsf_outws_name)
+        nsf_outws = api.AnalysisDataService.retrieve(self.nsf_outws_name)
+        api.DeleteWorkspace(_tmp_ws_)
+        # SF_corr[i] = SF[i] - NSF[i]/c[i]
+        _tmp_ws_ = api.Divide(LHSWorkspace=nsf_data_ws, RHSWorkspace=_coef_ws_, WarnOnZeroDivide=True)
+        api.Minus(LHSWorkspace=sf_data_ws, RHSWorkspace=_tmp_ws_, OutputWorkspace=self.sf_outws_name)
+        sf_outws = api.AnalysisDataService.retrieve(self.sf_outws_name)
+        api.DeleteWorkspace(_tmp_ws_)
+
+        # 5. Apply correction for a double spin-flip scattering
+        if self.dfr > 1e-7:
+            _tmp_ws_ = sf_outws * self.dfr
+            wslist.append(_tmp_ws_.getName())
+            # NSF_corr[i] = NSF_prev_corr[i] - SF_prev_corr*dfr, SF_corr = SF_prev_corr
+            api.Minus(LHSWorkspace=nsf_outws, RHSWorkspace=_tmp_ws_, OutputWorkspace=self.nsf_outws_name)
+
+        # cleanup
+        self._cleanup(wslist)
+        return
+
+    def _check_properties(self, lhs_run, rhs_run):
+        """
+        checks whether properties match
+        """
+        lhs_title = ""
+        rhs_title = ""
+        if lhs_run.hasProperty('run_title'):
+            lhs_title = lhs_run.getProperty('run_title').value
+        if rhs_run.hasProperty('run_title'):
+            rhs_title = rhs_run.getProperty('run_title').value
+
+        for property_name in self.properties_to_compare:
+            if lhs_run.hasProperty(property_name) and rhs_run.hasProperty(property_name):
+                lhs_property = lhs_run.getProperty(property_name)
+                rhs_property = rhs_run.getProperty(property_name)
+                if lhs_property.type == rhs_property.type:
+                    if lhs_property.type == 'string':
+                        if lhs_property.value != rhs_property.value:
+                            message = "Property " + property_name + " does not match! " + \
+                                lhs_title + ": " + lhs_property.value + ", but " + \
+                                rhs_title + ": " + rhs_property.value
+                            self.log().warning(message)
+                    if lhs_property.type == 'number':
+                        if abs(lhs_property.value - rhs_property.value) > 5e-3:
+                            message = "Property " + property_name + " does not match! " + \
+                                lhs_title + ": " + str(lhs_property.value) + ", but " + \
+                                rhs_title + ": " + str(rhs_property.value)
+                            self.log().warning(message)
+                else:
+                    message = "Property " + property_name + " does not match! " + \
+                        lhs_title + ": " + str(lhs_property.value) + ", but " + \
+                        rhs_title + ": " + str(rhs_property.value)
+                    self.log().warning(message)
+            else:
+                message = "Property " + property_name + " is not present in " +\
+                    lhs_title + " or " + rhs_title + " - skipping comparison."
+                self.log().warning(message)
+        return True
+
+    def PyExec(self):
+        # Input
+        self.input_workspaces['SF_Data'] = self.getPropertyValue("SFDataWorkspace")
+        self.input_workspaces['NSF_Data'] = self.getPropertyValue("NSFDataWorkspace")
+        self.input_workspaces['SF_NiCr'] = self.getPropertyValue("SFNiCrWorkspace")
+        self.input_workspaces['NSF_NiCr'] = self.getPropertyValue("NSFNiCrWorkspace")
+        self.input_workspaces['SF_Background'] = self.getPropertyValue("SFBkgrWorkspace")
+        self.input_workspaces['NSF_Background'] = self.getPropertyValue("NSFBkgrWorkspace")
+        self.sf_outws_name = self.getPropertyValue("SFOutputWorkspace")
+        self.nsf_outws_name = self.getPropertyValue("NSFOutputWorkspace")
+        self.dfr = float(self.getPropertyValue("DoubleSpinFlipScatteringProbability"))
+
+        # check if possible to apply correction
+        self._can_correct()
+
+        # apply flipping ratio correction, retrieve the result
+        self._fr_correction()
+        nsf_outws = api.AnalysisDataService.retrieve(self.nsf_outws_name)
+        sf_outws = api.AnalysisDataService.retrieve(self.sf_outws_name)
+
+        # copy sample logs from data workspace to the output workspace
+        api.CopyLogs(InputWorkspace=self.input_workspaces['SF_Data'], OutputWorkspace=self.sf_outws_name,
+                     MergeStrategy='MergeReplaceExisting')
+        api.CopyLogs(InputWorkspace=self.input_workspaces['NSF_Data'], OutputWorkspace=self.nsf_outws_name,
+                     MergeStrategy='MergeReplaceExisting')
+        self.setProperty("SFOutputWorkspace", sf_outws)
+        self.setProperty("NSFOutputWorkspace", nsf_outws)
+
+        # clone the normalization workspaces
+        if api.AnalysisDataService.doesExist(self.input_workspaces['SF_Data'] + '_NORM'):
+            api.CloneWorkspace(InputWorkspace=self.input_workspaces['SF_Data'] + '_NORM',
+                               OutputWorkspace=self.sf_outws_name + '_NORM')
+        if api.AnalysisDataService.doesExist(self.input_workspaces['NSF_Data'] + '_NORM'):
+            api.CloneWorkspace(InputWorkspace=self.input_workspaces['NSF_Data'] + '_NORM',
+                               OutputWorkspace=self.nsf_outws_name + '_NORM')
+
+        return
+
+# Register algorithm with Mantid
+AlgorithmFactory.subscribe(DNSFlippingRatioCorr)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py
new file mode 100644
index 0000000000000000000000000000000000000000..00e02775464ed43e98cafb8d8e24bb922fb47c93
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/DNSMergeRuns.py
@@ -0,0 +1,298 @@
+# pylint: disable=too-many-locals
+import mantid.simpleapi as api
+from mantid.api import PythonAlgorithm, AlgorithmFactory, MatrixWorkspaceProperty
+from mantid.kernel import Direction, StringArrayProperty, StringListValidator, V3D
+import numpy as np
+
+
+class DNSMergeRuns(PythonAlgorithm):
+    """
+    Merges given runs into one matrix workspace.
+    This algorithm is written for the DNS @ MLZ,
+    but can be adjusted for other instruments if needed.
+    """
+    properties_to_compare = ['omega', 'slit_i_left_blade_position',
+                             'slit_i_right_blade_position', 'slit_i_lower_blade_position',
+                             'slit_i_upper_blade_position', 'polarisation', 'flipper']
+    sample_logs = properties_to_compare + ['wavelength', 'huber', 'T1', 'T2', 'Tsp', 'Ei']
+
+    def __init__(self):
+        """
+        Init
+        """
+        PythonAlgorithm.__init__(self)
+        self.workspace_names = []
+        self.wavelength = 0
+        self.xaxis = '2theta'
+        self.outws_name = None
+
+    def category(self):
+        """
+        Returns category
+        """
+        return 'PythonAlgorithms\\MLZ\\DNS'
+
+    def name(self):
+        """
+        Returns name
+        """
+        return "DNSMergeRuns"
+
+    def summary(self):
+        return "Merges runs performed at different detector bank positions into one matrix workspace."
+
+    def PyInit(self):
+        self.declareProperty(StringArrayProperty(name="WorkspaceNames",
+                                                 direction=Direction.Input),
+                             doc="List of Workspace names to merge.")
+        self.declareProperty(MatrixWorkspaceProperty("OutputWorkspace", "", direction=Direction.Output),
+                             doc="A workspace name to save the merged data.")
+        H_AXIS = ["2theta", "|Q|", "d-Spacing"]
+        self.declareProperty("HorizontalAxis", "2theta", StringListValidator(H_AXIS),
+                             doc="X axis in the merged workspace")
+        self.declareProperty("Normalize", False, "If checked, the merged data will be normalized, "
+                             "otherwise the separate normalization workspace will be created.")
+        return
+
+    def _dimensions_valid(self):
+        """
+        Checks validity of the workspace dimensions:
+        all given workspaces must have the same number of dimensions
+        and the same number of histograms
+        and the same number of bins
+        """
+        ndims = []
+        nhists = []
+        nbins = []
+        for wsname in self.workspace_names:
+            wks = api.AnalysisDataService.retrieve(wsname)
+            ndims.append(wks.getNumDims())
+            nhists.append(wks.getNumberHistograms())
+            nbins.append(wks.blocksize())
+
+        ndi = ndims[0]
+        nhi = nhists[0]
+        nbi = nbins[0]
+        if ndims.count(ndi) == len(ndims) and nhists.count(nhi) == len(nhists) and nbins.count(nbi) == len(nbins):
+            return True
+        else:
+            message = "Cannot merge workspaces with different dimensions."
+            self.log().error(message)
+            return False
+
+    def _ws_exist(self):
+        """
+        Checks whether the workspace and its normalization workspaces exist
+        """
+        for wsname in self.workspace_names:
+            if not api.AnalysisDataService.doesExist(wsname):
+                message = "Workspace " + wsname + " does not exist! Cannot merge."
+                self.log().error(message)
+                return False
+            if not api.AnalysisDataService.doesExist(wsname + '_NORM'):
+                message = "Workspace " + wsname + "_NORM does not exist! Cannot merge."
+                self.log().error(message)
+                return False
+
+        return True
+
+    def _can_merge(self):
+        """
+        checks whether it is possible to merge the given list of workspaces
+        """
+        # list of workspaces must not be empty
+        if not self.workspace_names:
+            message = "No workspace names has been specified! Nothing to merge."
+            self.log().error(message)
+            return False
+        # workspaces and normalization workspaces must exist
+        if not self._ws_exist():
+            return False
+        # they must have the same dimensions
+        if not self._dimensions_valid():
+            return False
+        # and the same wavelength
+        if not self._same_wavelength():
+            return False
+        # algorithm must warn if some properties_to_compare are different
+        ws1 = api.AnalysisDataService.retrieve(self.workspace_names[0])
+        run1 = ws1.getRun()
+        for wsname in self.workspace_names[1:]:
+            wks = api.AnalysisDataService.retrieve(wsname)
+            run = wks.getRun()
+            self._check_properties(run1, run)
+        return True
+
+    def _check_properties(self, lhs_run, rhs_run):
+        """
+        checks whether properties match
+        """
+        lhs_title = ""
+        rhs_title = ""
+        if lhs_run.hasProperty('run_title'):
+            lhs_title = lhs_run.getProperty('run_title').value
+        if rhs_run.hasProperty('run_title'):
+            rhs_title = rhs_run.getProperty('run_title').value
+
+        for property_name in self.properties_to_compare:
+            if lhs_run.hasProperty(property_name) and rhs_run.hasProperty(property_name):
+                lhs_property = lhs_run.getProperty(property_name)
+                rhs_property = rhs_run.getProperty(property_name)
+                if lhs_property.type == rhs_property.type:
+                    if lhs_property.type == 'string':
+                        if lhs_property.value != rhs_property.value:
+                            message = "Property " + property_name + " does not match! " + \
+                                lhs_title + ": " + lhs_property.value + ", but " + \
+                                rhs_title + ": " + rhs_property.value
+                            self.log().warning(message)
+                    if lhs_property.type == 'number':
+                        if abs(lhs_property.value - rhs_property.value) > 5e-3:
+                            message = "Property " + property_name + " does not match! " + \
+                                lhs_title + ": " + str(lhs_property.value) + ", but " + \
+                                rhs_title + ": " + str(rhs_property.value)
+                            self.log().warning(message)
+                else:
+                    message = "Property " + property_name + " does not match! " + \
+                        lhs_title + ": " + str(lhs_property.value) + ", but " + \
+                        rhs_title + ": " + str(rhs_property.value)
+                    self.log().warning(message)
+            else:
+                message = "Property " + property_name + " is not present in " +\
+                    lhs_title + " or " + rhs_title + " - skipping comparison."
+                self.log().warning(message)
+        return True
+
+    def _same_wavelength(self):
+        """
+        Checks whether all workspaces have the same wavelength.
+        Raises error if not,
+        sets self.wavelength otherwise
+        """
+        wls = []
+        for wsname in self.workspace_names:
+            wks = api.AnalysisDataService.retrieve(wsname)
+            run = wks.getRun()
+            if run.hasProperty('wavelength'):
+                wls.append(round(run.getProperty('wavelength').value, 3))
+            else:
+                message = " Workspace " + wks.getName() + " does not have property wavelength! Cannot merge."
+                self.log().error(message)
+                return False
+        wlength = wls[0]
+        if wls.count(wlength) == len(wls):
+            self.wavelength = wlength
+            self.log().information("The wavelength is " + str(self.wavelength) + " Angstrom.")
+            return True
+        else:
+            message = "Cannot merge workspaces with different wavelength!"
+            self.log().error(message)
+            return False
+
+    def _merge_workspaces(self):
+        """
+        merges given workspaces into one,
+        corresponding normalization workspaces are also merged
+        """
+        arr = []
+        arr_norm = []
+        beamDirection = V3D(0, 0, 1)
+        # merge workspaces, existance has been checked by _can_merge function
+        for ws_name in self.workspace_names:
+            wks = api.AnalysisDataService.retrieve(ws_name)
+            wsnorm = api.AnalysisDataService.retrieve(ws_name + '_NORM')
+            samplePos = wks.getInstrument().getSample().getPos()
+            n_hists = wks.getNumberHistograms()
+            two_theta = np.array([wks.getDetector(i).getTwoTheta(samplePos, beamDirection) for i in range(0, n_hists)])
+            # round to approximate hardware accuracy 0.05 degree ~ 1 mrad
+            two_theta = np.round(two_theta, 4)
+            dataY = np.rot90(wks.extractY())[0]
+            dataYnorm = np.rot90(wsnorm.extractY())[0]
+            dataE = np.rot90(wks.extractE())[0]
+            dataEnorm = np.rot90(wsnorm.extractE())[0]
+            for i in range(n_hists):
+                arr.append([two_theta[i], dataY[i], dataE[i]])
+                arr_norm.append([two_theta[i], dataYnorm[i], dataEnorm[i]])
+        data = np.array(arr)
+        norm = np.array(arr_norm)
+        # sum up intensities for dublicated angles
+        data_sorted = data[np.argsort(data[:, 0])]
+        norm_sorted = norm[np.argsort(norm[:, 0])]
+        # unique values
+        unX = np.unique(data_sorted[:, 0])
+        if len(data_sorted[:, 0]) - len(unX) > 0:
+            arr = []
+            arr_norm = []
+            self.log().information("There are dublicated 2Theta angles in the dataset. Sum up the intensities.")
+            # we must sum up the values
+            for i in range(len(unX)):
+                idx = np.where(np.fabs(data_sorted[:, 0] - unX[i]) < 1e-4)
+                new_y = sum(data_sorted[idx][:, 1])
+                new_y_norm = sum(norm_sorted[idx][:, 1])
+                err = data_sorted[idx][:, 2]
+                err_norm = norm_sorted[idx][:, 2]
+                new_e = np.sqrt(np.dot(err, err))
+                new_e_norm = np.sqrt(np.dot(err_norm, err_norm))
+                arr.append([unX[i], new_y, new_e])
+                arr_norm.append([unX[i], new_y_norm, new_e_norm])
+            data = np.array(arr)
+            norm = np.array(arr_norm)
+
+        # define x axis
+        if self.xaxis == "2theta":
+            data[:, 0] = np.round(np.degrees(data[:, 0]), 2)
+            unitx = "Degrees"
+        elif self.xaxis == "|Q|":
+            data[:, 0] = np.fabs(4.0*np.pi*np.sin(0.5*data[:, 0])/self.wavelength)
+            unitx = "MomentumTransfer"
+        elif self.xaxis == "d-Spacing":
+            data[:, 0] = np.fabs(0.5*self.wavelength/np.sin(0.5*data[:, 0]))
+            unitx = "dSpacing"
+        else:
+            message = "The value for X axis " + self.xaxis + " is invalid! Cannot merge."
+            self.log().error(message)
+            raise RuntimeError(message)
+
+        data_sorted = data[np.argsort(data[:, 0])]
+        api.CreateWorkspace(dataX=data_sorted[:, 0], dataY=data_sorted[:, 1], dataE=data_sorted[:, 2],
+                            UnitX=unitx, OutputWorkspace=self.outws_name)
+        norm[:, 0] = data[:, 0]
+        norm_sorted = norm[np.argsort(norm[:, 0])]
+        api.CreateWorkspace(dataX=norm_sorted[:, 0], dataY=norm_sorted[:, 1], dataE=norm_sorted[:, 2],
+                            UnitX=unitx, OutputWorkspace=self.outws_name + '_NORM')
+        return
+
+    def PyExec(self):
+        # Input
+        normalize = self.getProperty("Normalize").value
+        self.workspace_names = self.getProperty("WorkspaceNames").value
+        self.outws_name = self.getProperty("OutputWorkspace").valueAsStr
+        self.xaxis = self.getProperty("HorizontalAxis").value
+
+        self.log().information("Workspaces to merge: %i" % (len(self.workspace_names)))
+        # check whether given workspaces can be merged
+        if not self._can_merge():
+            message = "Impossible to merge given workspaces."
+            raise RuntimeError(message)
+
+        self._merge_workspaces()
+        outws = api.AnalysisDataService.retrieve(self.outws_name)
+        api.CopyLogs(self.workspace_names[0], outws)
+        api.RemoveLogs(outws, self.sample_logs)
+        yunit = 'Counts'
+        ylabel = 'Intensity'
+
+        if normalize:
+            normws = api.AnalysisDataService.retrieve(self.outws_name + '_NORM')
+            api.Divide(LHSWorkspace=outws, RHSWorkspace=normws, OutputWorkspace=self.outws_name)
+            api.DeleteWorkspace(normws)
+            yunit = ""
+            ylabel = "Normalized Intensity"
+
+        outws.setYUnit(yunit)
+        outws.setYUnitLabel(ylabel)
+
+        self.setProperty("OutputWorkspace", outws)
+        return
+
+# Register algorithm with Mantid
+AlgorithmFactory.subscribe(DNSMergeRuns)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
index db0259e8c7fe6a3fb3ac80cf19ba552d55ba9fba..3962dbd4e9da615f4828bad363b0b5238a734f76 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggCalibrate.py
@@ -81,18 +81,22 @@ class EnggCalibrate(PythonAlgorithm):
 
         import EnggUtils
 
+        # Get peaks in dSpacing from file
+        expectedPeaksD = EnggUtils.readInExpectedPeaks(self.getPropertyValue("ExpectedPeaksFromFile"),
+                                                       self.getProperty('ExpectedPeaks').value)
+
+        prog = Progress(self, start=0, end=1, nreports=2)
+
+        prog.report('Focusing the input workspace')
         focussed_ws = self._focusRun(self.getProperty('InputWorkspace').value,
                                      self.getProperty("VanadiumWorkspace").value,
                                      self.getProperty('Bank').value,
                                      self.getProperty(self.INDICES_PROP_NAME).value)
 
-        # Get peaks in dSpacing from file
-        expectedPeaksD = EnggUtils.readInExpectedPeaks(self.getPropertyValue("ExpectedPeaksFromFile"),
-                                                       self.getProperty('ExpectedPeaks').value)
-
         if len(expectedPeaksD) < 1:
             raise ValueError("Cannot run this algorithm without any input expected peaks")
 
+        prog.report('Fitting parameters for the focused run')
         difc, zero = self._fitParams(focussed_ws, expectedPeaksD)
 
         self._produceOutputs(difc, zero)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
index 4b733a523017923fbd60a97e6a2f1b6a8318d379..e7a5d7ec3968329856c2418a28cc8b4ec16ae48b 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFitPeaks.py
@@ -139,7 +139,10 @@ class EnggFitPeaks(PythonAlgorithm):
         foundPeaks = peaks[0]
         fittedPeaks = self._createFittedPeaksTable(peaksTableName)
 
+        prog = Progress(self, start=0, end=1, nreports=foundPeaks.rowCount())
+
         for i in range(foundPeaks.rowCount()):
+            prog.report('Fitting peak number ' + str(i+1))
 
             row = foundPeaks.row(i)
             # Peak parameters estimated by FindPeaks
@@ -171,18 +174,15 @@ class EnggFitPeaks(PythonAlgorithm):
             COEF_LEFT = 2
             COEF_RIGHT = 3
 
-            # Try to predict a fit window for the peak
-            xMin = centre - (width * COEF_LEFT)
-            xMax = centre + (width * COEF_RIGHT)
-
             # Fit using predicted window and a proper function with approximated initital values
             fitAlg = self.createChildAlgorithm('Fit')
             fitAlg.setProperty('Function', 'name=LinearBackground;' + str(peak))
             fitAlg.setProperty('InputWorkspace', inWS)
             fitAlg.setProperty('WorkspaceIndex', wsIndex)
-            fitAlg.setProperty('StartX', xMin)
-            fitAlg.setProperty('EndX', xMax)
             fitAlg.setProperty('CreateOutput', True)
+            # Try to predict a fit window for the peak (using magic numbers)
+            fitAlg.setProperty('StartX', centre - (width * COEF_LEFT))
+            fitAlg.setProperty('EndX', centre + (width * COEF_RIGHT))
             fitAlg.execute()
             paramTable = fitAlg.getProperty('OutputParameters').value
 
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFocus.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
index f883edbfcb16925084ec771ac9d393433773c894..6e2ad54bec16809c02d05540a0031c7f6d2088c7 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggFocus.py
@@ -73,6 +73,9 @@ class EnggFocus(PythonAlgorithm):
     	# Leave the data for the bank we are interested in only
         wks = EnggUtils.cropData(self, wks, indices)
 
+        prog = Progress(self, start=0, end=1, nreports=3)
+
+        prog.report('Preparing input workspace')
         # Leave data for the same bank in the vanadium workspace too
         vanWS = self.getProperty('VanadiumWorkspace').value
         vanIntegWS = self.getProperty('VanIntegrationWorkspace').value
@@ -87,9 +90,11 @@ class EnggFocus(PythonAlgorithm):
     	# Convert to dSpacing
         wks = EnggUtils.convertToDSpacing(self, wks)
 
+        prog.report('Summing spectra')
     	# Sum the values
         wks = EnggUtils.sumSpectra(self, wks)
 
+        prog.report('Preparing output workspace')
     	# Convert back to time of flight
         wks = EnggUtils.convertToToF(self, wks)
 
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
index 1125fff13be22ee5d468dd1769f928ae60873931..dfbe55a42447658be109d110c2bc4e3a6f86fbc0 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/EnggVanadiumCorrections.py
@@ -71,6 +71,12 @@ class EnggVanadiumCorrections(PythonAlgorithm):
         integWS = self.getProperty('IntegrationWorkspace').value
         curvesWS = self.getProperty('CurvesWorkspace').value
 
+        preports = 1
+        if ws:
+            preports += 1
+        prog = Progress(self, start=0, end=1, nreports=preports)
+
+        prog.report('Checking availability of vanadium correction features')
         # figure out if we are calculating or re-using pre-calculated corrections
         if vanWS:
             self.log().information("A workspace with reference Vanadium data was passed. Calculating "
@@ -83,6 +89,7 @@ class EnggVanadiumCorrections(PythonAlgorithm):
             raise ValueError('When a VanadiumWorkspace is not passed, both the IntegrationWorkspace and '
                              'the CurvesWorkspace are required inputs. One or both of them were not given')
 
+        prog.report('Applying corrections on the input workspace')
         if ws:
             self._applyVanadiumCorrections(ws, integWS, curvesWS)
             self.setProperty('Workspace', ws)
@@ -103,7 +110,10 @@ class EnggVanadiumCorrections(PythonAlgorithm):
                              "than the number of spectra (rows) in the integration workspace (%d)"%
                              (spectra, integSpectra))
 
+        prog = Progress(self, start=0, end=1, nreports=2)
+        prog.report('Applying sensitivity correction')
         self._applySensitivityCorrection(ws, integWS, curvesWS)
+        prog.report('Applying pixel-by-pixel correction')
         self._applyPixByPixCorrection(ws, curvesWS)
 
     def _applySensitivityCorrection(self, ws, integWS, curvesWS):
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/GetNegMuMuonicXRD.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/GetNegMuMuonicXRD.py
new file mode 100644
index 0000000000000000000000000000000000000000..03b256417777a1c7609f0f20567d3787bd4b331f
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/GetNegMuMuonicXRD.py
@@ -0,0 +1,62 @@
+from mantid.api import * # PythonAlgorithm, registerAlgorithm, WorkspaceProperty
+from mantid.kernel import *
+from mantid.simpleapi import *
+
+#pylint: disable=no-init
+class GetNegMuMuonicXRD(PythonAlgorithm):
+    #Dictionary of <element>:<peaks> easily extendible by user.
+    Muonic_XR={'Au' :[8135.2,8090.6,8105.4,8069.4,5764.89,5594.97,3360.2,
+                       3206.8,2474.22,2341.21,2304.44,1436.05,1391.58,1104.9,
+                       899.14,869.98,405.654,400.143],
+               'Ag': [3184.7,3147.7,901.2,869.2,308.428,304.759],
+               'Cu' :[1512.78,1506.61,334.8,330.26],
+               'Zn' :[1600.15,1592.97,360.75,354.29],
+               'Pb' :[8523.3,8442.11,5966.0,5780.1,2641.8,2499.7,
+                        2459.7,1511.63,1214.12,1028.83,972.3,938.4,
+                        437.687,431.285],
+               'As' : [1866.9,1855.8,436.6,427.5],
+               'Sn' : [3457.3,3412.8,1022.6,982.5,349.953,345.226]}
+
+    def PyInit(self):
+        self.declareProperty(StringArrayProperty("Elements", values=[],
+                             direction=Direction.Input
+                             ))
+        self.declareProperty(name="YAxisPosition",
+                                    defaultValue=-0.001,
+                                    doc="Position for Markers on the y-axis")
+
+    def get_Muonic_XR(self, element):
+        #retrieve peak values from dictionary Muonic_XR
+        peak_values = self.Muonic_XR[element]
+        return peak_values
+
+    def Create_MuonicXR_WS(self, element, YPos):
+        #retrieve the values from Muonic_XR
+        xr_peak_values = self.get_Muonic_XR(element)
+        #Calibrate y-axis for workspace
+        YPos_WS = [YPos]*len(xr_peak_values)
+        xvalues = xr_peak_values
+        WS_Muon_XR = CreateWorkspace(xvalues, YPos_WS[:])
+        RenameWorkspaces(WS_Muon_XR, WorkspaceNames="MuonXRWorkspace_"+element)
+        return WS_Muon_XR
+
+
+    def category(self):
+        return "Muon"
+
+    def PyExec(self):
+        elements = self.getProperty("Elements").value
+        yposition = self.getProperty("YAxisPosition").value
+        workspace_list = [None]*len(elements)
+
+        for idx,element in enumerate(elements):
+            curr_workspace = self.Create_MuonicXR_WS(element, yposition)
+            workspace_list[idx] = curr_workspace
+        if len(elements) == 1:
+            MuonXRWorkspace = workspace_list[0]
+            self.log().information(str("Created: "+MuonXRWorkspace.name()))
+        else:
+            MuonicXR_group = GroupWorkspaces(workspace_list)
+            self.log().information(str("Created Group: "+MuonicXR_group.name()))
+
+AlgorithmFactory.subscribe(GetNegMuMuonicXRD)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
index 1c870a996056f4cf8e3ee0a1b64284adc59c9727..36d4104f4772d739a1dbdd6792fcb40389b0f280 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/LoadNMoldyn4Ascii.py
@@ -5,9 +5,11 @@ from mantid.kernel import *
 from mantid.api import *
 
 import numpy as np
+import scipy.constants as sc
 import ast
 import fnmatch
 import re
+import os
 
 #------------------------------------------------------------------------------
 
@@ -16,8 +18,8 @@ TYPE_REGEX = re.compile(r'#\s+type:\s+([A-z]+)')
 AXIS_REGEX = re.compile(r'#\s+axis:\s+([A-z]+)\|([A-z]+)')
 UNIT_REGEX = re.compile(r'#\s+units:\s+(.*)')
 
-SLICE_1D_HEADER_REGEX = re.compile(r'#slice:\[([0-9]+)L\]')
-SLICE_2D_HEADER_REGEX = re.compile(r'#slice:\[([0-9]+)L,\s+([0-9]+)L\]')
+SLICE_1D_HEADER_REGEX = re.compile(r'#slice:\[([0-9]+)[A-z]*\]')
+SLICE_2D_HEADER_REGEX = re.compile(r'#slice:\[([0-9]+)[A-z]*,\s+([0-9]+)[A-z]*\]')
 
 #------------------------------------------------------------------------------
 
@@ -81,6 +83,10 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
                 v_axis = self._load_axis(function[2][0])
                 x_axis = self._load_axis(function[2][1])
 
+                # Perform axis unit conversions
+                v_axis = self._axis_conversion(*v_axis)
+                x_axis = self._axis_conversion(*x_axis)
+
                 # Create the workspace for function
                 create_workspace = AlgorithmManager.Instance().create('CreateWorkspace')
                 create_workspace.initialize()
@@ -92,7 +98,7 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
                 create_workspace.setProperty('UnitX', x_axis[1])
                 create_workspace.setProperty('YUnitLabel', function[1])
                 create_workspace.setProperty('VerticalAxisValues', v_axis[0])
-                create_workspace.setProperty('VerticalAxisUnit', 'Empty')
+                create_workspace.setProperty('VerticalAxisUnit', v_axis[1])
                 create_workspace.setProperty('WorkspaceTitle', func_name)
                 create_workspace.execute()
 
@@ -172,7 +178,7 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
         Loads an axis by name from the data directory.
 
         @param axis_name Name of axis to load
-        @return Tuple of (Numpy array of data, unit)
+        @return Tuple of (Numpy array of data, unit, name)
         @exception ValueError If axis is not found
         """
         if axis_name in self._axis_cache:
@@ -211,7 +217,7 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
                         # Now parse the data
                         data = self._load_1d_slice(f_handle, length)
 
-        return (data, unit)
+        return (data, unit, axis_name)
 
 #------------------------------------------------------------------------------
 
@@ -260,6 +266,47 @@ class LoadNMoldyn4Ascii(PythonAlgorithm):
 
         return data
 
+#------------------------------------------------------------------------------
+
+    def _axis_conversion(self, data, unit, name):
+        """
+        Converts an axis to a Mantid axis type (possibly performing a unit
+        conversion).
+
+        @param data The axis data as Numpy array
+        @param unit The axis unit as read from the file
+        @param name The axis name as read from the file
+        @return Tuple containing updated axis details
+        """
+        logger.debug('Axis for conversion: name={0}, unit={1}'.format(name, unit))
+
+        # Q (nm**-1) to Q (Angstrom**-1)
+        if name.lower() == 'q' and unit.lower() == 'inv_nm':
+            logger.information('Axis {0} will be converted to Q in Angstrom**-1'.format(name))
+            unit = 'MomentumTransfer'
+            data /= sc.nano # nm to m
+            data *= sc.angstrom # m to Angstrom
+
+        # Frequency (THz) to Energy (meV)
+        elif name.lower() == 'frequency' and unit.lower() == 'thz':
+            logger.information('Axis {0} will be converted to energy in meV'.format(name))
+            unit = 'Energy'
+            data *= sc.tera # THz to Hz
+            data *= sc.value('Planck constant in eV s') # Hz to eV
+            data /= sc.milli # eV to meV
+
+        # Time (ps) to TOF (s)
+        elif name.lower() == 'time' and unit.lower() == 'ps':
+            logger.information('Axis {0} will be converted to time in microsecond'.format(name))
+            unit = 'TOF'
+            data *= sc.micro # ps to us
+
+        # No conversion
+        else:
+            unit = 'Empty'
+
+        return (data, unit, name)
+
 #------------------------------------------------------------------------------
 
 AlgorithmFactory.subscribe(LoadNMoldyn4Ascii)
diff --git a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MolDyn.py b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MolDyn.py
index 6706a380b8ff3e93a011e0a2ba84ad4ac9fa95e6..2397645a2d6e0105a391b7eb64964c21a8a756d2 100644
--- a/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MolDyn.py
+++ b/Code/Mantid/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/MolDyn.py
@@ -6,17 +6,8 @@ from mantid.api import *
 import os
 
 
-#pylint: disable=too-many-instance-attributes
 class MolDyn(PythonAlgorithm):
 
-    _plot = None
-    _save = None
-    _sam_path = None
-    _symmetrise = None
-    _functions = None
-    _emax = None
-    _res_ws = None
-    _out_ws = None
     _mtd_plot = None
 
 
@@ -29,18 +20,17 @@ class MolDyn(PythonAlgorithm):
 
 
     def PyInit(self):
-        self.declareProperty(FileProperty('Filename', '',
-                                          action=FileAction.Load,
-                                          extensions=['.cdl', '.dat']),
-                                          doc='File path for data')
+        self.declareProperty('Data', '',
+                             validator=StringMandatoryValidator(),
+                             doc='')
 
         self.declareProperty(StringArrayProperty('Functions'),
-                             doc='The Function to use')
+                             doc='A list of function to load')
 
         self.declareProperty(WorkspaceProperty('Resolution', '', Direction.Input, PropertyMode.Optional),
                              doc='Resolution workspace')
 
-        self.declareProperty(name='MaxEnergy', defaultValue='',
+        self.declareProperty(name='MaxEnergy', defaultValue=Property.EMPTY_DBL,
                              doc='Crop the result spectra at a given energy (leave blank for no crop)')
 
         self.declareProperty(name='SymmetriseEnergy', defaultValue=False,
@@ -60,14 +50,19 @@ class MolDyn(PythonAlgorithm):
     def validateInputs(self):
         issues = dict()
 
+        try:
+            self._get_version_and_data_path()
+        except ValueError, vex:
+            issues['Data'] = str(vex)
+
         symm = self.getProperty('SymmetriseEnergy').value
         res_ws = self.getPropertyValue('Resolution')
-        e_max = self.getPropertyValue('MaxEnergy')
+        max_energy = self.getPropertyValue('MaxEnergy')
 
-        if res_ws is not '' and e_max is '':
+        if res_ws != '' and max_energy == Property.EMPTY_DBL:
             issues['MaxEnergy'] = 'MaxEnergy must be set when convolving with an instrument resolution'
 
-        if res_ws is not '' and not symm:
+        if res_ws != '' and not symm:
             issues['SymmetriseEnergy'] = 'Must symmetrise energy when convolving with instrument resolution'
 
         return issues
@@ -78,49 +73,61 @@ class MolDyn(PythonAlgorithm):
         from IndirectImport import import_mantidplot
         self._mtd_plot = import_mantidplot()
 
-        # Do setup
-        self._setup()
+        output_ws_name = self.getPropertyValue('OutputWorkspace')
+        version, data_name, _ = self._get_version_and_data_path()
+
+        logger.information('Detected data from nMoldyn version {0}'.format(version))
 
         # Run nMOLDYN import
-        LoadNMoldyn3Ascii(Filename=self.getPropertyValue('Filename'),
-                          OutputWorkspace=self._out_ws,
-                          Functions=self.getPropertyValue('Functions'))
+        if version == 3:
+            LoadNMoldyn3Ascii(Filename=data_name,
+                              OutputWorkspace=output_ws_name,
+                              Functions=self.getPropertyValue('Functions'))
+        elif version == 4:
+            LoadNMoldyn4Ascii(Directory=data_name,
+                              OutputWorkspace=output_ws_name,
+                              Functions=self.getPropertyValue('Functions'))
+        else:
+            raise RuntimeError('No loader for input data')
+
+        symmetrise = self.getProperty('SymmetriseEnergy').value
+        max_energy_param = self.getProperty('MaxEnergy').value
 
         # Do processing specific to workspaces in energy
-        if isinstance(mtd[self._out_ws], WorkspaceGroup):
-            for ws_name in mtd[self._out_ws].getNames():
+        if isinstance(mtd[output_ws_name], WorkspaceGroup):
+            for ws_name in mtd[output_ws_name].getNames():
                 if mtd[ws_name].getAxis(0).getUnit().unitID() == 'Energy':
                     # Get an XMax value, default to max energy if not cropping
-                    e_max = mtd[ws_name].dataX(0).max()
-                    logger.debug('Max energy in workspace %s: %f' % (ws_name, e_max))
+                    max_energy = mtd[ws_name].dataX(0).max()
+                    logger.debug('Max energy in workspace %s: %f' % (ws_name, max_energy))
 
-                    if self._emax is not None:
-                        if self._emax > e_max:
+                    if max_energy_param != Property.EMPTY_DBL:
+                        if max_energy_param > max_energy:
                             raise ValueError('MaxEnergy crop is out of energy range for function %s' % ws_name)
-                        e_max = self._emax
+                        max_energy = max_energy_param
 
                     # If we are going to Symmetrise then there is no need to crop
                     # as the Symmetrise algorithm will do this
-                    if self._symmetrise:
+                    if symmetrise:
                         # Symmetrise the sample workspace in x=0
                         Symmetrise(InputWorkspace=ws_name,
                                    XMin=0,
-                                   XMax=e_max,
+                                   XMax=max_energy,
                                    OutputWorkspace=ws_name)
 
-                    elif self._emax is not None:
+                    elif max_energy_param != Property.EMPTY_DBL:
                         CropWorkspace(InputWorkspace=ws_name,
                                       OutputWorkspace=ws_name,
-                                      XMax=self._emax)
+                                      XMax=max_energy)
 
         # Do convolution if given a resolution workspace
-        if self._res_ws is not '':
+        if self.getPropertyValue('Resolution') is not '':
             # Create a workspace with enough spectra for convolution
-            num_sample_hist = mtd[self._out_ws].getItem(0).getNumberHistograms()
+            num_sample_hist = mtd[output_ws_name].getItem(0).getNumberHistograms()
             resolution_ws = self._create_res_ws(num_sample_hist)
 
             # Convolve all workspaces in output group
-            for ws_name in mtd[self._out_ws].getNames():
+            for ws_name in mtd[output_ws_name].getNames():
                 if ws_name.lower().find('sqw') != -1:
                     self._convolve_with_res(resolution_ws, ws_name)
                 else:
@@ -130,45 +137,53 @@ class MolDyn(PythonAlgorithm):
             DeleteWorkspace(resolution_ws)
 
         # Save result workspace group
-        if self._save:
+        if self.getProperty('Save').value:
             workdir = config['defaultsave.directory']
-            out_filename = os.path.join(workdir, self._out_ws + '.nxs')
+            out_filename = os.path.join(workdir, output_ws_name + '.nxs')
             logger.information('Creating file: %s' % out_filename)
-            SaveNexus(InputWorkspace=self._out_ws, Filename=out_filename)
+            SaveNexus(InputWorkspace=output_ws_name, Filename=out_filename)
 
         # Set the output workspace
-        self.setProperty('OutputWorkspace', self._out_ws)
+        self.setProperty('OutputWorkspace', output_ws_name)
 
+        plot = self.getProperty('Plot').value
         # Plot spectra plots
-        if self._plot == 'Spectra' or self._plot == 'Both':
-            if isinstance(mtd[self._out_ws], WorkspaceGroup):
-                for ws_name in mtd[self._out_ws].getNames():
+        if plot == 'Spectra' or plot == 'Both':
+            if isinstance(mtd[output_ws_name], WorkspaceGroup):
+                for ws_name in mtd[output_ws_name].getNames():
                     self._plot_spectra(ws_name)
             else:
-                self._plot_spectra(self._out_ws)
+                self._plot_spectra(output_ws_name)
 
         # Plot contour plot
-        if self._plot == 'Contour' or self._plot == 'Both':
-            self._mtd_plot.plot2D(self._out_ws)
+        if plot == 'Contour' or plot == 'Both':
+            self._mtd_plot.plot2D(output_ws_name)
 
 
-    def _setup(self):
-        """
-        Gets algorithm properties.
+    def _get_version_and_data_path(self):
         """
+        Inspects the Data parameter to determine th eversion of nMoldyn it is
+        loading from.
 
-        self._plot = self.getProperty('Plot').value
-        self._save = self.getProperty('Save').value
-
-        self._symmetrise = self.getProperty('SymmetriseEnergy').value
+        @return Tuple of (version, data file/directory, file extension)
+        """
+        data = self.getPropertyValue('Data')
+        extension = None
 
-        emax_str = self.getPropertyValue('MaxEnergy')
-        self._emax = None
-        if emax_str != '':
-            self._emax = float(emax_str)
+        if os.path.isdir(data):
+            version = 4
+        else:
+            file_path = FileFinder.getFullPath(data)
+            if os.path.isfile(file_path):
+                version = 3
+                extension = os.path.splitext(file_path)[1][1:]
+                if extension not in ['dat', 'cdl']:
+                    raise ValueError('Incorrect file type, expected file with extension .dat or .cdl')
+                data = file_path
+            else:
+                raise RuntimeError('Unknown input data')
 
-        self._res_ws = self.getPropertyValue('Resolution')
-        self._out_ws = self.getPropertyValue('OutputWorkspace')
+        return (version, data, extension)
 
 
     def _create_res_ws(self, num_sample_hist):
@@ -178,8 +193,9 @@ class MolDyn(PythonAlgorithm):
         @param num_sample_hist Number of histgrams required in workspace
         @returns The generated resolution workspace
         """
+        res_ws_name = self.getPropertyValue('Resolution')
 
-        num_res_hist = mtd[self._res_ws].getNumberHistograms()
+        num_res_hist = mtd[res_ws_name].getNumberHistograms()
 
         logger.notice('Creating resolution workspace.')
         logger.information('Sample has %d spectra\nResolution has %d spectra'
@@ -192,7 +208,7 @@ class MolDyn(PythonAlgorithm):
 
             res_ws_list = []
             for _ in range(0, num_sample_hist):
-                res_ws_list.append(self._res_ws)
+                res_ws_list.append(res_ws_name)
 
             res_ws_str_list = ','.join(res_ws_list)
             resolution_ws = ConjoinSpectra(res_ws_str_list, 0)
@@ -202,7 +218,7 @@ class MolDyn(PythonAlgorithm):
         elif num_sample_hist < num_res_hist:
             logger.information('Cropping resolution workspace to sample')
 
-            resolution_ws = CropWorkspace(InputWorkspace=self._res_ws,
+            resolution_ws = CropWorkspace(InputWorkspace=res_ws_name,
                                           StartWorkspaceIndex=0,
                                           EndWorkspaceIndex=num_sample_hist)
 
@@ -210,7 +226,7 @@ class MolDyn(PythonAlgorithm):
         else:
             logger.information('Using resolution workspace as is')
 
-            resolution_ws = CloneWorkspace(self._res_ws)
+            resolution_ws = CloneWorkspace(res_ws_name)
 
         return resolution_ws
 
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt
index 1baa8997544c0924f202fa3b185e4521aea32032..e28b8e784ac376f6e9c2a83516da5209df2dfb85 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/CMakeLists.txt
@@ -16,6 +16,8 @@ set ( TEST_PY_FILES
   CylinderPaalmanPingsCorrectionTest.py
   CylinderPaalmanPingsCorrection2Test.py
   DakotaChiSquaredTest.py
+  DNSMergeRunsTest.py
+  DNSFlippingRatioCorrTest.py
   DNSDetEffCorrVanaTest.py
   DSFinterpTest.py
   EnggCalibrateFullTest.py
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/DNSFlippingRatioCorrTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/DNSFlippingRatioCorrTest.py
new file mode 100644
index 0000000000000000000000000000000000000000..9f53357e02ff5d4610f8a7b90d71fcce5ab56f46
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/DNSFlippingRatioCorrTest.py
@@ -0,0 +1,281 @@
+import unittest
+from testhelpers import run_algorithm
+from mantid.api import AnalysisDataService
+import numpy as np
+import mantid.simpleapi as api
+from mantid.simpleapi import DNSFlippingRatioCorr
+
+
+class DNSFlippingRatioCorrTest(unittest.TestCase):
+    workspaces = []
+    __sf_bkgrws = None
+    __nsf_bkgrws = None
+    __sf_nicrws = None
+    __nsf_nicrws = None
+
+    def _create_fake_workspace(self, wsname, dataY, flipper):
+        """
+        creates DNS workspace with fake data
+        """
+        ndet = 24
+        dataX = np.zeros(2*ndet)
+        dataX.fill(4.2 + 0.00001)
+        dataX[::2] -= 0.000002
+        dataE = np.sqrt(dataY)
+        # create workspace
+        api.CreateWorkspace(OutputWorkspace=wsname, DataX=dataX, DataY=dataY,
+                            DataE=dataE, NSpec=ndet, UnitX="Wavelength")
+        outws = api.mtd[wsname]
+        api.LoadInstrument(outws, InstrumentName='DNS')
+        p_names = 'deterota,wavelength,slit_i_left_blade_position,slit_i_right_blade_position,\
+            slit_i_lower_blade_position,slit_i_upper_blade_position,polarisation,flipper'
+        p_values = '-7.53,4.2,10,10,5,20,x,' + flipper
+        api.AddSampleLogMultiple(Workspace=outws, LogNames=p_names, LogValues=p_values, ParseType=True)
+        # create the normalization workspace
+        dataY.fill(1.0)
+        dataE.fill(1.0)
+        api.CreateWorkspace(OutputWorkspace=wsname + '_NORM', DataX=dataX, DataY=dataY,
+                            DataE=dataE, NSpec=ndet, UnitX="Wavelength")
+        normws = api.mtd[wsname + '_NORM']
+        api.LoadInstrument(normws, InstrumentName='DNS')
+        api.AddSampleLogMultiple(Workspace=normws, LogNames=p_names, LogValues=p_values, ParseType=True)
+
+        return outws
+
+    def setUp(self):
+        dataY = np.array([2997., 2470., 2110., 1818., 840., 1095., 944., 720., 698., 699., 745., 690.,
+                          977., 913., 906., 1007., 1067., 1119., 1467., 1542., 2316., 1536., 1593., 1646.])
+        self.__sf_bkgrws = self._create_fake_workspace('__sf_bkgrws', dataY/620.0, flipper='ON')
+        self.workspaces.append('__sf_bkgrws')
+        dataY = np.array([14198., 7839., 4386., 3290., 1334., 1708., 1354., 1026., 958., 953., 888., 847.,
+                          1042., 1049., 1012., 1116., 1294., 1290., 1834., 1841., 2740., 1750., 1965., 1860.])
+        self.__nsf_bkgrws = self._create_fake_workspace('__nsf_bkgrws', dataY/619.0, flipper='OFF')
+        self.workspaces.append('__nsf_bkgrws')
+        dataY = np.array([5737., 5761., 5857., 5571., 4722., 5102., 4841., 4768., 5309., 5883., 5181., 4455.,
+                          4341., 4984., 3365., 4885., 4439., 4103., 4794., 14760., 10516., 4445., 5460., 3942.])
+        self.__nsf_nicrws = self._create_fake_workspace('__nsf_nicrws', dataY/58.0, flipper='OFF')
+        self.workspaces.append('__nsf_nicrws')
+        dataY = np.array([2343., 2270., 2125., 2254., 1534., 1863., 1844., 1759., 1836., 2030., 1848., 1650.,
+                          1555., 1677., 1302., 1750., 1822., 1663., 2005., 4025., 3187., 1935., 2331., 2125.])
+        self.__sf_nicrws = self._create_fake_workspace('__sf_nicrws', dataY/295.0, flipper='ON')
+        self.workspaces.append('__sf_nicrws')
+
+    def tearDown(self):
+        for wsname in self.workspaces:
+            if api.AnalysisDataService.doesExist(wsname + '_NORM'):
+                api.DeleteWorkspace(wsname + '_NORM')
+            if api.AnalysisDataService.doesExist(wsname):
+                api.DeleteWorkspace(wsname)
+        self.workspaces = []
+
+    def test_DNSNormWorkspaceExists(self):
+        outputWorkspaceName = "DNSFlippingRatioCorrTest_Test1"
+        api.DeleteWorkspace(self.__sf_bkgrws.getName() + '_NORM')
+        self.assertRaises(RuntimeError, DNSFlippingRatioCorr, SFDataWorkspace=self.__sf_nicrws.getName(),
+                          NSFDataWorkspace=self.__nsf_nicrws.getName(), SFNiCrWorkspace=self.__sf_nicrws.getName(),
+                          NSFNiCrWorkspace=self.__nsf_nicrws.getName(), SFBkgrWorkspace=self.__sf_bkgrws.getName(),
+                          NSFBkgrWorkspace=self.__nsf_bkgrws.getName(), SFOutputWorkspace=outputWorkspaceName+'SF',
+                          NSFOutputWorkspace=outputWorkspaceName+'NSF')
+        return
+
+    def test_DNSFlipperValid(self):
+        outputWorkspaceName = "DNSFlippingRatioCorrTest_Test2"
+        self.assertRaises(RuntimeError, DNSFlippingRatioCorr, SFDataWorkspace=self.__nsf_nicrws.getName(),
+                          NSFDataWorkspace=self.__nsf_nicrws.getName(), SFNiCrWorkspace=self.__sf_nicrws.getName(),
+                          NSFNiCrWorkspace=self.__nsf_nicrws.getName(), SFBkgrWorkspace=self.__sf_bkgrws.getName(),
+                          NSFBkgrWorkspace=self.__nsf_bkgrws.getName(), SFOutputWorkspace=outputWorkspaceName+'SF',
+                          NSFOutputWorkspace=outputWorkspaceName+'NSF')
+        return
+
+    def test_DNSPolarisationValid(self):
+        outputWorkspaceName = "DNSFlippingRatioCorrTest_Test3"
+        api.AddSampleLog(Workspace=self.__nsf_nicrws, LogName='polarisation', LogText='y', LogType='String')
+        self.assertRaises(RuntimeError, DNSFlippingRatioCorr, SFDataWorkspace=self.__sf_nicrws.getName(),
+                          NSFDataWorkspace=self.__nsf_nicrws.getName(), SFNiCrWorkspace=self.__sf_nicrws.getName(),
+                          NSFNiCrWorkspace=self.__nsf_nicrws.getName(), SFBkgrWorkspace=self.__sf_bkgrws.getName(),
+                          NSFBkgrWorkspace=self.__nsf_bkgrws.getName(), SFOutputWorkspace=outputWorkspaceName+'SF',
+                          NSFOutputWorkspace=outputWorkspaceName+'NSF')
+        return
+
+    def test_DNSFRSelfCorrection(self):
+        outputWorkspaceName = "DNSFlippingRatioCorrTest_Test4"
+        # consider normalization=1.0 as set in self._create_fake_workspace
+        dataws_sf = self.__sf_nicrws - self.__sf_bkgrws
+        dataws_nsf = self.__nsf_nicrws - self.__nsf_bkgrws
+        alg_test = run_algorithm("DNSFlippingRatioCorr", SFDataWorkspace=dataws_sf,
+                                 NSFDataWorkspace=dataws_nsf, SFNiCrWorkspace=self.__sf_nicrws.getName(),
+                                 NSFNiCrWorkspace=self.__nsf_nicrws.getName(), SFBkgrWorkspace=self.__sf_bkgrws.getName(),
+                                 NSFBkgrWorkspace=self.__nsf_bkgrws.getName(), SFOutputWorkspace=outputWorkspaceName+'SF',
+                                 NSFOutputWorkspace=outputWorkspaceName+'NSF', DoubleSpinFlipScatteringProbability=0.0)
+
+        self.assertTrue(alg_test.isExecuted())
+        # check whether the data are correct
+        ws_sf = AnalysisDataService.retrieve(outputWorkspaceName + 'SF')
+        ws_nsf = AnalysisDataService.retrieve(outputWorkspaceName + 'NSF')
+        # dimensions
+        self.assertEqual(24, ws_sf.getNumberHistograms())
+        self.assertEqual(24, ws_nsf.getNumberHistograms())
+        self.assertEqual(2,  ws_sf.getNumDims())
+        self.assertEqual(2,  ws_nsf.getNumDims())
+        # data array: spin-flip must be zero
+        for i in range(24):
+            self.assertAlmostEqual(0.0, ws_sf.readY(i))
+        # data array: non spin-flip must be nsf - sf^2/nsf
+        nsf = np.array(dataws_nsf.extractY())
+        sf = np.array(dataws_sf.extractY())
+        refdata = nsf - sf*sf/nsf
+        for i in range(24):
+            self.assertAlmostEqual(refdata[i], ws_nsf.readY(i))
+
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'SF')
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'NSF')
+        run_algorithm("DeleteWorkspace", Workspace=dataws_sf)
+        run_algorithm("DeleteWorkspace", Workspace=dataws_nsf)
+        return
+
+    def test_DNSTwoTheta(self):
+        outputWorkspaceName = "DNSFlippingRatioCorrTest_Test5"
+        # rotate detector bank to different angles
+        dataws_sf = self.__sf_nicrws - self.__sf_bkgrws
+        dataws_nsf = self.__nsf_nicrws - self.__nsf_bkgrws
+        api.RotateInstrumentComponent(dataws_sf, "bank0", X=0, Y=1, Z=0, Angle=-7.53)
+        api.RotateInstrumentComponent(dataws_nsf, "bank0", X=0, Y=1, Z=0, Angle=-7.53)
+        api.RotateInstrumentComponent(self.__sf_nicrws, "bank0", X=0, Y=1, Z=0, Angle=-8.02)
+        api.RotateInstrumentComponent(self.__nsf_nicrws, "bank0", X=0, Y=1, Z=0, Angle=-8.02)
+        api.RotateInstrumentComponent(self.__sf_bkgrws, "bank0", X=0, Y=1, Z=0, Angle=-8.54)
+        api.RotateInstrumentComponent(self.__nsf_bkgrws, "bank0", X=0, Y=1, Z=0, Angle=-8.54)
+        # apply correction
+        alg_test = run_algorithm("DNSFlippingRatioCorr", SFDataWorkspace=dataws_sf,
+                                 NSFDataWorkspace=dataws_nsf, SFNiCrWorkspace=self.__sf_nicrws.getName(),
+                                 NSFNiCrWorkspace=self.__nsf_nicrws.getName(), SFBkgrWorkspace=self.__sf_bkgrws.getName(),
+                                 NSFBkgrWorkspace=self.__nsf_bkgrws.getName(), SFOutputWorkspace=outputWorkspaceName+'SF',
+                                 NSFOutputWorkspace=outputWorkspaceName+'NSF', DoubleSpinFlipScatteringProbability=0.0)
+
+        self.assertTrue(alg_test.isExecuted())
+        ws_sf = AnalysisDataService.retrieve(outputWorkspaceName + 'SF')
+        ws_nsf = AnalysisDataService.retrieve(outputWorkspaceName + 'NSF')
+        # dimensions
+        self.assertEqual(24, ws_sf.getNumberHistograms())
+        self.assertEqual(24, ws_nsf.getNumberHistograms())
+        self.assertEqual(2,  ws_sf.getNumDims())
+        self.assertEqual(2,  ws_nsf.getNumDims())
+        # 2theta angles must not change after correction has been applied
+        tthetas = np.array([7.53 + i*5 for i in range(24)])
+        for i in range(24):
+            det = ws_sf.getDetector(i)
+            self.assertAlmostEqual(tthetas[i], np.degrees(ws_sf.detectorSignedTwoTheta(det)))
+            det = ws_nsf.getDetector(i)
+            self.assertAlmostEqual(tthetas[i], np.degrees(ws_nsf.detectorSignedTwoTheta(det)))
+
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'SF')
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'NSF')
+        run_algorithm("DeleteWorkspace", Workspace=dataws_sf)
+        run_algorithm("DeleteWorkspace", Workspace=dataws_nsf)
+
+        return
+
+    def test_DNSFRVanaCorrection(self):
+        outputWorkspaceName = "DNSFlippingRatioCorrTest_Test6"
+        # create fake vanadium data workspaces
+        dataY = np.array([1811., 2407., 3558., 3658., 3352., 2321., 2240., 2617., 3245., 3340., 3338., 3310.,
+                          2744., 3212., 1998., 2754., 2791., 2509., 3045., 3429., 3231., 2668., 3373., 2227.])
+        __sf_vanaws = self._create_fake_workspace('__sf_vanaws', dataY/58.0, flipper='ON')
+        self.workspaces.append('__sf_vanaws')
+        dataY = np.array([2050., 1910., 2295., 2236., 1965., 1393., 1402., 1589., 1902., 1972., 2091., 1957.,
+                          1593., 1952., 1232., 1720., 1689., 1568., 1906., 2001., 2051., 1687., 1975., 1456.])
+        __nsf_vanaws = self._create_fake_workspace('__nsf_vanaws', dataY/58.0, flipper='OFF')
+        self.workspaces.append('__nsf_vanaws')
+        # consider normalization=1.0 as set in self._create_fake_workspace
+        dataws_sf = __sf_vanaws - self.__sf_bkgrws
+        dataws_nsf = __nsf_vanaws - self.__nsf_bkgrws
+        alg_test = run_algorithm("DNSFlippingRatioCorr", SFDataWorkspace=dataws_sf,
+                                 NSFDataWorkspace=dataws_nsf, SFNiCrWorkspace=self.__sf_nicrws.getName(),
+                                 NSFNiCrWorkspace=self.__nsf_nicrws.getName(), SFBkgrWorkspace=self.__sf_bkgrws.getName(),
+                                 NSFBkgrWorkspace=self.__nsf_bkgrws.getName(), SFOutputWorkspace=outputWorkspaceName+'SF',
+                                 NSFOutputWorkspace=outputWorkspaceName+'NSF', DoubleSpinFlipScatteringProbability=0.0)
+
+        self.assertTrue(alg_test.isExecuted())
+        # check whether the data are correct
+        ws_sf = AnalysisDataService.retrieve(outputWorkspaceName + 'SF')
+        ws_nsf = AnalysisDataService.retrieve(outputWorkspaceName + 'NSF')
+        # dimensions
+        self.assertEqual(24, ws_sf.getNumberHistograms())
+        self.assertEqual(24, ws_nsf.getNumberHistograms())
+        self.assertEqual(2,  ws_sf.getNumDims())
+        self.assertEqual(2,  ws_nsf.getNumDims())
+        # data array: for vanadium ratio sf/nsf must be around 2
+        ws = ws_sf/ws_nsf
+        for i in range(24):
+            self.assertAlmostEqual(2.0, np.around(ws.readY(i)))
+
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'SF')
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'NSF')
+        run_algorithm("DeleteWorkspace", Workspace=dataws_sf)
+        run_algorithm("DeleteWorkspace", Workspace=dataws_nsf)
+        run_algorithm("DeleteWorkspace", Workspace=ws)
+        return
+
+    def test_DNSDoubleSpinFlip(self):
+        outputWorkspaceName = "DNSFlippingRatioCorrTest_Test7"
+        f = 0.2
+        # create fake vanadium data workspaces
+        dataY = np.array([1811., 2407., 3558., 3658., 3352., 2321., 2240., 2617., 3245., 3340., 3338., 3310.,
+                          2744., 3212., 1998., 2754., 2791., 2509., 3045., 3429., 3231., 2668., 3373., 2227.])
+        __sf_vanaws = self._create_fake_workspace('__sf_vanaws', dataY/58.0, flipper='ON')
+        self.workspaces.append('__sf_vanaws')
+        dataY = np.array([2050., 1910., 2295., 2236., 1965., 1393., 1402., 1589., 1902., 1972., 2091., 1957.,
+                          1593., 1952., 1232., 1720., 1689., 1568., 1906., 2001., 2051., 1687., 1975., 1456.])
+        __nsf_vanaws = self._create_fake_workspace('__nsf_vanaws', dataY/58.0, flipper='OFF')
+        self.workspaces.append('__nsf_vanaws')
+        # consider normalization=1.0 as set in self._create_fake_workspace
+        dataws_sf = __sf_vanaws - self.__sf_bkgrws
+        dataws_nsf = __nsf_vanaws - self.__nsf_bkgrws
+        alg_test = run_algorithm("DNSFlippingRatioCorr", SFDataWorkspace=dataws_sf,
+                                 NSFDataWorkspace=dataws_nsf, SFNiCrWorkspace=self.__sf_nicrws.getName(),
+                                 NSFNiCrWorkspace=self.__nsf_nicrws.getName(), SFBkgrWorkspace=self.__sf_bkgrws.getName(),
+                                 NSFBkgrWorkspace=self.__nsf_bkgrws.getName(), SFOutputWorkspace=outputWorkspaceName+'SF',
+                                 NSFOutputWorkspace=outputWorkspaceName+'NSF', DoubleSpinFlipScatteringProbability=0.0)
+
+        self.assertTrue(alg_test.isExecuted())
+        alg_test = run_algorithm("DNSFlippingRatioCorr", SFDataWorkspace=dataws_sf,
+                                 NSFDataWorkspace=dataws_nsf, SFNiCrWorkspace=self.__sf_nicrws.getName(),
+                                 NSFNiCrWorkspace=self.__nsf_nicrws.getName(), SFBkgrWorkspace=self.__sf_bkgrws.getName(),
+                                 NSFBkgrWorkspace=self.__nsf_bkgrws.getName(), SFOutputWorkspace=outputWorkspaceName+'SF1',
+                                 NSFOutputWorkspace=outputWorkspaceName+'NSF1', DoubleSpinFlipScatteringProbability=f)
+
+        self.assertTrue(alg_test.isExecuted())
+
+        # check whether the data are correct
+        ws_sf = AnalysisDataService.retrieve(outputWorkspaceName + 'SF')
+        ws_sf1 = AnalysisDataService.retrieve(outputWorkspaceName + 'SF1')
+        ws_nsf = AnalysisDataService.retrieve(outputWorkspaceName + 'NSF')
+        ws_nsf1 = AnalysisDataService.retrieve(outputWorkspaceName + 'NSF1')
+        # dimensions
+        self.assertEqual(24, ws_sf.getNumberHistograms())
+        self.assertEqual(24, ws_sf1.getNumberHistograms())
+        self.assertEqual(24, ws_nsf.getNumberHistograms())
+        self.assertEqual(24, ws_nsf1.getNumberHistograms())
+        self.assertEqual(2,  ws_sf.getNumDims())
+        self.assertEqual(2,  ws_sf1.getNumDims())
+        self.assertEqual(2,  ws_nsf.getNumDims())
+        self.assertEqual(2,  ws_nsf1.getNumDims())
+        # data array: sf must not change
+        for i in range(24):
+            self.assertAlmostEqual(ws_sf.readY(i), ws_sf1.readY(i))
+        # data array: nsf1 = nsf - sf*f
+        nsf = np.array(ws_nsf.extractY())
+        sf = np.array(ws_sf.extractY())
+        refdata = nsf - sf*f
+        for i in range(24):
+            self.assertAlmostEqual(refdata[i], ws_nsf1.readY(i))
+
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'SF')
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'SF1')
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'NSF')
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName + 'NSF1')
+        run_algorithm("DeleteWorkspace", Workspace=dataws_sf)
+        run_algorithm("DeleteWorkspace", Workspace=dataws_nsf)
+        return
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/DNSMergeRunsTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/DNSMergeRunsTest.py
new file mode 100644
index 0000000000000000000000000000000000000000..fbfa613b33fd4aa9ec55aa81b655dbe1fa8e3842
--- /dev/null
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/DNSMergeRunsTest.py
@@ -0,0 +1,164 @@
+import unittest
+from testhelpers import run_algorithm
+from mantid.api import AnalysisDataService
+import numpy as np
+import mantid.simpleapi as api
+from mantid.simpleapi import DNSMergeRuns
+
+
+class DNSMergeRunsTest(unittest.TestCase):
+    workspaces = []
+    angles = None
+
+    def _create_fake_workspace(self, wsname, angle):
+        """
+        creates DNS workspace with fake data
+        """
+        ndet = 24
+        dataX = np.zeros(2*ndet)
+        dataX.fill(4.2 + 0.00001)
+        dataX[::2] -= 0.000002
+        dataY = np.ones(ndet)
+        dataE = np.sqrt(dataY)
+        # create workspace
+        api.CreateWorkspace(OutputWorkspace=wsname, DataX=dataX, DataY=dataY,
+                            DataE=dataE, NSpec=ndet, UnitX="Wavelength")
+        outws = api.mtd[wsname]
+        api.LoadInstrument(outws, InstrumentName='DNS')
+        p_names = 'wavelength,slit_i_left_blade_position,slit_i_right_blade_position,\
+            slit_i_lower_blade_position,slit_i_upper_blade_position,polarisation,flipper'
+        p_values = '4.2,10,10,5,20,x,ON'
+        api.AddSampleLogMultiple(Workspace=outws, LogNames=p_names, LogValues=p_values, ParseType=True)
+        # rotate instrument component ans set deterota
+        api.RotateInstrumentComponent(outws, "bank0", X=0, Y=1, Z=0, Angle=angle)
+        api.AddSampleLog(outws, LogName='deterota', LogText=str(angle),
+                         LogType='Number', LogUnit='Degrees')
+        # create the normalization workspace
+        dataY.fill(1.0)
+        dataE.fill(1.0)
+        api.CreateWorkspace(OutputWorkspace=wsname + '_NORM', DataX=dataX, DataY=dataY,
+                            DataE=dataE, NSpec=ndet, UnitX="Wavelength")
+        normws = api.mtd[wsname + '_NORM']
+        api.LoadInstrument(normws, InstrumentName='DNS')
+        api.AddSampleLogMultiple(Workspace=normws, LogNames=p_names, LogValues=p_values, ParseType=True)
+
+        return outws
+
+    def setUp(self):
+        self.workspaces = []
+        for i in range(4):
+            angle = -7.5 - i*0.5
+            wsname = "__testws" + str(i)
+            self._create_fake_workspace(wsname, angle)
+            self.workspaces.append(wsname)
+        # create reference values
+        angles = np.empty(0)
+        for j in range(4):
+            a = 7.5 + j*0.5
+            angles = np.hstack([angles, np.array([i*5 + a for i in range(24)])])
+        self.angles = np.sort(angles)
+
+    def tearDown(self):
+        for wsname in self.workspaces:
+            if api.AnalysisDataService.doesExist(wsname + '_NORM'):
+                api.DeleteWorkspace(wsname + '_NORM')
+            if api.AnalysisDataService.doesExist(wsname):
+                api.DeleteWorkspace(wsname)
+        self.workspaces = []
+
+    def test_DNSNormWorkspaceExists(self):
+        outputWorkspaceName = "DNSMergeRunsTest_Test1"
+        api.DeleteWorkspace(self.workspaces[0] + '_NORM')
+        self.assertRaises(RuntimeError, DNSMergeRuns, WorkspaceNames=self.workspaces,
+                          OutputWorkspace=outputWorkspaceName)
+        return
+
+    def test_DNSSameWavelength(self):
+        outputWorkspaceName = "DNSMergeRunsTest_Test2"
+        ws = api.AnalysisDataService.retrieve(self.workspaces[0])
+        api.AddSampleLog(ws, LogName='wavelength', LogText=str(5.0),
+                         LogType='Number', LogUnit='Angstrom')
+        self.assertRaises(RuntimeError, DNSMergeRuns, WorkspaceNames=self.workspaces,
+                          OutputWorkspace=outputWorkspaceName)
+        return
+
+    def test_DNSTwoTheta(self):
+        outputWorkspaceName = "DNSMergeRunsTest_Test3"
+        alg_test = run_algorithm("DNSMergeRuns", WorkspaceNames=self.workspaces,
+                                 OutputWorkspace=outputWorkspaceName,  HorizontalAxis='2theta')
+
+        self.assertTrue(alg_test.isExecuted())
+        # check whether the data are correct
+        ws = AnalysisDataService.retrieve(outputWorkspaceName)
+        # dimensions
+        self.assertEqual(96, ws.blocksize())
+        self.assertEqual(2,  ws.getNumDims())
+        self.assertEqual(1,  ws.getNumberHistograms())
+        # data array
+        # read the merged values
+        dataX = ws.extractX()[0]
+        for i in range(len(self.angles)):
+            self.assertAlmostEqual(self.angles[i], dataX[i])
+        # check that the intensity has not been changed
+        dataY = ws.extractY()[0]
+        for i in range(len(dataY)):
+            self.assertAlmostEqual(1.0, dataY[i])
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName)
+        return
+
+    def test_DNSMomentumTransfer(self):
+        outputWorkspaceName = "DNSMergeRunsTest_Test4"
+        alg_test = run_algorithm("DNSMergeRuns", WorkspaceNames=self.workspaces,
+                                 OutputWorkspace=outputWorkspaceName, HorizontalAxis='|Q|')
+
+        self.assertTrue(alg_test.isExecuted())
+        # check whether the data are correct
+        ws = AnalysisDataService.retrieve(outputWorkspaceName)
+        # dimensions
+        self.assertEqual(96, ws.blocksize())
+        self.assertEqual(2,  ws.getNumDims())
+        self.assertEqual(1,  ws.getNumberHistograms())
+        # data array
+        # reference values
+        ttheta = np.round(np.radians(self.angles), 4)
+        qarr = np.sort(4.0*np.pi*np.sin(0.5*ttheta)/4.2)
+        # read the merged values
+        dataX = ws.extractX()[0]
+        for i in range(len(self.angles)):
+            self.assertAlmostEqual(qarr[i], dataX[i])
+        # check that the intensity has not been changed
+        dataY = ws.extractY()[0]
+        for i in range(len(dataY)):
+            self.assertAlmostEqual(1.0, dataY[i])
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName)
+        return
+
+    def test_DNSDSpacing(self):
+        outputWorkspaceName = "DNSMergeRunsTest_Test5"
+        alg_test = run_algorithm("DNSMergeRuns", WorkspaceNames=self.workspaces,
+                                 OutputWorkspace=outputWorkspaceName, HorizontalAxis='d-Spacing')
+
+        self.assertTrue(alg_test.isExecuted())
+        # check whether the data are correct
+        ws = AnalysisDataService.retrieve(outputWorkspaceName)
+        # dimensions
+        self.assertEqual(96, ws.blocksize())
+        self.assertEqual(2,  ws.getNumDims())
+        self.assertEqual(1,  ws.getNumberHistograms())
+        # data array
+        # reference values
+        ttheta = np.round(np.radians(self.angles), 4)
+        darr = np.sort(4.2*0.5/np.sin(0.5*ttheta))
+        # read the merged values
+        dataX = ws.extractX()[0]
+        for i in range(len(self.angles)):
+            self.assertAlmostEqual(darr[i], dataX[i])
+        # check that the intensity has not been changed
+        dataY = ws.extractY()[0]
+        for i in range(len(dataY)):
+            self.assertAlmostEqual(1.0, dataY[i])
+        run_algorithm("DeleteWorkspace", Workspace=outputWorkspaceName)
+        return
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn3AsciiTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn3AsciiTest.py
index fd4868a60cd8526927b7b9bd4c960fd0bc1171f0..ba26ed1c9f5acb451c06474f4ccb7caf224e440b 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn3AsciiTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn3AsciiTest.py
@@ -4,7 +4,7 @@ import unittest
 from mantid.simpleapi import *
 from mantid.api import *
 
-class MolDynTest(unittest.TestCase):
+class LoadNMoldyn3AsciiTest(unittest.TestCase):
 
     _cdl_filename = 'NaF_DISF.cdl'
     _dat_filename = 'WSH_test.dat'
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn4AsciiTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn4AsciiTest.py
index c60e8ea989323602d20092a8b27dec20f76303c0..6fe68ac41369b044254703ab9536be65cf1aaacb 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn4AsciiTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/LoadNMoldyn4AsciiTest.py
@@ -29,7 +29,8 @@ class LoadNMoldyn4AsciiTest(unittest.TestCase):
         self.assertTrue(isinstance(workspace, MatrixWorkspace))
         self.assertEqual(workspace.getNumberHistograms(), 21)
         self.assertEqual(workspace.blocksize(), 100)
-        self.assertEqual(str(workspace.getAxis(0).getUnit().symbol()), 'ps')
+        self.assertEqual(str(workspace.getAxis(0).getUnit().unitID()), 'TOF')
+        self.assertEqual(str(workspace.getAxis(1).getUnit().unitID()), 'MomentumTransfer')
 
 
     def _validate_sqf_ws(self, workspace):
@@ -41,7 +42,8 @@ class LoadNMoldyn4AsciiTest(unittest.TestCase):
         self.assertTrue(isinstance(workspace, MatrixWorkspace))
         self.assertEqual(workspace.getNumberHistograms(), 21)
         self.assertEqual(workspace.blocksize(), 199)
-        self.assertEqual(str(workspace.getAxis(0).getUnit().symbol()), 'THz')
+        self.assertEqual(str(workspace.getAxis(0).getUnit().unitID()), 'Energy')
+        self.assertEqual(str(workspace.getAxis(1).getUnit().unitID()), 'MomentumTransfer')
 
 
     def test_load_single_fqt_function(self):
diff --git a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/MolDynTest.py b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/MolDynTest.py
index f9c57950dabcdc7dc1399543c88d8f2d2bb34dd5..c027938b27f4c077214b00422773a77c11550f39 100644
--- a/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/MolDynTest.py
+++ b/Code/Mantid/Framework/PythonInterface/test/python/plugins/algorithms/MolDynTest.py
@@ -7,9 +7,49 @@ from mantid.api import *
 
 class MolDynTest(unittest.TestCase):
 
+    def test_load_version3_cdl(self):
+        """
+        Load a function from a nMOLDYN 3 .cdl file
+        """
+
+        moldyn_group = MolDyn(Data='NaF_DISF.cdl',
+                              Functions=['Sqw-total'],
+                              OutputWorkspace='__LoadNMoldyn3Ascii_test')
+
+        self.assertTrue(isinstance(moldyn_group, WorkspaceGroup))
+
+
+    def test_load_version3_dat(self):
+        """
+        Load a function from an nMOLDYN 3 .dat file
+        """
+
+        moldyn_ws = MolDyn(Data='WSH_test.dat',
+                           OutputWorkspace='__LoadNMoldyn3Ascii_test')
+
+        self.assertTrue(isinstance(moldyn_ws, MatrixWorkspace))
+
+
+    def test_load_version4(self):
+        """
+        Load a function from an nMOLDYN 4 export.
+        """
+        # This test requires the directory to be provided, this is in the
+        # UnitTest directory so do get this from the serch directories
+        data_dirs = config['datasearch.directories'].split(';')
+        unit_test_data_dir = [p for p in data_dirs if 'UnitTest' in p][0]
+        data_directory = os.path.join(unit_test_data_dir, 'nmoldyn4_data')
+
+        function_ws = MolDyn(Data=data_directory,
+                             Functions=['fqt_total'],
+                             OutputWorkspace='__LoadNMoldyn4Ascii_test')
+
+        self.assertTrue(isinstance(function_ws, MatrixWorkspace))
+
+
     def test_loadSqwWithEMax(self):
         # Load an Sqw function from a nMOLDYN file
-        moldyn_group = MolDyn(Filename='NaF_DISF.cdl',
+        moldyn_group = MolDyn(Data='NaF_DISF.cdl',
                               Functions=['Sqw-total'],
                               MaxEnergy="1.0")
 
@@ -27,7 +67,7 @@ class MolDynTest(unittest.TestCase):
 
     def test_loadSqwWithSymm(self):
         # Load an Sqw function from a nMOLDYN file
-        moldyn_group = MolDyn(Filename='NaF_DISF.cdl',
+        moldyn_group = MolDyn(Data='NaF_DISF.cdl',
                               Functions=['Sqw-total'],
                               SymmetriseEnergy=True)
 
@@ -54,7 +94,7 @@ class MolDynTest(unittest.TestCase):
                                            BinWidth=0.1)
 
         # Load an Sqw function from a nMOLDYN file
-        moldyn_group = MolDyn(Filename='NaF_DISF.cdl',
+        moldyn_group = MolDyn(Data='NaF_DISF.cdl',
                               Functions=['Sqw-total'],
                               MaxEnergy="1.0",
                               SymmetriseEnergy=True,
@@ -80,7 +120,7 @@ class MolDynTest(unittest.TestCase):
 
         # Load an Sqw function from a nMOLDYN file
         self.assertRaises(RuntimeError, MolDyn,
-                          Filename='NaF_DISF.cdl',
+                          Data='NaF_DISF.cdl',
                           Functions=['Sqw-total'],
                           Resolution=sample_res,
                           OutputWorkspace='moldyn_group')
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction2.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction2.cpp
index 53a441cd5e8065b6eea6afbcf16ef5d238f18d8d..3a4e43d93bfac772f14bf0798b79e933717b174b 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction2.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction2.cpp
@@ -72,6 +72,18 @@ void EQSANSDarkCurrentSubtraction2::exec() {
   Progress progress(this, 0.0, 1.0, 10);
 
   MatrixWorkspace_sptr inputWS = getProperty("InputWorkspace");
+  
+  // This version of dark current subtraction only works on histograms.
+  // Users need to either make sure the EQSANSLoad algorithm produces
+  // histograms, or turn off the dark current subtraction.
+  EventWorkspace_const_sptr inputEventWS =
+      boost::dynamic_pointer_cast<const EventWorkspace>(inputWS);
+  if (inputEventWS) {
+    g_log.error() << "To use this version of EQSANSDarkCurrentSubtraction, "
+                  << "you need to make sure EQSANSLoad produces histograms. "
+                  << "You can also turn the dark current subtraction off." << std::endl;
+    throw std::invalid_argument("EQSANSDarkCurrentSubtraction-v2 only works on histograms.");
+  }
 
   const std::string fileName = getPropertyValue("Filename");
   MatrixWorkspace_sptr darkWS;
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/SetupEQSANSReduction.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/SetupEQSANSReduction.cpp
index e2597e134972cf3bfffbcde0ce56ef0716e520c3..8a2d6b3262e0f9bc0b7422aeeabd1eb66b2a3869 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/SetupEQSANSReduction.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/SetupEQSANSReduction.cpp
@@ -48,7 +48,7 @@ void SetupEQSANSReduction::init() {
 
   declareProperty("SkipTOFCorrection", false,
                   "If true, the EQSANS TOF correction will be skipped");
-  declareProperty("PreserveEvents", true,
+  declareProperty("PreserveEvents", false,
                   "If true, the output workspace will be an event workspace");
 
   declareProperty(
diff --git a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
index 49512ec4d7f893aeaaf3e32dea1b9d1b453dcd39..ea3dde957a9768d309ec79f04d8291c639a8b854 100644
--- a/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
+++ b/Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
@@ -14048,7 +14048,7 @@ void ApplicationWindow::showmantidplotHelp()
 
 void ApplicationWindow::showBugTracker()
 {
-  QDesktopServices::openUrl(QUrl("mailto:mantid-help@mantidproject.org"));
+  QDesktopServices::openUrl(QUrl("http://forum.mantidproject.org/"));
 }
 
 /*
diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.cpp
index 4653fbd5a36321ed72509d5d76ab1ebeff2468d7..ff2d5c919c2ff24e224ca0d2d7ed6c269400d185 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.cpp
+++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.cpp
@@ -238,6 +238,30 @@ MatrixWorkspace_sptr InstrumentActor::getMaskMatrixWorkspace() const
     return m_maskWorkspace;
 }
 
+/** set the mask workspace
+*/
+void InstrumentActor::setMaskMatrixWorkspace(MatrixWorkspace_sptr wsMask) const
+{
+    m_maskWorkspace = wsMask;
+}
+
+void InstrumentActor::invertMaskWorkspace() const
+{
+  Mantid::API::MatrixWorkspace_sptr outputWS;
+  
+  const std::string maskName = "__InstrumentActor_MaskWorkspace_invert";
+  Mantid::API::AnalysisDataService::Instance().addOrReplace(maskName, getMaskMatrixWorkspace());
+  Mantid::API::IAlgorithm * invertAlg = Mantid::API::FrameworkManager::Instance().createAlgorithm("BinaryOperateMasks",-1);
+  invertAlg->setChild(true);
+  invertAlg->setPropertyValue("InputWorkspace1", maskName);
+  invertAlg->setPropertyValue("OutputWorkspace", maskName);
+  invertAlg->setPropertyValue("OperationType", "NOT");
+  invertAlg->execute();
+
+  m_maskWorkspace = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(maskName));
+  Mantid::API::AnalysisDataService::Instance().remove( maskName );
+}
+
 /**
   * Returns the mask workspace relating to this instrument view as a IMaskWorkspace.
   * Guarantees to return a valid pointer
@@ -864,6 +888,23 @@ void InstrumentActor::setAutoscaling(bool on)
   }
 }
 
+/**
+ * Extracts the current applied mask to the main workspace
+ * @returns the current applied mask to the main workspace
+ */
+Mantid::API::MatrixWorkspace_sptr InstrumentActor::extractCurrentMask() const
+{
+  const std::string maskName = "__InstrumentActor_MaskWorkspace";
+  Mantid::API::IAlgorithm * alg = Mantid::API::FrameworkManager::Instance().createAlgorithm("ExtractMask",-1);
+  alg->setPropertyValue( "InputWorkspace", getWorkspace()->name() );
+  alg->setPropertyValue( "OutputWorkspace", maskName );
+  alg->execute();
+
+  Mantid::API::MatrixWorkspace_sptr maskWorkspace = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(maskName));
+  Mantid::API::AnalysisDataService::Instance().remove( maskName );
+  return maskWorkspace;
+}
+
 /**
  * Initialize the helper mask workspace with the mask from the data workspace.
  */
@@ -873,19 +914,12 @@ void InstrumentActor::initMaskHelper() const
   try
   {
     // extract the mask (if any) from the data to the mask workspace
-    const std::string maskName = "__InstrumentActor_MaskWorkspace";
-    Mantid::API::IAlgorithm * alg = Mantid::API::FrameworkManager::Instance().createAlgorithm("ExtractMask",-1);
-    alg->setPropertyValue( "InputWorkspace", getWorkspace()->name() );
-    alg->setPropertyValue( "OutputWorkspace", maskName );
-    alg->execute();
-
-    m_maskWorkspace = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(maskName));
-    Mantid::API::AnalysisDataService::Instance().remove( maskName );
+    m_maskWorkspace = extractCurrentMask();
   }
   catch( ... )
   {
     // don't know what to do here yet ...
-    QMessageBox::warning(NULL,"MantidPlot - Warning","An error accured when extracting the mask.","OK");
+    QMessageBox::warning(NULL,"MantidPlot - Warning","An error occurred when extracting the mask.","OK");
   }
 }
 
diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.h
index 5fb0742ef726ccc187252292895d188158f0c7ab..3f29d5c58ab5012cbb66ed8f807854baf2dfb689 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.h
+++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentActor.h
@@ -8,6 +8,7 @@
 #include "SampleActor.h"
 #include "MantidQtAPI/MantidColorMap.h"
 #include "MantidAPI/SpectraDetectorTypes.h"
+#include "MantidAPI/MatrixWorkspace_fwd.h"
 #include "MantidGeometry/IObjComponent.h"
 
 #include <boost/weak_ptr.hpp>
@@ -73,6 +74,10 @@ public:
   boost::shared_ptr<const Mantid::API::MatrixWorkspace> getWorkspace() const;
   /// Get the mask displayed but not yet applied as a MatrxWorkspace
   boost::shared_ptr<Mantid::API::MatrixWorkspace> getMaskMatrixWorkspace() const;
+  ///set the mask workspace
+  void setMaskMatrixWorkspace(Mantid::API::MatrixWorkspace_sptr wsMask) const;
+  ///inverts the internal mask workspace
+  void invertMaskWorkspace() const;
   /// Get the mask displayed but not yet applied as a IMaskWorkspace
   boost::shared_ptr<Mantid::API::IMaskWorkspace> getMaskWorkspace() const;
   /// Apply the mask in the attached mask workspace to the data.
@@ -90,6 +95,9 @@ public:
   QString getCurrentColorMap()const{return m_currentColorMapFilename;}
   /// Toggle colormap scale autoscaling.
   void setAutoscaling(bool);
+  /// extracts a mask workspace from the visualised workspace
+  Mantid::API::MatrixWorkspace_sptr extractCurrentMask() const;
+
   /// Get colormap scale autoscaling status.
   bool autoscaling()const{return m_autoscaling;}
 
diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp
index da3f9028513fbe958b9c62e6923b41a308c33fe3..683eecc379afa8a0f670e4c8b4d2575d6a62f5a9 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp
+++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp
@@ -1189,14 +1189,14 @@ void InstrumentWindow::createTabs(QSettings &settings) {
 
   // Mask controls
   InstrumentWindowMaskTab *maskTab = new InstrumentWindowMaskTab(this);
-  mControlsTab->addTab(maskTab, QString("Mask/Group"));
+  mControlsTab->addTab(maskTab, QString("Draw"));
   connect(maskTab, SIGNAL(executeAlgorithm(const QString &, const QString &)),
           this, SLOT(executeAlgorithm(const QString &, const QString &)));
   maskTab->loadSettings(settings);
 
   // Instrument tree controls
   InstrumentWindowTreeTab *treeTab = new InstrumentWindowTreeTab(this);
-  mControlsTab->addTab(treeTab, QString("Instrument Tree"));
+  mControlsTab->addTab(treeTab, QString("Instrument"));
   treeTab->loadSettings(settings);
 
   connect(mControlsTab, SIGNAL(currentChanged(int)), this,
diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowMaskTab.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowMaskTab.cpp
index 9820795267c684c7e3f2596a4d8ac966fa32494a..c90fccd9e4b72a00a4ba8e906e1f781b88bb14b8 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowMaskTab.cpp
+++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowMaskTab.cpp
@@ -146,13 +146,18 @@ m_left(NULL), m_top(NULL), m_right(NULL), m_bottom(NULL)
   // create mask/group switch
   m_masking_on = new QRadioButton("Mask");
   m_grouping_on = new QRadioButton("Group");
+  m_roi_on = new QRadioButton("ROI");
   m_masking_on->setChecked(true);
-  connect(m_masking_on,SIGNAL(toggled(bool)),this,SLOT(toggleMaskGroup(bool)));
+  connect(m_masking_on,SIGNAL(clicked()),this,SLOT(toggleMaskGroup()));
+  connect(m_grouping_on,SIGNAL(clicked()),this,SLOT(toggleMaskGroup()));
+  connect(m_roi_on,SIGNAL(clicked()),this,SLOT(toggleMaskGroup()));
   QHBoxLayout* radioLayout = new QHBoxLayout();
   radioLayout->addWidget(m_masking_on);
+  radioLayout->addWidget(m_roi_on);
   radioLayout->addWidget(m_grouping_on);
   radioLayout->setMargin(0);
-  QWidget* radioGroup = new QWidget();
+  QGroupBox* radioGroup = new QGroupBox();
+  radioGroup->setStyleSheet("border: none;");
   radioGroup->setLayout(radioLayout);
 
   layout->addWidget(radioGroup);
@@ -242,13 +247,8 @@ m_left(NULL), m_top(NULL), m_right(NULL), m_bottom(NULL)
   m_saveButton->setToolTip("Save current masking/grouping to a file or a workspace.");
 
   m_saveMask = new QMenu(this);
-  m_saveMask->addAction(m_save_as_workspace_include);
   m_saveMask->addAction(m_save_as_workspace_exclude);
-  m_saveMask->addSeparator();
-  m_saveMask->addAction(m_save_as_file_include);
   m_saveMask->addAction(m_save_as_file_exclude);
-  m_saveMask->addSeparator();
-  m_saveMask->addAction(m_save_as_cal_file_include);
   m_saveMask->addAction(m_save_as_cal_file_exclude);
   m_saveMask->addSeparator();
   m_saveMask->addAction(m_save_as_table_xrange_exclude);
@@ -260,10 +260,21 @@ m_left(NULL), m_top(NULL), m_right(NULL), m_bottom(NULL)
   m_saveGroup->addAction(m_extract_to_workspace);
   m_saveGroup->addAction(m_sum_to_workspace);
   m_saveGroup->addSeparator();
-  m_saveGroup->addAction(m_save_group_file_include);
-  m_saveGroup->addAction(m_save_group_file_exclude);
+
   connect(m_saveGroup,SIGNAL(hovered(QAction*)),this,SLOT(showSaveMenuTooltip(QAction*)));
 
+
+  m_saveROI = new QMenu(this);
+  m_saveROI->addAction(m_save_as_workspace_include);
+  m_saveROI->addAction(m_save_as_file_include);
+  m_saveROI->addAction(m_save_as_cal_file_include);
+  m_saveROI->addSeparator();
+  m_saveROI->addAction(m_extract_to_workspace);
+  m_saveROI->addAction(m_sum_to_workspace);
+
+  connect(m_saveROI,SIGNAL(hovered(QAction*)),this,SLOT(showSaveMenuTooltip(QAction*)));
+
+
   QGroupBox *box = new QGroupBox("View");
   QGridLayout* buttons = new QGridLayout();
   buttons->addWidget(m_apply_to_view,0,0,1,2);
@@ -302,14 +313,15 @@ void InstrumentWindowMaskTab::setMode(Mode mode)
 {
   switch(mode)
   {
-  case Mask: toggleMaskGroup(true);
+  case Mask: m_masking_on->setOn(true);
+    break;
+  case Group: m_grouping_on->setOn(true);
     break;
-  case Group: toggleMaskGroup(false);
+  case ROI: m_roi_on->setOn(true);
     break;
   default: throw std::invalid_argument("Invalid Mask tab mode. Use Mask/Group.");
   };
-
-
+  toggleMaskGroup();
 }
 
 void InstrumentWindowMaskTab::selectTool(Activity tool)
@@ -415,7 +427,7 @@ void InstrumentWindowMaskTab::shapesDeselected()
 void InstrumentWindowMaskTab::shapeChanged()
 {
   if (!m_left) return; // check that everything is ok
-  m_userEditing = false; // this prevents resetting shape proeprties by doubleChanged(...)
+  m_userEditing = false; // this prevents resetting shape properties by doubleChanged(...)
   RectF rect = m_instrWindow->getSurface()->getCurrentBoundingRect();
   m_doubleManager->setValue(m_left,rect.x0());
   m_doubleManager->setValue(m_top,rect.y1());
@@ -555,7 +567,7 @@ void InstrumentWindowMaskTab::doubleChanged(QtProperty* prop)
   */
 void InstrumentWindowMaskTab::applyMask()
 {
-  storeMask();
+  storeMask(getMode()==Mode::ROI);
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   m_instrWindow->getInstrumentActor()->applyMaskWorkspace();
   enableApplyButtons();
@@ -567,7 +579,7 @@ void InstrumentWindowMaskTab::applyMask()
   */
 void InstrumentWindowMaskTab::applyMaskToView()
 {
-    storeMask();
+    storeMask(getMode()==Mode::ROI);
     enableApplyButtons();
 }
 
@@ -727,30 +739,33 @@ void InstrumentWindowMaskTab::showSaveMenuTooltip(QAction *action)
 }
 
 /**
-  * Toggle between masking and grouping.
+  * Toggle between different modes
   *
-  * @param maskOn :: True if masking functionality to be set. False is for grouping.
   */
-void InstrumentWindowMaskTab::toggleMaskGroup(bool maskOn)
+void InstrumentWindowMaskTab::toggleMaskGroup( )
 {
-    m_masking_on->blockSignals(true);
-    m_masking_on->setChecked(maskOn);
-    m_grouping_on->setChecked(!maskOn);
-    m_masking_on->blockSignals(false);
+  Mode mode = getMode();
+
+
+  enableApplyButtons();
+  if ( mode == Mode::Mask )
+  {
+      m_saveButton->setMenu(m_saveMask);
+      m_saveButton->setText("Apply and Save");
+  }
+  else if ( mode == Mode::ROI )
+  {   
+      m_saveButton->setMenu(m_saveROI);
+      m_saveButton->setText("Apply and Save");
+  }
+  else
+  {
+      m_saveButton->setMenu(m_saveGroup);
+      m_saveButton->setText("Save");
+  }
+  m_instrWindow->getSurface()->changeBorderColor(getShapeBorderColor());
+  m_instrWindow->updateInstrumentView();
 
-    enableApplyButtons();
-    if ( maskOn )
-    {
-        m_saveButton->setMenu(m_saveMask);
-        m_saveButton->setText("Apply and Save");
-    }
-    else
-    {
-        m_saveButton->setMenu(m_saveGroup);
-        m_saveButton->setText("Save");
-    }
-    m_instrWindow->getSurface()->changeBorderColor(getShapeBorderColor());
-    m_instrWindow->updateInstrumentView();
 }
 
 /**
@@ -762,9 +777,9 @@ void InstrumentWindowMaskTab::saveMaskingToWorkspace(bool invertMask)
 {
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   // Make sure we have stored the Mask in the helper MaskWorkspace
-  storeMask();
+  storeMask(invertMask);
   setSelectActivity();
-  createMaskWorkspace(invertMask, false);
+  createMaskWorkspace(false, false);
 
 #if 0
   // TESTCASE
@@ -788,14 +803,16 @@ void InstrumentWindowMaskTab::saveMaskingToFile(bool invertMask)
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 
   // Make sure we have stored the Mask in the helper MaskWorkspace
-  storeMask();
-
+  storeMask(invertMask);
   setSelectActivity();
-  Mantid::API::MatrixWorkspace_sptr outputWS = createMaskWorkspace(invertMask,true);
+  Mantid::API::MatrixWorkspace_sptr outputWS = createMaskWorkspace(false,true);
   if (outputWS)
   {
     clearShapes();
+    
+    QApplication::restoreOverrideCursor();
     QString fileName = m_instrWindow->getSaveFileName("Select location and name for the mask file", "XML files (*.xml);;All (*.* *)");
+    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 
     if (!fileName.isEmpty())
     {
@@ -822,7 +839,7 @@ void InstrumentWindowMaskTab::saveMaskingToCalFile(bool invertMask)
     QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 
     // Make sure we have stored the Mask in the helper MaskWorkspace
-    storeMask();
+    storeMask(invertMask);
 
     setSelectActivity();
     Mantid::API::MatrixWorkspace_sptr outputWS = createMaskWorkspace(false,true);
@@ -835,7 +852,7 @@ void InstrumentWindowMaskTab::saveMaskingToCalFile(bool invertMask)
         Mantid::API::IAlgorithm_sptr alg = Mantid::API::AlgorithmManager::Instance().create("MaskWorkspaceToCalFile",-1);
         alg->setPropertyValue("InputWorkspace",outputWS->name());
         alg->setPropertyValue("OutputFile",fileName.toStdString());
-        alg->setProperty("Invert",invertMask);
+        alg->setProperty("Invert",false);
         alg->execute();
       }
       Mantid::API::AnalysisDataService::Instance().remove( outputWS->name() );
@@ -967,7 +984,7 @@ void InstrumentWindowMaskTab::enableApplyButtons()
     bool hasMaskShapes = m_instrWindow->getSurface()->hasMasks();
     bool hasMaskWorkspace = m_instrWindow->getInstrumentActor()->hasMaskWorkspace();
     bool hasMask = hasMaskShapes || hasMaskWorkspace;
-    if ( isMasking() )
+    if (( getMode() == Mode::Mask ) || ( getMode() == Mode::ROI ))
     {
         m_hasMaskToApply = hasMask;
         m_apply->setEnabled(hasMask);
@@ -992,11 +1009,18 @@ void InstrumentWindowMaskTab::setSelectActivity()
 }
 
 /**
-  * It tab in masking or grouping mode?
+  * It tab in masking, ROI or grouping mode?
   */
-bool InstrumentWindowMaskTab::isMasking() const
+InstrumentWindowMaskTab::Mode InstrumentWindowMaskTab::getMode() const
 {
-    return m_masking_on->isChecked();
+  if (m_masking_on->isOn())
+    return Mode::Mask;
+  if (m_roi_on->isOn())
+    return Mode::ROI;
+  if (m_grouping_on->isOn())
+    return Mode::Group;
+
+  throw std::logic_error("Invalid mode");
 }
 
 /**
@@ -1004,7 +1028,8 @@ bool InstrumentWindowMaskTab::isMasking() const
   */
 QColor InstrumentWindowMaskTab::getShapeBorderColor() const
 {
-    if ( isMasking() ) return Qt::red;
+    if ( getMode()==Mode::Mask ) return Qt::red;
+    if ( getMode()==Mode::ROI ) return Qt::yellow;
     return Qt::blue;
 }
 
@@ -1026,34 +1051,66 @@ QtProperty *InstrumentWindowMaskTab::addDoubleProperty(const QString &name) cons
 /**
  * Store the mask defined by the shape tools to the helper m_maskWorkspace.
  */
-void InstrumentWindowMaskTab::storeMask()
+void InstrumentWindowMaskTab::storeMask(bool isROI)
 {
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   m_pointer->setChecked(true);
   setActivity();
   m_instrWindow->updateInstrumentView(); // to refresh the pick image
+  Mantid::API::IMaskWorkspace_sptr wsFresh;
 
   QList<int> dets;
   // get detectors covered by the shapes
   m_instrWindow->getSurface()->getMaskedDetectors(dets);
   if (!dets.isEmpty())
   {
+    auto wsMask = m_instrWindow->getInstrumentActor()->getMaskWorkspace();
+    //have to cast up to the MaskWorkspace to get access to clone()
+
     std::set<Mantid::detid_t> detList;
+    if (isROI)
+    { 
+      //need to invert the mask before adding the new shape
+      //but not if the mask is fresh and empty
+      if (wsMask->getNumberMasked() >0 )
+      {
+        wsFresh = boost::dynamic_pointer_cast<Mantid::API::IMaskWorkspace>(
+          m_instrWindow->getInstrumentActor()->extractCurrentMask());
+        m_instrWindow->getInstrumentActor()->invertMaskWorkspace();
+      }
+    }
     foreach(int id,dets)
     {
       detList.insert( id );
     }
+    
     if ( !detList.empty() )
     {
-      // try to mask each detector separatly and ignore any failure
+      // try to mask each detector separately and ignore any failure
       for(auto det = detList.begin(); det != detList.end(); ++det)
       {
         try
         {
-          m_instrWindow->getInstrumentActor()->getMaskWorkspace()->setMasked( *det );
+          if (isROI && wsFresh)
+          {
+              if (wsMask->isMasked(*det))
+                wsFresh->setMasked( *det );
+          }
+          else
+          {
+              wsMask->setMasked( *det );
+          }
         }
         catch(...){}
       }
+      if (isROI)
+      { 
+        if (wsFresh)
+          m_instrWindow->getInstrumentActor()->setMaskMatrixWorkspace(
+            boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(wsFresh));
+        //need to invert the mask before displaying
+        m_instrWindow->getInstrumentActor()->invertMaskWorkspace();
+      }
       // update detector colours
       m_instrWindow->getInstrumentActor()->updateColors();
       m_instrWindow->updateInstrumentDetectors();
diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowMaskTab.h b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowMaskTab.h
index 71ff662b3e0b03e3e8a56c23d64c3c545fa526f1..5ef2db91bee8a2ac2946f64ce750114bdf99d62c 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowMaskTab.h
+++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindowMaskTab.h
@@ -53,7 +53,7 @@ class InstrumentWindowMaskTab: public InstrumentWindowTab
 {
   Q_OBJECT
 public:
-  enum Mode {Mask, Group};
+  enum Mode {Mask, Group, ROI};
   enum Activity {Move,Select,DrawEllipse,DrawRectangle,DrawEllipticalRing,DrawRectangularRing};
 
   InstrumentWindowMaskTab(InstrumentWindow* instrWindow);
@@ -73,7 +73,7 @@ protected slots:
   void clearShapes();
   void applyMask();
   void applyMaskToView();
-  void storeMask();
+  void storeMask(bool isROI = false);
   void clearMask();
   void saveInvertedMaskToWorkspace();
   void saveInvertedMaskToFile();
@@ -87,7 +87,7 @@ protected slots:
   void saveIncludeGroupToFile();
   void saveExcludeGroupToFile();
   void showSaveMenuTooltip(QAction*);
-  void toggleMaskGroup(bool);
+  void toggleMaskGroup();
 
   void doubleChanged(QtProperty*);
 protected:
@@ -103,8 +103,7 @@ protected:
   std::string generateMaskWorkspaceName(bool temp = false) const;
   void enableApplyButtons();
   void setSelectActivity();
-  /// True if in masking mode, flase if in grouping.
-  bool isMasking() const;
+  Mode getMode() const;
   /// Get mask/group border color
   QColor getShapeBorderColor() const;
   /// Get mask/group fill color
@@ -119,6 +118,7 @@ protected:
 
   QRadioButton* m_masking_on;
   QRadioButton* m_grouping_on;
+  QRadioButton* m_roi_on;
 
   QLabel *m_activeTool; ///< Displays a tip on which tool is currently selected
 
@@ -137,11 +137,7 @@ protected:
 
 
   QMenu* m_saveMask;
-  QAction* m_save_as_workspace_include;
-  QAction* m_save_as_workspace_exclude;
-  QAction* m_save_as_file_include;
   QAction* m_save_as_file_exclude;
-  QAction* m_save_as_cal_file_include;
   QAction* m_save_as_cal_file_exclude;
   QAction *m_save_as_table_xrange_exclude;
 
@@ -151,6 +147,13 @@ protected:
   QAction* m_save_group_file_include;
   QAction* m_save_group_file_exclude;
 
+  
+  QMenu* m_saveROI;
+  QAction* m_save_as_workspace_include;
+  QAction* m_save_as_workspace_exclude;
+  QAction* m_save_as_file_include;
+  QAction* m_save_as_cal_file_include;
+
   // properties
   bool m_userEditing;
   QtGroupPropertyManager  *m_groupManager;
@@ -167,6 +170,7 @@ protected:
   QMap<QtProperty *,QString> m_doublePropertyMap;
   QMap<QString,QtProperty *> m_pointPropertyMap;
   QMap<QtProperty *,QString> m_pointComponentsMap;
+
 };
 
 
diff --git a/Code/Mantid/MantidPlot/src/PlotDialog.cpp b/Code/Mantid/MantidPlot/src/PlotDialog.cpp
index 1a21ac53825c551856a8309c6c80dce3b2e283c1..b7e0bf20505f6d3ce81a8e951ef74dcd11fc1a2e 100644
--- a/Code/Mantid/MantidPlot/src/PlotDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/PlotDialog.cpp
@@ -3200,10 +3200,7 @@ void LayerItem::insertCurvesList()
     {
       PlotCurve *c = dynamic_cast<PlotCurve *>(it);
       DataCurve* dc = dynamic_cast<DataCurve *>(it);
-      if (!c || !dc)
-        continue;
-
-      if (dc && c->type() != Graph::Function && dc->table())
+      if (c && dc && c->type() != Graph::Function && dc->table())
       {
         QString s = dc->plotAssociation();
         QString table = dc->table()->name();
diff --git a/Code/Mantid/MantidQt/CustomDialogs/CMakeLists.txt b/Code/Mantid/MantidQt/CustomDialogs/CMakeLists.txt
index 4640ceec1ae59660f2bfc729c22d464eebb66335..a4d4a8f6d7b658eac683a5186ed9ffe025d0e8de 100644
--- a/Code/Mantid/MantidQt/CustomDialogs/CMakeLists.txt
+++ b/Code/Mantid/MantidQt/CustomDialogs/CMakeLists.txt
@@ -9,6 +9,7 @@ set ( SRC_FILES src/CatalogPublishDialog.cpp
                 src/LoadRawDialog.cpp
                 src/LOQScriptInputDialog.cpp
                 src/MantidGLWidget.cpp
+                src/GetNegMuMuonicXRDDialog.cpp
                 src/PlotAsymmetryByLogValueDialog.cpp
                 src/SampleShapeHelpers.cpp
                 src/SmoothNeighboursDialog.cpp
@@ -29,6 +30,7 @@ set ( MOC_FILES inc/MantidQtCustomDialogs/CatalogPublishDialog.h
                 inc/MantidQtCustomDialogs/LoadRawDialog.h
                 inc/MantidQtCustomDialogs/LOQScriptInputDialog.h
                 inc/MantidQtCustomDialogs/MantidGLWidget.h
+                inc/MantidQtCustomDialogs/GetNegMuMuonicXRDDialog.h
                 inc/MantidQtCustomDialogs/PlotAsymmetryByLogValueDialog.h
                 inc/MantidQtCustomDialogs/SampleShapeHelpers.h
                 inc/MantidQtCustomDialogs/SmoothNeighboursDialog.h
diff --git a/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/GetNegMuMuonicXRDDialog.h b/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/GetNegMuMuonicXRDDialog.h
new file mode 100644
index 0000000000000000000000000000000000000000..78a78c6a39ee72ff0da9761b5d7377e203303662
--- /dev/null
+++ b/Code/Mantid/MantidQt/CustomDialogs/inc/MantidQtCustomDialogs/GetNegMuMuonicXRDDialog.h
@@ -0,0 +1,73 @@
+#ifndef MANTIDQT_CUSTOM_DIALOGS_GETNEGMUMUONICXRD_H_
+#define MANTIDQT_CUSTOM_DIALOGS_GETNEGMUMUONICXRD_H_
+
+#include "MantidQtAPI/AlgorithmDialog.h"
+#include "MantidQtMantidWidgets/PeriodicTableWidget.h"
+
+namespace MantidQt {
+
+namespace CustomDialogs {
+/**
+  This class gives a specialised dialog for the GetNegMuMuonicXRD algorithm
+  @author Matt King, ISIS Rutherford Appleton Laboratory
+  @date 11/08/2015
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  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 GetNegMuMuonicXRDDialog : public API::AlgorithmDialog {
+  Q_OBJECT
+
+  public:
+  /// Constructor
+  GetNegMuMuonicXRDDialog(QWidget *parent = 0);
+
+  private:
+  /// Periodic Table widget used for selection of elements property
+  PeriodicTableWidget *periodicTable;
+  /// QLineEdit used for input of y-position property
+  QLineEdit *yPosition;
+
+  //Check box for showing or hiding the Legend for PeriodicTableWidget
+  QCheckBox *showLegendCheck;
+  /// Validate that the input is not empty before running algorithm
+  bool validateDialogInput(QString input);
+  /** Enables a the buttons corresponding to the elements
+      for which data exists in GetNegMuMuonicXRD.py
+  */
+  void enableElementsForGetNegMuMuonicXRD();
+
+  private slots:
+  /// When the "Run" button is clicked, the algorithm is executed with inputs
+  void runClicked();
+  void showLegend();
+
+  protected:
+  // create the initial layout
+  void initLayout();
+
+  signals:
+  /// signal emitted when validateDialogInput passes
+  void validInput();
+};
+}
+}
+#endif // !MANTIDQT_CUSTOM_DIALOGS_GETNEGMUMUONICXRD_H_
diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/GetNegMuMuonicXRDDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/GetNegMuMuonicXRDDialog.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a0ab3fc2d8041a09f817dbcab3c52ea9ca1050cd
--- /dev/null
+++ b/Code/Mantid/MantidQt/CustomDialogs/src/GetNegMuMuonicXRDDialog.cpp
@@ -0,0 +1,150 @@
+#include "MantidQtCustomDialogs/GetNegMuMuonicXRDDialog.h"
+#include "MantidQtAPI/AlgorithmInputHistory.h"
+#include "MantidQtCustomDialogs/MantidGLWidget.h"
+#include <QCheckBox>
+#include <QMessageBox>
+#include <QLineEdit>
+#include <QValidator>
+#include <QFormLayout>
+
+
+namespace MantidQt {
+namespace CustomDialogs {
+DECLARE_DIALOG(GetNegMuMuonicXRDDialog)
+
+/**
+ * Default constructor.
+ * @param parent :: Parent dialog.
+ */
+
+GetNegMuMuonicXRDDialog::GetNegMuMuonicXRDDialog(QWidget *parent)
+    : API::AlgorithmDialog(parent) {}
+
+/// Initialise the layout
+void GetNegMuMuonicXRDDialog::initLayout() {
+  this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+  this->setMaximumHeight(400);
+  this->setMaximumWidth(675);
+  // assign periodicTable member to a new periodicTable
+  periodicTable = new PeriodicTableWidget();
+
+  // assign yPosition member to a new QLineEdit
+  yPosition = new QLineEdit();
+
+  // Disable all buttons on the periodicTable
+  // as we only have a select few that need to be
+  // enabled.
+  periodicTable->disableAllElementButtons();
+
+  /*Elements Enabled Correspond to those for which we
+  * have data for in the dictionary found in
+  * GetNegMuMuonicXRD.py file
+  */
+  enableElementsForGetNegMuMuonicXRD();
+
+  // main layout for the dialog (everything will be added to this)
+  auto *main_layout = new QVBoxLayout(this);
+
+  // run button for executing the algorithm
+  auto *runButton = new QPushButton("Run");
+
+  // label for the QLineEdit for yPosition property
+  auto *yPositionLabel = new QLabel("Y Position");
+
+  /*validator allows only numeric input for yPosition
+   *this helps with validating the input.
+   *Does not detect empty string as invalid input.
+   */
+  auto yPositionNumericValidator = new QDoubleValidator();
+
+  // YPosition LineEdit Attributes
+  yPosition->setMaximumWidth(250);
+  yPosition->setPlaceholderText("-0.01");
+  yPosition->setValidator(yPositionNumericValidator);
+
+  // Run Button Attributes and signal/slot assignment
+  runButton->setMaximumWidth(100);
+  connect(runButton, SIGNAL(clicked()), this, SLOT(runClicked()));
+  connect(this, SIGNAL(validInput()), this, SLOT(accept()));
+
+  //Show Legend button attributes and signal/slot asssignment
+  showLegendCheck = new QCheckBox("Show Legend");
+  connect(showLegendCheck, SIGNAL(clicked()), this, SLOT(showLegend()));
+  // Adding Widgets to Layout
+  main_layout->addWidget(periodicTable);
+  main_layout->addWidget(showLegendCheck);
+  main_layout->addWidget(yPositionLabel);
+  main_layout->addWidget(yPosition);
+  main_layout->addWidget(runButton);
+}
+
+/**
+ *
+ */
+void GetNegMuMuonicXRDDialog::showLegend(){
+    bool checked = showLegendCheck->isChecked();
+    periodicTable->showGroupLegend(checked);
+}
+
+/**
+ * Enables the buttons for which we have data for in the GetNegMuMuonicXRD.py
+ * dictionary of elements, by Periodic Table symbol.
+ * i.e Au corresponds to Gold.
+ */
+void GetNegMuMuonicXRDDialog::enableElementsForGetNegMuMuonicXRD() {
+  /* The GetNegMuMuonic algorithm only has data for these elements
+   * The dictionary of elements and data can edited in the python file
+   * for the algorithm, and the button for that element can be enabled
+   * the same as the elements are below.
+   */
+  periodicTable->enableButtonByName("Au");
+  periodicTable->enableButtonByName("Ag");
+  periodicTable->enableButtonByName("Cu");
+  periodicTable->enableButtonByName("Zn");
+  periodicTable->enableButtonByName("Pb");
+  periodicTable->enableButtonByName("As");
+  periodicTable->enableButtonByName("Sn");
+}
+
+/**
+ * Used for checking if the input is none empty for Y-Position Property
+ * and if any elements have been selected from the periodicTableWidget
+ * @param input :: A QString that is checked to see if it is empty.
+*/
+
+bool GetNegMuMuonicXRDDialog::validateDialogInput(QString input) {
+  // empty check on input
+  return (input != "");
+}
+
+/**
+ * The Slot to gather input from the dialog, store it in the propertyValue
+ * and then emit the signal for valid input. Preparing for accept() to be run.
+*/
+void GetNegMuMuonicXRDDialog::runClicked() {
+  // getting a list of strings of elements selected from periodicTableWidget
+  QString elementsSelectedStr = periodicTable->getAllCheckedElementsStr();
+  // if no elements are selected from the PeriodicTableWidget, a pop-up appears
+  // to the user.
+  if (!validateDialogInput(elementsSelectedStr)) {
+    QMessageBox::information(
+        this, "GetNegMuMuonicXRDDialog",
+        "No elements were selected, Please select an element from the table");
+  }
+  // If elements have been selected and y-position text is non-empty then
+  // store the inputs as the corresponding propertyValues and emit validInput
+  // signal.
+  if (validateDialogInput(elementsSelectedStr)) {
+    storePropertyValue("Elements", elementsSelectedStr);
+    if (validateDialogInput(yPosition->text())) {
+      storePropertyValue("YAxisPosition", yPosition->text());
+    } else {
+      // used as default value for yPosition property if the user does not input
+      // one.
+      storePropertyValue("YAxisPosition", yPosition->placeholderText());
+    }
+    emit validInput();
+  }
+}
+}
+}
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectMolDyn.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectMolDyn.h
index 48170c378f4890e3a409b650fc770907940d9b6b..cfa46a3fa7d07897e6eca319b039910ba77a8266 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectMolDyn.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectMolDyn.h
@@ -4,31 +4,30 @@
 #include "ui_IndirectMolDyn.h"
 #include "IndirectSimulationTab.h"
 
-namespace MantidQt
-{
-	namespace CustomInterfaces
-	{
-		class DLLExport IndirectMolDyn : public IndirectSimulationTab
-		{
-			Q_OBJECT
-
-		public:
-			IndirectMolDyn(QWidget * parent = 0);
-
-			// Inherited methods from IndirectTab
-      void setup();
-			bool validate();
-			void run();
-
-			/// Load default settings into the interface
-			void loadSettings(const QSettings& settings);
-
-		private:
-			//The ui form
-			Ui::IndirectMolDyn m_uiForm;
-
-		};
-	} // namespace CustomInterfaces
+namespace MantidQt {
+namespace CustomInterfaces {
+class DLLExport IndirectMolDyn : public IndirectSimulationTab {
+  Q_OBJECT
+
+public:
+  IndirectMolDyn(QWidget *parent = 0);
+
+  // Inherited methods from IndirectTab
+  void setup();
+  bool validate();
+  void run();
+
+  /// Load default settings into the interface
+  void loadSettings(const QSettings &settings);
+
+private slots:
+  void versionSelected(const QString &);
+
+private:
+  // The ui form
+  Ui::IndirectMolDyn m_uiForm;
+};
+} // namespace CustomInterfaces
 } // namespace MantidQt
 
 #endif
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectMolDyn.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectMolDyn.ui
index 313123a202b5e665aefbe69263caffc156151ca4..a8b3a59df7001c47bc3afb1507b729066d84d3d3 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectMolDyn.ui
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Indirect/IndirectMolDyn.ui
@@ -20,14 +20,14 @@
       <string>nMOLDYN</string>
      </property>
      <layout class="QGridLayout" name="gridLayout_2">
-      <item row="0" column="0">
+      <item row="1" column="0">
        <widget class="QLabel" name="lblSample">
         <property name="text">
-         <string>Sample Run:</string>
+         <string>Data:</string>
         </property>
        </widget>
       </item>
-      <item row="0" column="1">
+      <item row="1" column="1">
        <widget class="MantidQt::MantidWidgets::MWRunFiles" name="mwRun" native="true">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -49,7 +49,7 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="0">
+      <item row="2" column="0">
        <widget class="QLabel" name="lblFunctionNames">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -62,13 +62,51 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="1">
+      <item row="2" column="1">
        <widget class="QLineEdit" name="leFunctionNames">
         <property name="toolTip">
          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Comma separated list of functions to load from the input file.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>
        </widget>
       </item>
+      <item row="0" column="0">
+       <widget class="QLabel" name="lbVersion">
+        <property name="text">
+         <string>Version:</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <layout class="QHBoxLayout" name="loVersion">
+        <item>
+         <widget class="QComboBox" name="cbVersion">
+          <item>
+           <property name="text">
+            <string>3</string>
+           </property>
+          </item>
+          <item>
+           <property name="text">
+            <string>4</string>
+           </property>
+          </item>
+         </widget>
+        </item>
+        <item>
+         <spacer name="spVersionCombo">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
      </layout>
     </widget>
    </item>
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.ui
index 6ce415d2101763d593d303af478182841bfd944e..235c956d7d53a9dbf11ed18ec3b2f566a2e619ea 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.ui
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/SANSRunWindow.ui
@@ -4111,7 +4111,7 @@ p, li { white-space: pre-wrap; }
          </widget>
         </item>
         <item row="12" column="2">
-         <layout class="QHBoxLayout" name="horizontalLayout_24">
+         <layout class="QHBoxLayout" name="horizontalLayout_241">
           <item>
            <widget class="QLabel" name="binning_label">
             <property name="minimumSize">
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/UserInputValidator.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/UserInputValidator.h
index 8af0cac0c12fd3ab881f32b17dbdfde7cfad8000..a069c28acb4d0577b0f63b1817b34ea803f2736e 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/UserInputValidator.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/UserInputValidator.h
@@ -14,82 +14,90 @@ class QLabel;
 class QString;
 class QStringList;
 
-namespace MantidQt
-{
-  namespace CustomInterfaces
-  {
-    /**
-     * (Currently used in C2E-Indirect and IDA.)
-     *
-     * A class to try and get rid of some of the boiler-plate code surrounding input validation,
-     * and hopefully as a result make it more readable.
-     *
-     * It has as its state a QStringList, which are the accumulated error messages after multiple
-     * calls to its "check[...]" member-functions.
-     *
-     * Copyright &copy; 2007-8 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source
-     *
-     * 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 UserInputValidator
-    {
-    public:
-      /// Default Constructor.
-      UserInputValidator();
+namespace MantidQt {
+namespace CustomInterfaces {
+/**
+ * A class to try and get rid of some of the boiler-plate code surrounding input
+ * validation, and hopefully as a result make it more readable.
+ *
+ * It has as its state a QStringList, which are the accumulated error messages
+ * after multiple calls to its "check[...]" member-functions.
+ *
+ * Copyright &copy; 2007-8 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+ * National Laboratory & European Spallation Source
+ *
+ * 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 UserInputValidator {
+public:
+  /// Default Constructor.
+  UserInputValidator();
 
-      /// Check that the given QLineEdit field is not empty.
-      bool checkFieldIsNotEmpty(const QString & name, QLineEdit * field, QLabel * errorLabel = NULL);
-      /// Check that the given QLineEdit field is valid as per any validators it might have.
-      bool checkFieldIsValid(const QString & errorMessage, QLineEdit * field, QLabel * errorLabel = NULL);
-      /// Check that the given WorkspaceSelector is not empty.
-      bool checkWorkspaceSelectorIsNotEmpty(const QString & name, WorkspaceSelector * workspaceSelector);
-      /// Check that the given MWRunFiles widget has valid files.
-      bool checkMWRunFilesIsValid(const QString & name, MWRunFiles * widget);
-      /// Check that the given DataSelector widget has valid input.
-      bool checkDataSelectorIsValid(const QString & name, DataSelector * widget);
-      /// Check that the given start and end range is valid.
-      bool checkValidRange(const QString & name, std::pair<double, double> range);
-      /// Check that the given ranges dont overlap.
-      bool checkRangesDontOverlap(std::pair<double, double> rangeA, std::pair<double, double> rangeB);
-      /// Check that the given "outer" range completely encloses the given "inner" range.
-      bool checkRangeIsEnclosed(const QString & outerName, std::pair<double, double> outer, const QString & innerName, std::pair<double, double> inner);
-      /// Check that the given range can be split evenly into bins of the given width.
-      bool checkBins(double lower, double binWidth, double upper, double tolerance = 0.00000001);
-      /// Checks two values are not equal
-      bool checkNotEqual(const QString & name, double x, double y = 0.0, double tolerance = 0.00000001);
-      /// Add a custom error message to the list.
-      void addErrorMessage(const QString & message);
+  /// Check that the given QLineEdit field is not empty.
+  bool checkFieldIsNotEmpty(const QString &name, QLineEdit *field,
+                            QLabel *errorLabel = NULL);
+  /// Check that the given QLineEdit field is valid as per any validators it
+  /// might have.
+  bool checkFieldIsValid(const QString &errorMessage, QLineEdit *field,
+                         QLabel *errorLabel = NULL);
+  /// Check that the given WorkspaceSelector is not empty.
+  bool checkWorkspaceSelectorIsNotEmpty(const QString &name,
+                                        WorkspaceSelector *workspaceSelector);
+  /// Check that the given MWRunFiles widget has valid files.
+  bool checkMWRunFilesIsValid(const QString &name, MWRunFiles *widget);
+  /// Check that the given DataSelector widget has valid input.
+  bool checkDataSelectorIsValid(const QString &name, DataSelector *widget);
+  /// Check that the given start and end range is valid.
+  bool checkValidRange(const QString &name, std::pair<double, double> range);
+  /// Check that the given ranges dont overlap.
+  bool checkRangesDontOverlap(std::pair<double, double> rangeA,
+                              std::pair<double, double> rangeB);
+  /// Check that the given "outer" range completely encloses the given "inner"
+  /// range.
+  bool checkRangeIsEnclosed(const QString &outerName,
+                            std::pair<double, double> outer,
+                            const QString &innerName,
+                            std::pair<double, double> inner);
+  /// Check that the given range can be split evenly into bins of the given
+  /// width.
+  bool checkBins(double lower, double binWidth, double upper,
+                 double tolerance = 0.00000001);
+  /// Checks two values are not equal
+  bool checkNotEqual(const QString &name, double x, double y = 0.0,
+                     double tolerance = 0.00000001);
+  /// Add a custom error message to the list.
+  void addErrorMessage(const QString &message);
 
-      /// Sets a validation label
-      void setErrorLabel(QLabel * errorLabel, bool valid);
+  /// Sets a validation label
+  void setErrorLabel(QLabel *errorLabel, bool valid);
 
-      /// Returns an error message which contains all the error messages raised by the check functions.
-      QString generateErrorMessage();
-      /// Checks to see if all input is valid
-      bool isAllInputValid();
+  /// Returns an error message which contains all the error messages raised by
+  /// the check functions.
+  QString generateErrorMessage();
+  /// Checks to see if all input is valid
+  bool isAllInputValid();
 
-    private:
-      /// Any raised error messages.
-      QStringList m_errorMessages;
-
-    };
-  }
+private:
+  /// Any raised error messages.
+  QStringList m_errorMessages;
+};
+}
 }
 
 #endif // MANTID_CUSTOMINTERFACES_USERINPUTVALIDATOR_H_
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectMolDyn.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectMolDyn.cpp
index 37c8e024a0710dfeca4ea5096dc5ab79e86ce746..18da01bc0267cc57c17276ecdc4248d99ca9cb46 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectMolDyn.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectMolDyn.cpp
@@ -1,106 +1,120 @@
 #include "MantidQtCustomInterfaces/Indirect/IndirectMolDyn.h"
 
+#include "MantidQtCustomInterfaces/UserInputValidator.h"
+
 #include <QFileInfo>
 #include <QString>
 
 using namespace Mantid::API;
 
-namespace MantidQt
-{
-  namespace CustomInterfaces
-  {
-    IndirectMolDyn::IndirectMolDyn(QWidget * parent) :
-      IndirectSimulationTab(parent)
-    {
-      m_uiForm.setupUi(parent);
-
-      connect(m_uiForm.ckCropEnergy, SIGNAL(toggled(bool)), m_uiForm.dspMaxEnergy, SLOT(setEnabled(bool)));
-      connect(m_uiForm.ckResolution, SIGNAL(toggled(bool)), m_uiForm.dsResolution, SLOT(setEnabled(bool)));
-    }
-
-    void IndirectMolDyn::setup()
-    {
-    }
-
-    /**
-     * Validate the form to check the program can be run
-     *
-     * @return :: Whether the form was valid
-     */
-    bool IndirectMolDyn::validate()
-    {
-      QString filename = m_uiForm.mwRun->getFirstFilename();
-      QFileInfo finfo(filename);
-      QString ext = finfo.extension().toLower();
-
-      if(ext != "dat" && ext != "cdl")
-      {
-        emit showMessageBox("File is not of expected type.\n File type must be .dat or .cdl");
-        return false;
-      }
+namespace MantidQt {
+namespace CustomInterfaces {
+IndirectMolDyn::IndirectMolDyn(QWidget *parent)
+    : IndirectSimulationTab(parent) {
+  m_uiForm.setupUi(parent);
+
+  connect(m_uiForm.ckCropEnergy, SIGNAL(toggled(bool)), m_uiForm.dspMaxEnergy,
+          SLOT(setEnabled(bool)));
+  connect(m_uiForm.ckResolution, SIGNAL(toggled(bool)), m_uiForm.dsResolution,
+          SLOT(setEnabled(bool)));
+  connect(m_uiForm.cbVersion, SIGNAL(currentIndexChanged(const QString &)),
+          this, SLOT(versionSelected(const QString &)));
+}
+
+void IndirectMolDyn::setup() {}
+
+/**
+ * Validate the form to check the program can be run
+ *
+ * @return :: Whether the form was valid
+ */
+bool IndirectMolDyn::validate() {
+  UserInputValidator uiv;
+
+  if (uiv.checkMWRunFilesIsValid("Data", m_uiForm.mwRun)) {
+    QString filename = m_uiForm.mwRun->getFirstFilename();
+    QString version = m_uiForm.cbVersion->currentText();
+    QFileInfo finfo(filename);
+    QString ext = finfo.extension().toLower();
+
+    if (version == "3") {
+      if (ext != "dat" && ext != "cdl")
+        uiv.addErrorMessage(
+            "File is not of expected type.\n File type must be .dat or .cdl");
 
       QString functions = m_uiForm.leFunctionNames->text();
-      if(ext == "cdl" && functions.isEmpty())
-      {
-        emit showMessageBox("Must specify at least one function when loading CDL file.");
-        return false;
-      }
-
-      if(m_uiForm.ckResolution->isChecked() && !m_uiForm.dsResolution->isValid())
-      {
-        emit showMessageBox("Invalid resolution file.");
-        return false;
-      }
-
-      if(m_uiForm.ckResolution->isChecked() && !m_uiForm.ckSymmetrise->isChecked())
-      {
-        emit showMessageBox("Must symmetrise when convolving with resolution.");
-        return false;
-      }
-
-      return true;
+      if (ext == "cdl" && functions.isEmpty())
+        uiv.addErrorMessage(
+            "Must specify at least one function when loading CDL file.");
     }
-
-    /**
-     * Collect the settings on the GUI and run the MolDyn algorithm.
-     */
-    void IndirectMolDyn::run()
-    {
-      // Get filename and base filename (for naming output workspace group)
-      QString filename = m_uiForm.mwRun->getFirstFilename();
-      QFileInfo fi(filename);
-      QString baseName = fi.baseName();
-
-      // Setup algorithm
-      IAlgorithm_sptr molDynAlg = AlgorithmManager::Instance().create("MolDyn");
-      molDynAlg->setProperty("Filename", filename.toStdString());
-      molDynAlg->setProperty("Functions", m_uiForm.leFunctionNames->text().toStdString());
-      molDynAlg->setProperty("SymmetriseEnergy", m_uiForm.ckSymmetrise->isChecked());
-      molDynAlg->setProperty("Save", m_uiForm.ckSave->isChecked());
-      molDynAlg->setProperty("Plot", m_uiForm.cbPlot->currentText().toStdString());
-      molDynAlg->setProperty("OutputWorkspace", baseName.toStdString());
-
-      // Set energy crop option
-      if(m_uiForm.ckCropEnergy->isChecked())
-        molDynAlg->setProperty("MaxEnergy", QString::number(m_uiForm.dspMaxEnergy->value()).toStdString());
-
-      // Set instrument resolution option
-      if(m_uiForm.ckResolution->isChecked())
-        molDynAlg->setProperty("Resolution", m_uiForm.dsResolution->getCurrentDataName().toStdString());
-
-      runAlgorithm(molDynAlg);
-    }
-
-    /**
-     * Set the data selectors to use the default save directory
-     * when browsing for input files.
-     *
-     * @param settings :: The settings to loading into the interface
-     */
-    void IndirectMolDyn::loadSettings(const QSettings& settings)
-    {
-      m_uiForm.mwRun->readSettings(settings.group());
-    }
-
-  } // namespace CustomInterfaces
+  }
+
+  // Validate resolution
+  if (m_uiForm.ckResolution->isChecked())
+    uiv.checkDataSelectorIsValid("Resolution", m_uiForm.dsResolution);
+
+  // Validate symmetrise on when resolution is convolved
+  if (m_uiForm.ckResolution->isChecked() && !m_uiForm.ckSymmetrise->isChecked())
+    uiv.addErrorMessage("Must symmetrise when convolving with resolution.");
+
+  emit showMessageBox(uiv.generateErrorMessage());
+  return uiv.isAllInputValid();
+}
+
+/**
+ * Collect the settings on the GUI and run the MolDyn algorithm.
+ */
+void IndirectMolDyn::run() {
+  // Get filename and base filename (for naming output workspace group)
+  QString filename = m_uiForm.mwRun->getFirstFilename();
+  QFileInfo fi(filename);
+  QString baseName = fi.baseName();
+
+  // Setup algorithm
+  IAlgorithm_sptr molDynAlg = AlgorithmManager::Instance().create("MolDyn");
+  molDynAlg->setProperty("Data", filename.toStdString());
+  molDynAlg->setProperty("Functions",
+                         m_uiForm.leFunctionNames->text().toStdString());
+  molDynAlg->setProperty("SymmetriseEnergy",
+                         m_uiForm.ckSymmetrise->isChecked());
+  molDynAlg->setProperty("Save", m_uiForm.ckSave->isChecked());
+  molDynAlg->setProperty("Plot", m_uiForm.cbPlot->currentText().toStdString());
+  molDynAlg->setProperty("OutputWorkspace", baseName.toStdString());
+
+  // Set energy crop option
+  if (m_uiForm.ckCropEnergy->isChecked())
+    molDynAlg->setProperty(
+        "MaxEnergy",
+        QString::number(m_uiForm.dspMaxEnergy->value()).toStdString());
+
+  // Set instrument resolution option
+  if (m_uiForm.ckResolution->isChecked())
+    molDynAlg->setProperty(
+        "Resolution",
+        m_uiForm.dsResolution->getCurrentDataName().toStdString());
+
+  runAlgorithm(molDynAlg);
+}
+
+/**
+ * Set the data selectors to use the default save directory
+ * when browsing for input files.
+ *
+ * @param settings :: The settings to loading into the interface
+ */
+void IndirectMolDyn::loadSettings(const QSettings &settings) {
+  m_uiForm.mwRun->readSettings(settings.group());
+}
+
+/**
+ * Handles the version of nMoldyn being selected.
+ *
+ * @param version The version as a string ("3" or "4")
+ */
+void IndirectMolDyn::versionSelected(const QString &version) {
+  bool version4(version == "4");
+  m_uiForm.mwRun->isForDirectory(version4);
+}
+
+} // namespace CustomInterfaces
 } // namespace MantidQt
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/UserInputValidator.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/UserInputValidator.cpp
index 649917e064f750e568028e46548f5efaacec6ac8..131691de008b6859d0644d39ddee3615974f9e58 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/src/UserInputValidator.cpp
+++ b/Code/Mantid/MantidQt/CustomInterfaces/src/UserInputValidator.cpp
@@ -11,336 +11,319 @@ using namespace MantidQt::MantidWidgets;
 
 namespace // anonymous
 {
-  template <typename T>
-  void sortPair(std::pair<T, T> & pair)
-  {
-    if( pair.first > pair.second )
-    {
-      T temp = pair.first;
-      pair.first = pair.second;
-      pair.second = temp;
-    }
+template <typename T> void sortPair(std::pair<T, T> &pair) {
+  if (pair.first > pair.second) {
+    T temp = pair.first;
+    pair.first = pair.second;
+    pair.second = temp;
   }
+}
 } // anonymous namespace
 
-namespace MantidQt
-{
-  namespace CustomInterfaces
-  {
-    UserInputValidator::UserInputValidator() : m_errorMessages()
-    {
-    }
-
-    /**
-     * Check that a given QLineEdit field (with given name) is not empty.  If it is empty
-     * then the given QLabel will be set to "*" and an error will be added to m_errorMessages.
-     * Else set the label to "".
-     *
-     * @param name       :: name of the field, so as to be recognised by the user
-     * @param field      :: the field object to be checked
-     * @param errorLabel :: the "*" or "" label.
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkFieldIsNotEmpty(const QString & name, QLineEdit * field, QLabel * errorLabel)
-    {
-      if(field->text() == "")
-      {
-        setErrorLabel(errorLabel, false);
-        m_errorMessages.append(name + " has been left blank.");
-        return false;
-      }
-      else
-      {
-        setErrorLabel(errorLabel, true);
-        return true;
-      }
-    }
-
-    /**
-     * Check that the given QLineEdit field is valid as per any validators it might have.
-     *
-     * @param field        :: the field to be checked
-     * @param errorLabel   :: the "" or "*" label
-     * @param errorMessage :: the message to log if invalid
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkFieldIsValid(const QString & errorMessage, QLineEdit * field, QLabel * errorLabel)
-    {
-      int dummyPos = 0;
-      QString text = field->text();
-      QValidator::State fieldState = field->validator()->validate(text, dummyPos);
-
-      if( fieldState == QValidator::Acceptable )
-      {
-        setErrorLabel(errorLabel, true);
-        return true;
-      }
-      else
-      {
-        setErrorLabel(errorLabel, false);
-        m_errorMessages.append(errorMessage);
-        return false;
-      }
-    }
-
-    /**
-     * Check that the given WorkspaceSelector is not empty.  Appends a message to m_errorMessages if so.
-     *
-     * @param name              :: the "name" of the workspace selector, so as to be recognised by the user
-     * @param workspaceSelector :: the workspace selector to check
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkWorkspaceSelectorIsNotEmpty(const QString & name, WorkspaceSelector * workspaceSelector)
-    {
-      if( workspaceSelector->currentText() == "" )
-      {
-        m_errorMessages.append("No " + name + " workspace has been selected.");
-        return false;
-      }
-
-      return true;
-    }
-
-    /**
-     * Check that the given MWRunFiles widget has valid files.
-     *
-     * @param name   :: the "name" of the widget so as to be recognised by the user.
-     * @param widget :: the widget to check
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkMWRunFilesIsValid(const QString & name, MWRunFiles * widget)
-    {
-      if( ! widget->isValid() )
-      {
-        m_errorMessages.append(name + " file error: " + widget->getFileProblem());
-        return false;
-      }
-
-      return true;
-    }
-
-    /**
-     * Check that the given DataSelector widget has valid files.
-     *
-     * @param name   :: the "name" of the widget so as to be recognised by the user.
-     * @param widget :: the widget to check
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkDataSelectorIsValid(const QString & name, DataSelector * widget)
-    {
-      if( ! widget->isValid() )
-      {
-        m_errorMessages.append(name + " error: " + widget->getProblem());
-        return false;
-      }
-
-      return true;
-    }
-
-    /**
-     * Check that the given start and end range is valid.
-     *
-     * @param name  :: the name of the range
-     * @param range :: the range
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkValidRange(const QString & name, std::pair<double, double> range)
-    {
-      if( range.second == range.first )
-      {
-        m_errorMessages.append(name + " must have a non-zero width.");
-        return false;
-      }
-
-      if( range.second < range.first )
-      {
-        m_errorMessages.append("The start of " + name + " must be less than the end.");
-        return false;
-      }
-
-      return true;
-    }
-
-    /**
-     * Check that the given ranges dont overlap.
-     *
-     * @param rangeA :: the start of the range
-     * @param rangeB :: the end of the range
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkRangesDontOverlap(std::pair<double, double> rangeA, std::pair<double, double> rangeB)
-    {
-      sortPair(rangeA);
-      sortPair(rangeB);
-
-      if( !(rangeA.second < rangeB.first || rangeB.second < rangeA.first) )
-      {
-        QString message = QString("The ranges must not overlap: [%1,%2], [%3,%4].")
-          .arg(rangeA.first).arg(rangeA.second).arg(rangeB.first).arg(rangeB.second);
-        m_errorMessages.append( message );
-        return false;
-      }
-
-      return true;
-    }
-
-    /**
-     * Check that the given "outer" range completely encloses the given "inner" range.
-     *
-     * @param outerName :: the end of the range
-     * @param outer :: pair of range bounds
-     * @param innerName :: the start of the range
-     * @param inner :: pair of range bounds
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkRangeIsEnclosed(const QString & outerName, std::pair<double, double> outer,
-                                                  const QString & innerName, std::pair<double, double> inner)
-    {
-      sortPair(inner);
-      sortPair(outer);
-
-      if( inner.first < outer.first || inner.second > outer.second )
-      {
-        m_errorMessages.append(outerName + " must completely enclose " + innerName + ".");
-        return false;
-      }
-
-      return true;
-    }
-
-    /**
-     * Given a range defined by lower and upper bounds, checks to see if it can be divided evenly into bins
-     * of a given width.  Due to the nature of doubles, we use a tolerance value.
-     *
-     * @param lower     :: the lower bound of the range
-     * @param binWidth  :: the wdith of the bin
-     * @param upper     :: the upper bound of the range
-     * @param tolerance :: the tolerance with which to judge range / bin suitablility
-     * @returns True if the input was valid
-     */
-    bool UserInputValidator::checkBins(double lower, double binWidth, double upper, double tolerance)
-    {
-      double range = upper - lower;
-      if( range < 0 )
-      {
-        m_errorMessages.append("The start of a binning range must be less than the end.");
-        return false;
-      }
-      if( range == 0 )
-      {
-        m_errorMessages.append("Binning ranges must be non-zero.");
-        return false;
-      }
-      if( binWidth == 0 )
-      {
-        m_errorMessages.append("Bin width must be non-zero.");
-        return false;
-      }
-      if( binWidth < 0 )
-      {
-        m_errorMessages.append("Bin width must be a positive value.");
-        return false;
-      }
-
-      while( range > tolerance )
-        range -= binWidth;
-
-      if( std::abs(range) > tolerance )
-      {
-        m_errorMessages.append("Bin width must allow for even splitting of the range.");
-        return false;
-      }
-
-      return true;
-    }
-
-    /**
-     * Checks two values are not equal.
-     *
-     * @param name Name of value
-     * @param x First value
-     * @param y Second value (defaults to zero)
-     * @param tolerance Tolerance to which to compare
-     * @return True if input was valid
-     */
-    bool UserInputValidator::checkNotEqual(const QString & name, double x, double y, double tolerance)
-    {
-      double delta = x - y;
-
-      if(std::abs(delta) <= tolerance)
-      {
-        std::stringstream msg;
-        msg << name.toStdString() << " (" << x << ")"
-            << " should not be equal to " << y << ".";
-        QString msgStr = QString::fromStdString(msg.str());
-        m_errorMessages.append(msgStr);
-        return false;
-      }
-
-      return true;
-    }
-
-    /**
-     * Add a custom error message to the list.
-     *
-     * @param message :: the message to add to the list
-     */
-    void UserInputValidator::addErrorMessage(const QString & message)
-    {
-      m_errorMessages.append(message);
-    }
-
-    /**
-     * Generates and returns an error message which contains all the error messages raised by
-     * the check functions.
-     */
-    QString UserInputValidator::generateErrorMessage()
-    {
-      if( m_errorMessages.isEmpty() )
-        return "";
-
-      return "Please correct the following:\n" + m_errorMessages.join("\n");
-    }
-
-    /**
-     * Checks if the user input checked is valid.
-     *
-     * @return True if all input is valid, false otherwise
-     */
-    bool UserInputValidator::isAllInputValid()
-    {
-      return m_errorMessages.isEmpty();
-    }
-
-    /**
-     * Sets a validation label that is displyed next to the widget on the UI.
-     *
-     * @param errorLabel Label to change
-     * @param valid If the input was valid
-     */
-    void UserInputValidator::setErrorLabel(QLabel * errorLabel, bool valid)
-    {
-      // Do nothing if no error label was provided
-      if(errorLabel == NULL)
-        return;
-
-      if(!valid)
-      {
-        // Set the label to be red
-        QPalette palette = errorLabel->palette();
-        palette.setColor(errorLabel->foregroundRole(), Qt::red);
-        errorLabel->setPalette(palette);
-
-        errorLabel->setText("*");
-      }
-      else
-      {
-        errorLabel->setText("");
-      }
-
-      // Only show the label if input is invalid
-      errorLabel->setVisible(!valid);
-    }
+namespace MantidQt {
+namespace CustomInterfaces {
+UserInputValidator::UserInputValidator() : m_errorMessages() {}
+
+/**
+ * Check that a given QLineEdit field (with given name) is not empty.  If it is
+ * empty then the given QLabel will be set to "*" and an error will be added to
+ * m_errorMessages.
+ * Else set the label to "".
+ *
+ * @param name       :: name of the field, so as to be recognised by the user
+ * @param field      :: the field object to be checked
+ * @param errorLabel :: the "*" or "" label.
+ * @returns True if the input was valid
+ */
+bool UserInputValidator::checkFieldIsNotEmpty(const QString &name,
+                                              QLineEdit *field,
+                                              QLabel *errorLabel) {
+  if (field->text() == "") {
+    setErrorLabel(errorLabel, false);
+    m_errorMessages.append(name + " has been left blank.");
+    return false;
+  } else {
+    setErrorLabel(errorLabel, true);
+    return true;
+  }
+}
+
+/**
+ * Check that the given QLineEdit field is valid as per any validators it might
+ * have.
+ *
+ * @param field        :: the field to be checked
+ * @param errorLabel   :: the "" or "*" label
+ * @param errorMessage :: the message to log if invalid
+ * @returns True if the input was valid
+ */
+bool UserInputValidator::checkFieldIsValid(const QString &errorMessage,
+                                           QLineEdit *field,
+                                           QLabel *errorLabel) {
+  int dummyPos = 0;
+  QString text = field->text();
+  QValidator::State fieldState = field->validator()->validate(text, dummyPos);
+
+  if (fieldState == QValidator::Acceptable) {
+    setErrorLabel(errorLabel, true);
+    return true;
+  } else {
+    setErrorLabel(errorLabel, false);
+    m_errorMessages.append(errorMessage);
+    return false;
+  }
+}
+
+/**
+ * Check that the given WorkspaceSelector is not empty.  Appends a message to
+ * m_errorMessages if so.
+ *
+ * @param name :: the "name" of the workspace selector, so as to be recognised
+ * by the user
+ * @param workspaceSelector :: the workspace selector to check
+ * @returns True if the input was valid
+ */
+bool UserInputValidator::checkWorkspaceSelectorIsNotEmpty(
+    const QString &name, WorkspaceSelector *workspaceSelector) {
+  if (workspaceSelector->currentText() == "") {
+    m_errorMessages.append("No " + name + " workspace has been selected.");
+    return false;
+  }
+
+  return true;
+}
+
+/**
+ * Check that the given MWRunFiles widget has valid files.
+ *
+ * @param name   :: the "name" of the widget so as to be recognised by the user.
+ * @param widget :: the widget to check
+ * @returns True if the input was valid
+ */
+bool UserInputValidator::checkMWRunFilesIsValid(const QString &name,
+                                                MWRunFiles *widget) {
+  if (!widget->isValid()) {
+    m_errorMessages.append(name + " file error: " + widget->getFileProblem());
+    return false;
+  }
+
+  return true;
+}
+
+/**
+ * Check that the given DataSelector widget has valid files.
+ *
+ * @param name   :: the "name" of the widget so as to be recognised by the user.
+ * @param widget :: the widget to check
+ * @returns True if the input was valid
+ */
+bool UserInputValidator::checkDataSelectorIsValid(const QString &name,
+                                                  DataSelector *widget) {
+  if (!widget->isValid()) {
+    m_errorMessages.append(name + " error: " + widget->getProblem());
+    return false;
+  }
+
+  return true;
+}
+
+/**
+ * Check that the given start and end range is valid.
+ *
+ * @param name  :: the name of the range
+ * @param range :: the range
+ * @returns True if the input was valid
+ */
+bool UserInputValidator::checkValidRange(const QString &name,
+                                         std::pair<double, double> range) {
+  if (range.second == range.first) {
+    m_errorMessages.append(name + " must have a non-zero width.");
+    return false;
+  }
 
+  if (range.second < range.first) {
+    m_errorMessages.append("The start of " + name +
+                           " must be less than the end.");
+    return false;
   }
+
+  return true;
+}
+
+/**
+ * Check that the given ranges dont overlap.
+ *
+ * @param rangeA :: the start of the range
+ * @param rangeB :: the end of the range
+ * @returns True if the input was valid
+ */
+bool
+UserInputValidator::checkRangesDontOverlap(std::pair<double, double> rangeA,
+                                           std::pair<double, double> rangeB) {
+  sortPair(rangeA);
+  sortPair(rangeB);
+
+  if (!(rangeA.second < rangeB.first || rangeB.second < rangeA.first)) {
+    QString message = QString("The ranges must not overlap: [%1,%2], [%3,%4].")
+                          .arg(rangeA.first)
+                          .arg(rangeA.second)
+                          .arg(rangeB.first)
+                          .arg(rangeB.second);
+    m_errorMessages.append(message);
+    return false;
+  }
+
+  return true;
+}
+
+/**
+ * Check that the given "outer" range completely encloses the given "inner"
+ *range.
+ *
+ * @param outerName :: the end of the range
+ * @param outer :: pair of range bounds
+ * @param innerName :: the start of the range
+ * @param inner :: pair of range bounds
+ * @returns True if the input was valid
+ */
+bool UserInputValidator::checkRangeIsEnclosed(const QString &outerName,
+                                              std::pair<double, double> outer,
+                                              const QString &innerName,
+                                              std::pair<double, double> inner) {
+  sortPair(inner);
+  sortPair(outer);
+
+  if (inner.first < outer.first || inner.second > outer.second) {
+    m_errorMessages.append(outerName + " must completely enclose " + innerName +
+                           ".");
+    return false;
+  }
+
+  return true;
+}
+
+/**
+ * Given a range defined by lower and upper bounds, checks to see if it can be
+ *divided evenly into bins
+ * of a given width.  Due to the nature of doubles, we use a tolerance value.
+ *
+ * @param lower     :: the lower bound of the range
+ * @param binWidth  :: the wdith of the bin
+ * @param upper     :: the upper bound of the range
+ * @param tolerance :: the tolerance with which to judge range / bin
+ *suitablility
+ * @returns True if the input was valid
+ */
+bool UserInputValidator::checkBins(double lower, double binWidth, double upper,
+                                   double tolerance) {
+  double range = upper - lower;
+  if (range < 0) {
+    m_errorMessages.append(
+        "The start of a binning range must be less than the end.");
+    return false;
+  }
+  if (range == 0) {
+    m_errorMessages.append("Binning ranges must be non-zero.");
+    return false;
+  }
+  if (binWidth == 0) {
+    m_errorMessages.append("Bin width must be non-zero.");
+    return false;
+  }
+  if (binWidth < 0) {
+    m_errorMessages.append("Bin width must be a positive value.");
+    return false;
+  }
+
+  while (range > tolerance)
+    range -= binWidth;
+
+  if (std::abs(range) > tolerance) {
+    m_errorMessages.append(
+        "Bin width must allow for even splitting of the range.");
+    return false;
+  }
+
+  return true;
+}
+
+/**
+ * Checks two values are not equal.
+ *
+ * @param name Name of value
+ * @param x First value
+ * @param y Second value (defaults to zero)
+ * @param tolerance Tolerance to which to compare
+ * @return True if input was valid
+ */
+bool UserInputValidator::checkNotEqual(const QString &name, double x, double y,
+                                       double tolerance) {
+  double delta = x - y;
+
+  if (std::abs(delta) <= tolerance) {
+    std::stringstream msg;
+    msg << name.toStdString() << " (" << x << ")"
+        << " should not be equal to " << y << ".";
+    QString msgStr = QString::fromStdString(msg.str());
+    m_errorMessages.append(msgStr);
+    return false;
+  }
+
+  return true;
+}
+
+/**
+ * Add a custom error message to the list.
+ *
+ * @param message :: the message to add to the list
+ */
+void UserInputValidator::addErrorMessage(const QString &message) {
+  m_errorMessages.append(message);
+}
+
+/**
+ * Generates and returns an error message which contains all the error messages
+ * raised by
+ * the check functions.
+ */
+QString UserInputValidator::generateErrorMessage() {
+  if (m_errorMessages.isEmpty())
+    return "";
+
+  return "Please correct the following:\n" + m_errorMessages.join("\n");
+}
+
+/**
+ * Checks if the user input checked is valid.
+ *
+ * @return True if all input is valid, false otherwise
+ */
+bool UserInputValidator::isAllInputValid() { return m_errorMessages.isEmpty(); }
+
+/**
+ * Sets a validation label that is displyed next to the widget on the UI.
+ *
+ * @param errorLabel Label to change
+ * @param valid If the input was valid
+ */
+void UserInputValidator::setErrorLabel(QLabel *errorLabel, bool valid) {
+  // Do nothing if no error label was provided
+  if (errorLabel == NULL)
+    return;
+
+  if (!valid) {
+    // Set the label to be red
+    QPalette palette = errorLabel->palette();
+    palette.setColor(errorLabel->foregroundRole(), Qt::red);
+    errorLabel->setPalette(palette);
+
+    errorLabel->setText("*");
+  } else {
+    errorLabel->setText("");
+  }
+
+  // Only show the label if input is invalid
+  errorLabel->setVisible(!valid);
+}
+}
 }
diff --git a/Code/Mantid/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h b/Code/Mantid/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h
index cd5fc7c00910286eca66358d239f6608d3c59b26..f487d8eea536c5c69a278d468744f2f2351298bb 100644
--- a/Code/Mantid/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h
+++ b/Code/Mantid/MantidQt/CustomInterfaces/test/ReflMainViewPresenterTest.h
@@ -22,24 +22,21 @@ using namespace testing;
 //=====================================================================================
 // Functional tests
 //=====================================================================================
-class ReflMainViewPresenterTest : public CxxTest::TestSuite
-{
+class ReflMainViewPresenterTest : public CxxTest::TestSuite {
 
 private:
-
-  ITableWorkspace_sptr createWorkspace(const std::string& wsName)
-  {
+  ITableWorkspace_sptr createWorkspace(const std::string &wsName) {
     ITableWorkspace_sptr ws = WorkspaceFactory::Instance().createTable();
 
-    auto colRuns = ws->addColumn("str","Run(s)");
-    auto colTheta = ws->addColumn("str","ThetaIn");
-    auto colTrans = ws->addColumn("str","TransRun(s)");
-    auto colQmin = ws->addColumn("str","Qmin");
-    auto colQmax = ws->addColumn("str","Qmax");
-    auto colDqq = ws->addColumn("str","dq/q");
-    auto colScale = ws->addColumn("double","Scale");
-    auto colStitch = ws->addColumn("int","StitchGroup");
-    auto colOptions = ws->addColumn("str","Options");
+    auto colRuns = ws->addColumn("str", "Run(s)");
+    auto colTheta = ws->addColumn("str", "ThetaIn");
+    auto colTrans = ws->addColumn("str", "TransRun(s)");
+    auto colQmin = ws->addColumn("str", "Qmin");
+    auto colQmax = ws->addColumn("str", "Qmax");
+    auto colDqq = ws->addColumn("str", "dq/q");
+    auto colScale = ws->addColumn("double", "Scale");
+    auto colStitch = ws->addColumn("int", "StitchGroup");
+    auto colOptions = ws->addColumn("str", "Options");
 
     colRuns->setPlotType(0);
     colTheta->setPlotType(0);
@@ -51,15 +48,16 @@ private:
     colStitch->setPlotType(0);
     colOptions->setPlotType(0);
 
-    if(wsName.length() > 0)
+    if (wsName.length() > 0)
       AnalysisDataService::Instance().addOrReplace(wsName, ws);
 
     return ws;
   }
 
-  void createTOFWorkspace(const std::string& wsName, const std::string& runNumber = "")
-  {
-    auto tinyWS = WorkspaceCreationHelper::create2DWorkspaceWithReflectometryInstrument();
+  void createTOFWorkspace(const std::string &wsName,
+                          const std::string &runNumber = "") {
+    auto tinyWS =
+        WorkspaceCreationHelper::create2DWorkspaceWithReflectometryInstrument();
     auto inst = tinyWS->getInstrument();
 
     inst->getParameterMap()->addDouble(inst.get(), "I0MonitorIndex", 1.0);
@@ -68,86 +66,114 @@ private:
     inst->getParameterMap()->addDouble(inst.get(), "LambdaMin", 0.0);
     inst->getParameterMap()->addDouble(inst.get(), "LambdaMax", 10.0);
     inst->getParameterMap()->addDouble(inst.get(), "MonitorBackgroundMin", 0.0);
-    inst->getParameterMap()->addDouble(inst.get(), "MonitorBackgroundMax", 10.0);
+    inst->getParameterMap()->addDouble(inst.get(), "MonitorBackgroundMax",
+                                       10.0);
     inst->getParameterMap()->addDouble(inst.get(), "MonitorIntegralMin", 0.0);
     inst->getParameterMap()->addDouble(inst.get(), "MonitorIntegralMax", 10.0);
 
-    tinyWS->mutableRun().addLogData(new PropertyWithValue<double>("Theta", 0.12345));
-    if(!runNumber.empty())
-      tinyWS->mutableRun().addLogData(new PropertyWithValue<std::string>("run_number", runNumber));
+    tinyWS->mutableRun().addLogData(
+        new PropertyWithValue<double>("Theta", 0.12345));
+    if (!runNumber.empty())
+      tinyWS->mutableRun().addLogData(
+          new PropertyWithValue<std::string>("run_number", runNumber));
 
     AnalysisDataService::Instance().addOrReplace(wsName, tinyWS);
   }
 
-  ITableWorkspace_sptr createPrefilledWorkspace(const std::string& wsName)
-  {
+  ITableWorkspace_sptr createPrefilledWorkspace(const std::string &wsName) {
     auto ws = createWorkspace(wsName);
     TableRow row = ws->appendRow();
-    row << "12345" << "0.5" << "" << "0.1" << "1.6" << "0.04" << 1.0 << 0 << "";
+    row << "12345"
+        << "0.5"
+        << ""
+        << "0.1"
+        << "1.6"
+        << "0.04" << 1.0 << 0 << "";
     row = ws->appendRow();
-    row << "12346" << "1.5" << "" << "1.4" << "2.9" << "0.04" << 1.0 << 0 << "";
+    row << "12346"
+        << "1.5"
+        << ""
+        << "1.4"
+        << "2.9"
+        << "0.04" << 1.0 << 0 << "";
     row = ws->appendRow();
-    row << "24681" << "0.5" << "" << "0.1" << "1.6" << "0.04" << 1.0 << 1 << "";
+    row << "24681"
+        << "0.5"
+        << ""
+        << "0.1"
+        << "1.6"
+        << "0.04" << 1.0 << 1 << "";
     row = ws->appendRow();
-    row << "24682" << "1.5" << "" << "1.4" << "2.9" << "0.04" << 1.0 << 1 << "";
+    row << "24682"
+        << "1.5"
+        << ""
+        << "1.4"
+        << "2.9"
+        << "0.04" << 1.0 << 1 << "";
     return ws;
   }
 
 public:
   // This pair of boilerplate methods prevent the suite being created statically
   // This means the constructor isn't called when running other tests
-  static ReflMainViewPresenterTest *createSuite() { return new ReflMainViewPresenterTest(); }
-  static void destroySuite( ReflMainViewPresenterTest *suite ) { delete suite; }
-  
-  ReflMainViewPresenterTest()
-  {
-    FrameworkManager::Instance();
+  static ReflMainViewPresenterTest *createSuite() {
+    return new ReflMainViewPresenterTest();
   }
+  static void destroySuite(ReflMainViewPresenterTest *suite) { delete suite; }
+
+  ReflMainViewPresenterTest() { FrameworkManager::Instance(); }
 
-  void testSaveNew()
-  {
+  void testSaveNew() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     presenter.notify(IReflPresenter::NewTableFlag);
 
-    EXPECT_CALL(mockView, askUserString(_,_,"Workspace")).Times(1).WillOnce(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, askUserString(_, _, "Workspace"))
+        .Times(1)
+        .WillOnce(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::SaveFlag);
 
     TS_ASSERT(AnalysisDataService::Instance().doesExist("TestWorkspace"));
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testSaveExisting()
-  {
+  void testSaveExisting() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    EXPECT_CALL(mockView, askUserString(_,_,"Workspace")).Times(0);
+    EXPECT_CALL(mockView, askUserString(_, _, "Workspace")).Times(0);
     presenter.notify(IReflPresenter::SaveFlag);
 
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testSaveAs()
-  {
+  void testSaveAs() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    //The user hits "save as" but cancels when choosing a name
-    EXPECT_CALL(mockView, askUserString(_,_,"Workspace")).Times(1).WillOnce(Return(""));
+    // The user hits "save as" but cancels when choosing a name
+    EXPECT_CALL(mockView, askUserString(_, _, "Workspace"))
+        .Times(1)
+        .WillOnce(Return(""));
     presenter.notify(IReflPresenter::SaveAsFlag);
 
-    //The user hits "save as" and and enters "Workspace" for a name
-    EXPECT_CALL(mockView, askUserString(_,_,"Workspace")).Times(1).WillOnce(Return("Workspace"));
+    // The user hits "save as" and and enters "Workspace" for a name
+    EXPECT_CALL(mockView, askUserString(_, _, "Workspace"))
+        .Times(1)
+        .WillOnce(Return("Workspace"));
     presenter.notify(IReflPresenter::SaveAsFlag);
 
     TS_ASSERT(AnalysisDataService::Instance().doesExist("Workspace"));
@@ -156,28 +182,32 @@ public:
     AnalysisDataService::Instance().remove("Workspace");
   }
 
-  void testAppendRow()
-  {
+  void testAppendRow() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "append row" twice with no rows selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(2).WillRepeatedly(Return(std::set<int>()));
+    // The user hits "append row" twice with no rows selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(2)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::AppendRowFlag);
     presenter.notify(IReflPresenter::AppendRowFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //Check that the table has been modified correctly
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    // Check that the table has been modified correctly
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 6);
     TS_ASSERT_EQUALS(ws->String(4, RunCol), "");
     TS_ASSERT_EQUALS(ws->String(5, RunCol), "");
@@ -188,35 +218,39 @@ public:
     TS_ASSERT_EQUALS(ws->Int(4, GroupCol), 2);
     TS_ASSERT_EQUALS(ws->Int(5, GroupCol), 3);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testAppendRowSpecify()
-  {
+  void testAppendRowSpecify() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
     rowlist.insert(1);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "append row" twice, with the second row selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(2).WillRepeatedly(Return(rowlist));
+    // The user hits "append row" twice, with the second row selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(2)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::AppendRowFlag);
     presenter.notify(IReflPresenter::AppendRowFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //Check that the table has been modified correctly
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    // Check that the table has been modified correctly
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 6);
     TS_ASSERT_EQUALS(ws->String(2, RunCol), "");
     TS_ASSERT_EQUALS(ws->String(3, RunCol), "");
@@ -227,35 +261,40 @@ public:
     TS_ASSERT_EQUALS(ws->Int(4, GroupCol), 1);
     TS_ASSERT_EQUALS(ws->Int(5, GroupCol), 1);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testAppendRowSpecifyPlural()
-  {
+  void testAppendRowSpecifyPlural() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
     rowlist.insert(1);
     rowlist.insert(2);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "append row" once, with the second, third, and fourth row selected.
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits "append row" once, with the second, third, and fourth row
+    // selected.
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::AppendRowFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //Check that the table was modified correctly
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    // Check that the table was modified correctly
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 5);
     TS_ASSERT_EQUALS(ws->String(3, RunCol), "");
     TS_ASSERT_EQUALS(ws->Int(0, GroupCol), 0);
@@ -264,32 +303,37 @@ public:
     TS_ASSERT_EQUALS(ws->Int(3, GroupCol), 2);
     TS_ASSERT_EQUALS(ws->Int(4, GroupCol), 1);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testPrependRow()
-  {
+  void testPrependRow() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "prepend row" twice with no rows selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(2).WillRepeatedly(Return(std::set<int>()));
+    // The user hits "prepend row" twice with no rows selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(2)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::PrependRowFlag);
     presenter.notify(IReflPresenter::PrependRowFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //Check that the table has been modified correctly
-    ITableWorkspace_sptr ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    // Check that the table has been modified correctly
+    ITableWorkspace_sptr ws =
+        AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+            "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 6);
     TS_ASSERT_EQUALS(ws->Int(0, GroupCol), 3);
     TS_ASSERT_EQUALS(ws->Int(1, GroupCol), 2);
@@ -298,35 +342,40 @@ public:
     TS_ASSERT_EQUALS(ws->Int(4, GroupCol), 1);
     TS_ASSERT_EQUALS(ws->Int(5, GroupCol), 1);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testPrependRowSpecify()
-  {
+  void testPrependRowSpecify() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
     rowlist.insert(1);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "prepend row" twice, with the second row selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(2).WillRepeatedly(Return(rowlist));
+    // The user hits "prepend row" twice, with the second row selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(2)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::PrependRowFlag);
     presenter.notify(IReflPresenter::PrependRowFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //Check that the table has been modified correctly
-    ITableWorkspace_sptr ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    // Check that the table has been modified correctly
+    ITableWorkspace_sptr ws =
+        AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+            "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 6);
     TS_ASSERT_EQUALS(ws->Int(0, GroupCol), 0);
     TS_ASSERT_EQUALS(ws->Int(1, GroupCol), 3);
@@ -335,17 +384,18 @@ public:
     TS_ASSERT_EQUALS(ws->Int(4, GroupCol), 1);
     TS_ASSERT_EQUALS(ws->Int(5, GroupCol), 1);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testPrependRowSpecifyPlural()
-  {
+  void testPrependRowSpecifyPlural() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -353,18 +403,23 @@ public:
     rowlist.insert(2);
     rowlist.insert(3);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "prepend row" once, with the second, third, and fourth row selected.
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits "prepend row" once, with the second, third, and fourth row
+    // selected.
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::PrependRowFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //Check that the table was modified correctly
-    ITableWorkspace_sptr ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    // Check that the table was modified correctly
+    ITableWorkspace_sptr ws =
+        AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+            "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 5);
     TS_ASSERT_EQUALS(ws->Int(0, GroupCol), 0);
     TS_ASSERT_EQUALS(ws->Int(1, GroupCol), 2);
@@ -372,75 +427,84 @@ public:
     TS_ASSERT_EQUALS(ws->Int(3, GroupCol), 1);
     TS_ASSERT_EQUALS(ws->Int(4, GroupCol), 1);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testDeleteRowNone()
-  {
+  void testDeleteRowNone() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "delete row" with no rows selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(std::set<int>()));
+    // The user hits "delete row" with no rows selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::DeleteRowFlag);
 
-    //The user hits save
+    // The user hits save
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //Check that the table has not lost any rows
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    // Check that the table has not lost any rows
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 4);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testDeleteRowSingle()
-  {
+  void testDeleteRowSingle() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
     rowlist.insert(1);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "delete row" with the second row selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits "delete row" with the second row selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::DeleteRowFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 3);
     TS_ASSERT_EQUALS(ws->String(1, RunCol), "24681");
     TS_ASSERT_EQUALS(ws->Int(1, GroupCol), 1);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testDeleteRowPlural()
-  {
+  void testDeleteRowPlural() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -448,33 +512,37 @@ public:
     rowlist.insert(1);
     rowlist.insert(2);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "delete row" with the first three rows selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits "delete row" with the first three rows selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::DeleteRowFlag);
 
-    //The user hits save
+    // The user hits save
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //Check the rows were deleted as expected
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    // Check the rows were deleted as expected
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 1);
     TS_ASSERT_EQUALS(ws->String(0, RunCol), "24682");
     TS_ASSERT_EQUALS(ws->Int(0, GroupCol), 1);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testProcess()
-  {
+  void testProcess() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -484,14 +552,16 @@ public:
     createTOFWorkspace("TOF_12345", "12345");
     createTOFWorkspace("TOF_12346", "12346");
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits the "process" button with the first two rows selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits the "process" button with the first two rows selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::ProcessFlag);
 
-    //Check output workspaces were created as expected
+    // Check output workspaces were created as expected
     TS_ASSERT(AnalysisDataService::Instance().doesExist("IvsQ_12345"));
     TS_ASSERT(AnalysisDataService::Instance().doesExist("IvsLam_12345"));
     TS_ASSERT(AnalysisDataService::Instance().doesExist("TOF_12345"));
@@ -500,7 +570,7 @@ public:
     TS_ASSERT(AnalysisDataService::Instance().doesExist("TOF_12346"));
     TS_ASSERT(AnalysisDataService::Instance().doesExist("IvsQ_12345_12346"));
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
     AnalysisDataService::Instance().remove("IvsQ_12345");
     AnalysisDataService::Instance().remove("IvsLam_12345");
@@ -515,41 +585,54 @@ public:
    * Test processing workspaces with non-standard names, with
    * and without run_number information in the sample log.
    */
-  void testProcessCustomNames()
-  {
+  void testProcessCustomNames() {
     auto ws = createWorkspace("TestWorkspace");
     TableRow row = ws->appendRow();
-    row << "dataA" << "0.7" << "" << "0.1" << "1.6" << "0.04" << 1.0 << 1;
+    row << "dataA"
+        << "0.7"
+        << ""
+        << "0.1"
+        << "1.6"
+        << "0.04" << 1.0 << 1;
     row = ws->appendRow();
-    row << "dataB" << "2.3" << "" << "1.4" << "2.9" << "0.04" << 1.0 << 1;
+    row << "dataB"
+        << "2.3"
+        << ""
+        << "1.4"
+        << "2.9"
+        << "0.04" << 1.0 << 1;
 
     createTOFWorkspace("dataA");
     createTOFWorkspace("dataB", "12346");
 
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
     rowlist.insert(0);
     rowlist.insert(1);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits the "process" button with the first two rows selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits the "process" button with the first two rows selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::ProcessFlag);
 
-    //Check output workspaces were created as expected
+    // Check output workspaces were created as expected
     TS_ASSERT(AnalysisDataService::Instance().doesExist("IvsQ_dataA"));
     TS_ASSERT(AnalysisDataService::Instance().doesExist("IvsQ_12346"));
     TS_ASSERT(AnalysisDataService::Instance().doesExist("IvsQ_dataA_12346"));
     TS_ASSERT(AnalysisDataService::Instance().doesExist("IvsLam_dataA"));
     TS_ASSERT(AnalysisDataService::Instance().doesExist("IvsLam_12346"));
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
     AnalysisDataService::Instance().remove("dataA");
     AnalysisDataService::Instance().remove("dataB");
@@ -560,71 +643,74 @@ public:
     AnalysisDataService::Instance().remove("IvsQ_dataA_12346");
   }
 
-  void testBadWorkspaceType()
-  {
+  void testBadWorkspaceType() {
     ITableWorkspace_sptr ws = WorkspaceFactory::Instance().createTable();
 
-    //Wrong types
-    ws->addColumn("str","Run(s)");
-    ws->addColumn("str","ThetaIn");
-    ws->addColumn("str","TransRun(s)");
-    ws->addColumn("str","Qmin");
-    ws->addColumn("str","Qmax");
-    ws->addColumn("str","dq/q");
-    ws->addColumn("str","Scale");
-    ws->addColumn("str","StitchGroup");
-    ws->addColumn("str","Options");
+    // Wrong types
+    ws->addColumn("str", "Run(s)");
+    ws->addColumn("str", "ThetaIn");
+    ws->addColumn("str", "TransRun(s)");
+    ws->addColumn("str", "Qmin");
+    ws->addColumn("str", "Qmax");
+    ws->addColumn("str", "dq/q");
+    ws->addColumn("str", "Scale");
+    ws->addColumn("str", "StitchGroup");
+    ws->addColumn("str", "Options");
 
     AnalysisDataService::Instance().addOrReplace("TestWorkspace", ws);
 
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
-    //We should receive an error
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(1);
+    // We should receive an error
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(1);
 
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testBadWorkspaceLength()
-  {
+  void testBadWorkspaceLength() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
-    //Because we to open twice, get an error twice
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(2);
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(2).WillRepeatedly(Return("TestWorkspace"));
+    // Because we to open twice, get an error twice
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(2);
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(2)
+        .WillRepeatedly(Return("TestWorkspace"));
 
     ITableWorkspace_sptr ws = WorkspaceFactory::Instance().createTable();
-    ws->addColumn("str","Run(s)");
-    ws->addColumn("str","ThetaIn");
-    ws->addColumn("str","TransRun(s)");
-    ws->addColumn("str","Qmin");
-    ws->addColumn("str","Qmax");
-    ws->addColumn("str","dq/q");
-    ws->addColumn("double","Scale");
-    ws->addColumn("int","StitchGroup");
+    ws->addColumn("str", "Run(s)");
+    ws->addColumn("str", "ThetaIn");
+    ws->addColumn("str", "TransRun(s)");
+    ws->addColumn("str", "Qmin");
+    ws->addColumn("str", "Qmax");
+    ws->addColumn("str", "dq/q");
+    ws->addColumn("double", "Scale");
+    ws->addColumn("int", "StitchGroup");
     AnalysisDataService::Instance().addOrReplace("TestWorkspace", ws);
 
-    //Try to open with too few columns
+    // Try to open with too few columns
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    ws->addColumn("str","OptionsA");
-    ws->addColumn("str","OptionsB");
+    ws->addColumn("str", "OptionsA");
+    ws->addColumn("str", "OptionsB");
     AnalysisDataService::Instance().addOrReplace("TestWorkspace", ws);
 
-    //Try to open with too many columns
+    // Try to open with too many columns
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testParseKeyValueString()
-  {
-    std::map<std::string,std::string> kvp = ReflMainViewPresenter::parseKeyValueString("a = 1,b=2.0, c=3, d='1,2,3',e=\"4,5,6\",f=1+1=2, g = '\\''");
+  void testParseKeyValueString() {
+    std::map<std::string, std::string> kvp =
+        ReflMainViewPresenter::parseKeyValueString(
+            "a = 1,b=2.0, c=3, d='1,2,3',e=\"4,5,6\",f=1+1=2, g = '\\''");
 
     TS_ASSERT_EQUALS(kvp["a"], "1");
     TS_ASSERT_EQUALS(kvp["b"], "2.0");
@@ -634,148 +720,221 @@ public:
     TS_ASSERT_EQUALS(kvp["f"], "1+1=2");
     TS_ASSERT_EQUALS(kvp["g"], "'");
 
-    TS_ASSERT_THROWS(ReflMainViewPresenter::parseKeyValueString("a = 1, b = 2, c = 3,"), std::runtime_error);
-    TS_ASSERT_THROWS(ReflMainViewPresenter::parseKeyValueString("a = 1, b = 2, c = 3,d"), std::runtime_error);
-    TS_ASSERT_THROWS(ReflMainViewPresenter::parseKeyValueString(",a = 1"), std::runtime_error);
-    TS_ASSERT_THROWS(ReflMainViewPresenter::parseKeyValueString(",a = 1 = 2,="), std::runtime_error);
-    TS_ASSERT_THROWS(ReflMainViewPresenter::parseKeyValueString("=,=,="), std::runtime_error);
+    TS_ASSERT_THROWS(
+        ReflMainViewPresenter::parseKeyValueString("a = 1, b = 2, c = 3,"),
+        std::runtime_error);
+    TS_ASSERT_THROWS(
+        ReflMainViewPresenter::parseKeyValueString("a = 1, b = 2, c = 3,d"),
+        std::runtime_error);
+    TS_ASSERT_THROWS(ReflMainViewPresenter::parseKeyValueString(",a = 1"),
+                     std::runtime_error);
+    TS_ASSERT_THROWS(ReflMainViewPresenter::parseKeyValueString(",a = 1 = 2,="),
+                     std::runtime_error);
+    TS_ASSERT_THROWS(ReflMainViewPresenter::parseKeyValueString("=,=,="),
+                     std::runtime_error);
   }
 
-  void testPromptSaveAfterAppendRow()
-  {
+  void testPromptSaveAfterAppendRow() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
-    //User hits "append row"
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(std::set<int>()));
+    // User hits "append row"
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::AppendRowFlag);
 
-    //The user will decide not to discard their changes
-    EXPECT_CALL(mockView, askUserYesNo(_,_)).Times(1).WillOnce(Return(false));
+    // The user will decide not to discard their changes
+    EXPECT_CALL(mockView, askUserYesNo(_, _)).Times(1).WillOnce(Return(false));
 
-    //Then hits "new table" without having saved
+    // Then hits "new table" without having saved
     presenter.notify(IReflPresenter::NewTableFlag);
 
-    //The user saves
-    EXPECT_CALL(mockView, askUserString(_,_,"Workspace")).Times(1).WillOnce(Return("Workspace"));
+    // The user saves
+    EXPECT_CALL(mockView, askUserString(_, _, "Workspace"))
+        .Times(1)
+        .WillOnce(Return("Workspace"));
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //The user tries to create a new table again, and does not get bothered
-    EXPECT_CALL(mockView, askUserYesNo(_,_)).Times(0);
+    // The user tries to create a new table again, and does not get bothered
+    EXPECT_CALL(mockView, askUserYesNo(_, _)).Times(0);
     presenter.notify(IReflPresenter::NewTableFlag);
   }
 
-  void testPromptSaveAfterDeleteRow()
-  {
+  void testPromptSaveAfterDeleteRow() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
-    //User hits "append row" a couple of times
-    EXPECT_CALL(mockView, getSelectedRows()).Times(2).WillRepeatedly(Return(std::set<int>()));
+    // User hits "append row" a couple of times
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(2)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::AppendRowFlag);
     presenter.notify(IReflPresenter::AppendRowFlag);
 
-    //The user saves
-    EXPECT_CALL(mockView, askUserString(_,_,"Workspace")).Times(1).WillOnce(Return("Workspace"));
+    // The user saves
+    EXPECT_CALL(mockView, askUserString(_, _, "Workspace"))
+        .Times(1)
+        .WillOnce(Return("Workspace"));
     presenter.notify(IReflPresenter::SaveFlag);
 
     //...then deletes the 2nd row
     std::set<int> rows;
     rows.insert(1);
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rows));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rows));
     presenter.notify(IReflPresenter::DeleteRowFlag);
 
-    //The user will decide not to discard their changes when asked
-    EXPECT_CALL(mockView, askUserYesNo(_,_)).Times(1).WillOnce(Return(false));
+    // The user will decide not to discard their changes when asked
+    EXPECT_CALL(mockView, askUserYesNo(_, _)).Times(1).WillOnce(Return(false));
 
-    //Then hits "new table" without having saved
+    // Then hits "new table" without having saved
     presenter.notify(IReflPresenter::NewTableFlag);
 
-    //The user saves
+    // The user saves
     presenter.notify(IReflPresenter::SaveFlag);
 
-    //The user tries to create a new table again, and does not get bothered
-    EXPECT_CALL(mockView, askUserYesNo(_,_)).Times(0);
+    // The user tries to create a new table again, and does not get bothered
+    EXPECT_CALL(mockView, askUserYesNo(_, _)).Times(0);
     presenter.notify(IReflPresenter::NewTableFlag);
   }
 
-  void testPromptSaveAndDiscard()
-  {
+  void testPromptSaveAndDiscard() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
-    //User hits "append row" a couple of times
-    EXPECT_CALL(mockView, getSelectedRows()).Times(2).WillRepeatedly(Return(std::set<int>()));
+    // User hits "append row" a couple of times
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(2)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::AppendRowFlag);
     presenter.notify(IReflPresenter::AppendRowFlag);
 
-    //Then hits "new table", and decides to discard
-    EXPECT_CALL(mockView, askUserYesNo(_,_)).Times(1).WillOnce(Return(true));
+    // Then hits "new table", and decides to discard
+    EXPECT_CALL(mockView, askUserYesNo(_, _)).Times(1).WillOnce(Return(true));
     presenter.notify(IReflPresenter::NewTableFlag);
 
-    //These next two times they don't get prompted - they have a new table
+    // These next two times they don't get prompted - they have a new table
     presenter.notify(IReflPresenter::NewTableFlag);
     presenter.notify(IReflPresenter::NewTableFlag);
   }
 
-  void testPromptSaveOnOpen()
-  {
+  void testPromptSaveOnOpen() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
 
-    //User hits "append row"
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(std::set<int>()));
+    // User hits "append row"
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::AppendRowFlag);
 
-    //and tries to open a workspace, but gets prompted and decides not to discard
-    EXPECT_CALL(mockView, askUserYesNo(_,_)).Times(1).WillOnce(Return(false));
+    // and tries to open a workspace, but gets prompted and decides not to
+    // discard
+    EXPECT_CALL(mockView, askUserYesNo(_, _)).Times(1).WillOnce(Return(false));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    //the user does it again, but discards
-    EXPECT_CALL(mockView, askUserYesNo(_,_)).Times(1).WillOnce(Return(true));
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    // the user does it again, but discards
+    EXPECT_CALL(mockView, askUserYesNo(_, _)).Times(1).WillOnce(Return(true));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    //the user does it one more time, and is not prompted
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
-    EXPECT_CALL(mockView, askUserYesNo(_,_)).Times(0);
+    // the user does it one more time, and is not prompted
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, askUserYesNo(_, _)).Times(0);
     presenter.notify(IReflPresenter::OpenTableFlag);
   }
 
-  void testExpandSelection()
-  {
+  void testExpandSelection() {
     auto ws = createWorkspace("TestWorkspace");
     TableRow row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 0 << ""; //Row 0
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 0 << ""; // Row 0
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 1 << ""; //Row 1
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 1 << ""; // Row 1
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 1 << ""; //Row 2
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 1 << ""; // Row 2
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 2 << ""; //Row 3
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 2 << ""; // Row 3
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 2 << ""; //Row 4
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 2 << ""; // Row 4
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 2 << ""; //Row 5
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 2 << ""; // Row 5
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 3 << ""; //Row 6
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 3 << ""; // Row 6
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 4 << ""; //Row 7
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 4 << ""; // Row 7
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 4 << ""; //Row 8
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 4 << ""; // Row 8
     row = ws->appendRow();
-    row << "" << "" << "" << "" << "" << "" << 1.0 << 5 << ""; //Row 9
+    row << ""
+        << ""
+        << ""
+        << ""
+        << ""
+        << "" << 1.0 << 5 << ""; // Row 9
 
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
     std::set<int> selection;
     std::set<int> expected;
@@ -783,12 +942,14 @@ public:
     selection.insert(0);
     expected.insert(0);
 
-    //With row 0 selected, we shouldn't expand at all
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(selection));
+    // With row 0 selected, we shouldn't expand at all
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(selection));
     EXPECT_CALL(mockView, setSelection(ContainerEq(expected))).Times(1);
     presenter.notify(IReflPresenter::ExpandSelectionFlag);
 
-    //With 0,1 selected, we should finish with 0,1,2 selected
+    // With 0,1 selected, we should finish with 0,1,2 selected
     selection.clear();
     selection.insert(0);
     selection.insert(1);
@@ -798,11 +959,13 @@ public:
     expected.insert(1);
     expected.insert(2);
 
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(selection));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(selection));
     EXPECT_CALL(mockView, setSelection(ContainerEq(expected))).Times(1);
     presenter.notify(IReflPresenter::ExpandSelectionFlag);
 
-    //With 1,6 selected, we should finish with 1,2,6 selected
+    // With 1,6 selected, we should finish with 1,2,6 selected
     selection.clear();
     selection.insert(1);
     selection.insert(6);
@@ -812,11 +975,13 @@ public:
     expected.insert(2);
     expected.insert(6);
 
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(selection));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(selection));
     EXPECT_CALL(mockView, setSelection(ContainerEq(expected))).Times(1);
     presenter.notify(IReflPresenter::ExpandSelectionFlag);
 
-    //With 4,8 selected, we should finish with 3,4,5,7,8 selected
+    // With 4,8 selected, we should finish with 3,4,5,7,8 selected
     selection.clear();
     selection.insert(4);
     selection.insert(8);
@@ -828,58 +993,66 @@ public:
     expected.insert(7);
     expected.insert(8);
 
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(selection));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(selection));
     EXPECT_CALL(mockView, setSelection(ContainerEq(expected))).Times(1);
     presenter.notify(IReflPresenter::ExpandSelectionFlag);
 
-    //With nothing selected, we should finish with nothing selected
+    // With nothing selected, we should finish with nothing selected
     selection.clear();
     expected.clear();
 
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(selection));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(selection));
     EXPECT_CALL(mockView, setSelection(ContainerEq(expected))).Times(1);
     presenter.notify(IReflPresenter::ExpandSelectionFlag);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testClearRows()
-  {
+  void testClearRows() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
     rowlist.insert(1);
     rowlist.insert(2);
 
-    //We should not receive any errors
-    EXPECT_CALL(mockView, giveUserCritical(_,_)).Times(0);
+    // We should not receive any errors
+    EXPECT_CALL(mockView, giveUserCritical(_, _)).Times(0);
 
-    //The user hits "clear selected" with the second and third rows selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits "clear selected" with the second and third rows selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::ClearSelectedFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 4);
-    //Check the unselected rows were unaffected
+    // Check the unselected rows were unaffected
     TS_ASSERT_EQUALS(ws->String(0, RunCol), "12345");
     TS_ASSERT_EQUALS(ws->String(3, RunCol), "24682");
 
-    //Check the group ids have been set correctly
+    // Check the group ids have been set correctly
     TS_ASSERT_EQUALS(ws->Int(0, GroupCol), 0);
     TS_ASSERT_EQUALS(ws->Int(1, GroupCol), 2);
     TS_ASSERT_EQUALS(ws->Int(2, GroupCol), 3);
     TS_ASSERT_EQUALS(ws->Int(3, GroupCol), 1);
 
-    //Make sure the selected rows are clear
+    // Make sure the selected rows are clear
     TS_ASSERT_EQUALS(ws->String(1, RunCol), "");
     TS_ASSERT_EQUALS(ws->String(2, RunCol), "");
     TS_ASSERT_EQUALS(ws->String(1, ThetaCol), "");
@@ -895,17 +1068,18 @@ public:
     TS_ASSERT_EQUALS(ws->Double(1, ScaleCol), 1.0);
     TS_ASSERT_EQUALS(ws->Double(2, ScaleCol), 1.0);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
   }
 
-  void testCopyRow()
-  {
+  void testCopyRow() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -913,19 +1087,22 @@ public:
 
     const std::string expected = "12346\t1.5\t\t1.4\t2.9\t0.04\t1\t0\t";
 
-    //The user hits "copy selected" with the second and third rows selected
+    // The user hits "copy selected" with the second and third rows selected
     EXPECT_CALL(mockView, setClipboard(expected));
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::CopySelectedFlag);
   }
 
-  void testCopyRows()
-  {
+  void testCopyRows() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -939,19 +1116,22 @@ public:
                                  "24681\t0.5\t\t0.1\t1.6\t0.04\t1\t1\t\n"
                                  "24682\t1.5\t\t1.4\t2.9\t0.04\t1\t1\t";
 
-    //The user hits "copy selected" with the second and third rows selected
+    // The user hits "copy selected" with the second and third rows selected
     EXPECT_CALL(mockView, setClipboard(expected));
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::CopySelectedFlag);
   }
 
-  void testCutRow()
-  {
+  void testCutRow() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -959,29 +1139,33 @@ public:
 
     const std::string expected = "12346\t1.5\t\t1.4\t2.9\t0.04\t1\t0\t";
 
-    //The user hits "copy selected" with the second and third rows selected
+    // The user hits "copy selected" with the second and third rows selected
     EXPECT_CALL(mockView, setClipboard(expected));
-    EXPECT_CALL(mockView, getSelectedRows()).Times(2).WillRepeatedly(Return(rowlist));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(2)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::CutSelectedFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 3);
-    //Check the unselected rows were unaffected
+    // Check the unselected rows were unaffected
     TS_ASSERT_EQUALS(ws->String(0, RunCol), "12345");
     TS_ASSERT_EQUALS(ws->String(1, RunCol), "24681");
     TS_ASSERT_EQUALS(ws->String(2, RunCol), "24682");
   }
 
-  void testCutRows()
-  {
+  void testCutRows() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -993,27 +1177,31 @@ public:
                                  "12346\t1.5\t\t1.4\t2.9\t0.04\t1\t0\t\n"
                                  "24681\t0.5\t\t0.1\t1.6\t0.04\t1\t1\t";
 
-    //The user hits "copy selected" with the second and third rows selected
+    // The user hits "copy selected" with the second and third rows selected
     EXPECT_CALL(mockView, setClipboard(expected));
-    EXPECT_CALL(mockView, getSelectedRows()).Times(2).WillRepeatedly(Return(rowlist));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(2)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::CutSelectedFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 1);
-    //Check the only unselected row is left behind
+    // Check the only unselected row is left behind
     TS_ASSERT_EQUALS(ws->String(0, RunCol), "24682");
   }
 
-  void testPasteRow()
-  {
+  void testPasteRow() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -1021,22 +1209,27 @@ public:
 
     const std::string clipboard = "123\t0.5\t456\t1.2\t3.4\t3.14\t5\t6\tabc";
 
-    //The user hits "copy selected" with the second and third rows selected
-    EXPECT_CALL(mockView, getClipboard()).Times(1).WillRepeatedly(Return(clipboard));
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits "copy selected" with the second and third rows selected
+    EXPECT_CALL(mockView, getClipboard())
+        .Times(1)
+        .WillRepeatedly(Return(clipboard));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::PasteSelectedFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 4);
-    //Check the unselected rows were unaffected
+    // Check the unselected rows were unaffected
     TS_ASSERT_EQUALS(ws->String(0, RunCol), "12345");
     TS_ASSERT_EQUALS(ws->String(2, RunCol), "24681");
     TS_ASSERT_EQUALS(ws->String(3, RunCol), "24682");
 
-    //Check the values were pasted correctly
+    // Check the values were pasted correctly
     TS_ASSERT_EQUALS(ws->String(1, RunCol), "123");
     TS_ASSERT_EQUALS(ws->String(1, ThetaCol), "0.5");
     TS_ASSERT_EQUALS(ws->String(1, TransCol), "456");
@@ -1048,34 +1241,40 @@ public:
     TS_ASSERT_EQUALS(ws->String(1, OptionsCol), "abc");
   }
 
-  void testPasteNewRow()
-  {
+  void testPasteNewRow() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     const std::string clipboard = "123\t0.5\t456\t1.2\t3.4\t3.14\t5\t6\tabc";
 
-    //The user hits "copy selected" with the second and third rows selected
-    EXPECT_CALL(mockView, getClipboard()).Times(1).WillRepeatedly(Return(clipboard));
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(std::set<int>()));
+    // The user hits "copy selected" with the second and third rows selected
+    EXPECT_CALL(mockView, getClipboard())
+        .Times(1)
+        .WillRepeatedly(Return(clipboard));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::PasteSelectedFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 5);
-    //Check the unselected rows were unaffected
+    // Check the unselected rows were unaffected
     TS_ASSERT_EQUALS(ws->String(0, RunCol), "12345");
     TS_ASSERT_EQUALS(ws->String(1, RunCol), "12346");
     TS_ASSERT_EQUALS(ws->String(2, RunCol), "24681");
     TS_ASSERT_EQUALS(ws->String(3, RunCol), "24682");
 
-    //Check the values were pasted correctly
+    // Check the values were pasted correctly
     TS_ASSERT_EQUALS(ws->String(4, RunCol), "123");
     TS_ASSERT_EQUALS(ws->String(4, ThetaCol), "0.5");
     TS_ASSERT_EQUALS(ws->String(4, TransCol), "456");
@@ -1087,13 +1286,14 @@ public:
     TS_ASSERT_EQUALS(ws->String(4, OptionsCol), "abc");
   }
 
-  void testPasteRows()
-  {
+  void testPasteRows() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
@@ -1103,21 +1303,26 @@ public:
     const std::string clipboard = "123\t0.5\t456\t1.2\t3.4\t3.14\t5\t6\tabc\n"
                                   "345\t2.7\t123\t2.1\t4.3\t2.17\t3\t2\tdef";
 
-    //The user hits "copy selected" with the second and third rows selected
-    EXPECT_CALL(mockView, getClipboard()).Times(1).WillRepeatedly(Return(clipboard));
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // The user hits "copy selected" with the second and third rows selected
+    EXPECT_CALL(mockView, getClipboard())
+        .Times(1)
+        .WillRepeatedly(Return(clipboard));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::PasteSelectedFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 4);
-    //Check the unselected rows were unaffected
+    // Check the unselected rows were unaffected
     TS_ASSERT_EQUALS(ws->String(0, RunCol), "12345");
     TS_ASSERT_EQUALS(ws->String(3, RunCol), "24682");
 
-    //Check the values were pasted correctly
+    // Check the values were pasted correctly
     TS_ASSERT_EQUALS(ws->String(1, RunCol), "123");
     TS_ASSERT_EQUALS(ws->String(1, ThetaCol), "0.5");
     TS_ASSERT_EQUALS(ws->String(1, TransCol), "456");
@@ -1139,35 +1344,41 @@ public:
     TS_ASSERT_EQUALS(ws->String(2, OptionsCol), "def");
   }
 
-  void testPasteNewRows()
-  {
+  void testPasteNewRows() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     const std::string clipboard = "123\t0.5\t456\t1.2\t3.4\t3.14\t5\t6\tabc\n"
                                   "345\t2.7\t123\t2.1\t4.3\t2.17\t3\t2\tdef";
 
-    //The user hits "copy selected" with the second and third rows selected
-    EXPECT_CALL(mockView, getClipboard()).Times(1).WillRepeatedly(Return(clipboard));
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(std::set<int>()));
+    // The user hits "copy selected" with the second and third rows selected
+    EXPECT_CALL(mockView, getClipboard())
+        .Times(1)
+        .WillRepeatedly(Return(clipboard));
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(std::set<int>()));
     presenter.notify(IReflPresenter::PasteSelectedFlag);
 
-    //The user hits "save"
+    // The user hits "save"
     presenter.notify(IReflPresenter::SaveFlag);
 
-    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>("TestWorkspace");
+    auto ws = AnalysisDataService::Instance().retrieveWS<ITableWorkspace>(
+        "TestWorkspace");
     TS_ASSERT_EQUALS(ws->rowCount(), 6);
-    //Check the unselected rows were unaffected
+    // Check the unselected rows were unaffected
     TS_ASSERT_EQUALS(ws->String(0, RunCol), "12345");
     TS_ASSERT_EQUALS(ws->String(1, RunCol), "12346");
     TS_ASSERT_EQUALS(ws->String(2, RunCol), "24681");
     TS_ASSERT_EQUALS(ws->String(3, RunCol), "24682");
 
-    //Check the values were pasted correctly
+    // Check the values were pasted correctly
     TS_ASSERT_EQUALS(ws->String(4, RunCol), "123");
     TS_ASSERT_EQUALS(ws->String(4, ThetaCol), "0.5");
     TS_ASSERT_EQUALS(ws->String(4, TransCol), "456");
@@ -1189,69 +1400,77 @@ public:
     TS_ASSERT_EQUALS(ws->String(5, OptionsCol), "def");
   }
 
-  void testImportTable()
-  {
+  void testImportTable() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
     EXPECT_CALL(mockView, showAlgorithmDialog("LoadReflTBL"));
     presenter.notify(IReflPresenter::ImportTableFlag);
   }
 
-  void testExportTable()
-  {
+  void testExportTable() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
     EXPECT_CALL(mockView, showAlgorithmDialog("SaveReflTBL"));
     presenter.notify(IReflPresenter::ExportTableFlag);
   }
 
-  void testPlotRowWarn()
-  {
+  void testPlotRowWarn() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
     createTOFWorkspace("TOF_12345", "12345");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
+
+    // We should be warned
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
     rowlist.insert(0);
 
-    //We should be warned
-    EXPECT_CALL(mockView, giveUserWarning(_,_));
-
-    //The user hits "plot rows" with the first row selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // We should be warned
+    EXPECT_CALL(mockView, giveUserWarning(_, _));
+    // The presenter calls plotWorkspaces
+    EXPECT_CALL(mockView, plotWorkspaces(_)).Times(1);
+    // The user hits "plot rows" with the first row selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::PlotRowFlag);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
     AnalysisDataService::Instance().remove("TOF_12345");
   }
 
-  void testPlotGroupWarn()
-  {
+  void testPlotGroupWarn() {
     MockView mockView;
     ReflMainViewPresenter presenter(&mockView);
 
     createPrefilledWorkspace("TestWorkspace");
     createTOFWorkspace("TOF_12345", "12345");
     createTOFWorkspace("TOF_12346", "12346");
-    EXPECT_CALL(mockView, getWorkspaceToOpen()).Times(1).WillRepeatedly(Return("TestWorkspace"));
+    EXPECT_CALL(mockView, getWorkspaceToOpen())
+        .Times(1)
+        .WillRepeatedly(Return("TestWorkspace"));
     presenter.notify(IReflPresenter::OpenTableFlag);
 
     std::set<int> rowlist;
     rowlist.insert(0);
 
-    //We should be warned
-    EXPECT_CALL(mockView, giveUserWarning(_,_));
-
-    //The user hits "plot groups" with the first row selected
-    EXPECT_CALL(mockView, getSelectedRows()).Times(1).WillRepeatedly(Return(rowlist));
+    // We should be warned
+    EXPECT_CALL(mockView, giveUserWarning(_, _));
+    // the presenter calls plotWorkspaces
+    EXPECT_CALL(mockView, plotWorkspaces(_));
+    // The user hits "plot groups" with the first row selected
+    EXPECT_CALL(mockView, getSelectedRows())
+        .Times(1)
+        .WillRepeatedly(Return(rowlist));
     presenter.notify(IReflPresenter::PlotGroupFlag);
 
-    //Tidy up
+    // Tidy up
     AnalysisDataService::Instance().remove("TestWorkspace");
     AnalysisDataService::Instance().remove("TOF_12345");
     AnalysisDataService::Instance().remove("TOF_12346");
diff --git a/Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt b/Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt
index d00ae498cb46115965a0d3114c16cbf063ff288b..7f228d52fa3908caab64033596970dcf0e596013 100644
--- a/Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt
+++ b/Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt
@@ -26,6 +26,7 @@ set ( SRC_FILES
     src/MuonFitPropertyBrowser.cpp
     src/MuonSequentialFitDialog.cpp
     src/PeakPicker.cpp
+    src/PeriodicTableWidget.cpp
     src/PreviewPlot.cpp
     src/ProcessingAlgoWidget.cpp
     src/PropertyHandler.cpp
@@ -76,6 +77,7 @@ set ( MOC_FILES
     inc/MantidQtMantidWidgets/MWDiag.h
     inc/MantidQtMantidWidgets/MWRunFiles.h
     inc/MantidQtMantidWidgets/PeakPicker.h
+    inc/MantidQtMantidWidgets/PeriodicTableWidget.h
     inc/MantidQtMantidWidgets/pqHelpWindow.h
     inc/MantidQtMantidWidgets/PreviewPlot.h
     inc/MantidQtMantidWidgets/PropertyHandler.h
@@ -126,6 +128,7 @@ set ( UI_FILES
     inc/MantidQtMantidWidgets/SlicingAlgorithmDialog.ui
     inc/MantidQtMantidWidgets/SlitCalculator.ui
     inc/MantidQtMantidWidgets/UserFunctionDialog.ui
+    inc/MantidQtMantidWidgets/PeriodicTableWidget.ui
     inc/MantidQtMantidWidgets/PreviewPlot.ui
     inc/MantidQtMantidWidgets/pqHelpWindow.ui
 )
diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MWRunFiles.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MWRunFiles.h
index 621f107a7761c4621e90470ffe2e4abbd0f30d83..47ead67a533b61eecebe7924c0c9790d5b072b73 100644
--- a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MWRunFiles.h
+++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/MWRunFiles.h
@@ -12,290 +12,320 @@
 #include <QThread>
 #include <boost/shared_ptr.hpp>
 
-namespace Mantid { namespace API { class IAlgorithm; } }
-
-namespace MantidQt
-{
-  namespace MantidWidgets
-  {
-    /**
-     * A class to allow the asyncronous finding of files.
-     */
-    class FindFilesThread : public QThread
-    {
-      Q_OBJECT
-
-    public:
-      /// Constructor.
-      FindFilesThread(QObject *parent = NULL);
-      /// Set the various file-finding values / options.
-      void set(QString text, bool isForRunFiles, bool isOptional, const QString & algorithmProperty = "");
-
-      /// Returns the error string.  Empty if no error was caught.
-      std::string error() const { return m_error; }
-      /// Returns the vector of "unpacked" filenames.  Empty if no files were found, or if there was an error.
-      std::vector<std::string> filenames() const { return m_filenames; }
-      /// Returns a string value that can be used to put in to another instance of the algorithm to avoid searching again
-      QString valueForProperty() const { return m_valueForProperty; }
-
-    protected:
-      /// Override parent class run().
-      virtual void run();
-
-    private:
-      /// Use the specified algorithm and property to find files instead of using the FileFinder.
-      void getFilesFromAlgorithm();
-
-      /// Storage for any error thrown while trying to find files.
-      std::string m_error;
-      /// Filenames found during execution of the thread.
-      std::vector<std::string> m_filenames;
-      /// Stores the string value to be used as input for an algorithm property
-      QString m_valueForProperty;
-
-      /// File name text typed in by the user.
-      std::string m_text;
-
-      QString m_algorithm;
-      QString m_property;
-      bool m_isForRunFiles;
-      bool m_isOptional;
-    };
-
-    /** 
-    This class defines a widget for file searching. It allows either single or multiple files
-    to be specified.
-
-    @author Martyn Gigg, Tessella Support Services plc
-    @date 24/02/2009
-
-    Copyright &copy; 2009 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source
-
-    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_MANTIDWIDGETS MWRunFiles : public API::MantidWidget
-    {
-      Q_OBJECT
-      
-      Q_PROPERTY(bool findRunFiles READ isForRunFiles WRITE isForRunFiles)
-      Q_PROPERTY(QString label READ getLabelText WRITE setLabelText)
-      Q_PROPERTY(bool multipleFiles READ allowMultipleFiles WRITE allowMultipleFiles)
-      Q_PROPERTY(bool optional READ isOptional WRITE isOptional)
-      Q_PROPERTY(bool multiEntry READ doMultiEntry WRITE doMultiEntry)
-      Q_PROPERTY(ButtonOpts buttonOpt READ doButtonOpt WRITE doButtonOpt)
-      Q_PROPERTY(QString algorithmAndProperty READ getAlgorithmProperty WRITE setAlgorithmProperty)
-      Q_PROPERTY(QStringList fileExtensions READ getFileExtensions WRITE setFileExtensions)
-      Q_PROPERTY(bool extsAsSingleOption READ extsAsSingleOption WRITE extsAsSingleOption)
-      Q_PROPERTY(LiveButtonOpts liveButton READ liveButtonState WRITE liveButtonState)
-      Q_PROPERTY(QString instrumentOverride READ getInstrumentOverride WRITE setInstrumentOverride)
-      Q_ENUMS(ButtonOpts)
-      Q_ENUMS(LiveButtonOpts)
-
-      friend class DataSelector;
-
-    public:
-      /// options for bringing up the load file dialog
-      enum ButtonOpts
-      {
-        Text,                       ///< use a button (normally labelled "Browse")
-        Icon,                       ///< use an icon
-        None                        ///< disable the load file dialog
-      };
-      /// Flags for workspace entries
-      enum
-      {
-        NO_ENTRY_NUM = -1,          ///< error in the entry number setting
-        ALL_ENTRIES = -2            ///< use all entries (i.e. entry number was left blank)
-      };
-      /// Options for the live button
-      enum LiveButtonOpts
-      {
-        Hide,            ///< Don't use the live button
-        AlwaysShow,      ///< Show whether a connection is possible or not (will be disabled)
-        ShowIfCanConnect ///< Only show if able to connect to the live data server
-      };
-
-      ///Default constructor
-      MWRunFiles(QWidget *parent=NULL);
-
-      /// Destructor
-      ~MWRunFiles();
-
-      // property accessors/modifiers
-      bool isForRunFiles() const;
-      void isForRunFiles(bool);
-      QString getLabelText() const;
-      void setLabelText(const QString & text);
-      void setLabelMinWidth(int);
-      bool allowMultipleFiles() const;
-      void allowMultipleFiles(bool);
-      bool isOptional() const;
-      void isOptional(bool);
-      ButtonOpts doButtonOpt() const;
-      void doButtonOpt(ButtonOpts buttonOpt);
-      bool doMultiEntry() const;
-      void doMultiEntry(bool);
-      QString getAlgorithmProperty() const;
-      void setAlgorithmProperty(const QString & name);
-      QStringList getFileExtensions() const;
-      void setFileExtensions(const QStringList & extensions);
-      bool extsAsSingleOption() const;
-      void extsAsSingleOption(bool value);
-      LiveButtonOpts liveButtonState() const;
-      void liveButtonState(LiveButtonOpts);
-
-      // Standard setters/getters
-      void liveButtonSetEnabled(bool);
-      void liveButtonSetChecked(bool);
-      bool liveButtonIsChecked() const;
-      bool isEmpty() const;
-      QString getText() const;
-
-      bool isValid() const;
-      bool isSearching() const;
-      QStringList getFilenames() const;
-      QString getFirstFilename() const;
-      int getEntryNum() const;
-      void setEntryNum(const int num);
-      /// Overridden from base class to retrieve user input through a common interface
-      QVariant getUserInput() const;
-      /// Sets a value on the widget through a common interface
-      void setUserInput(const QVariant & value);
-      /// Sets a value on the widget but doesn't emit a signal to say it has changed
-      void setText(const QString & value);
-      /// flag a problem with the file the user entered, an empty string means no error
-      void setFileProblem(const QString & message);
-      /// Get file problem, empty string means no error.
-      QString getFileProblem();
-      /// Read settings from the given group
-      void readSettings(const QString & group);
-      /// Save settings in the given group
-      void saveSettings(const QString & group);
-      /// Alters the text label that contains the number of entries, normally run when the file is loaded
-      void setNumberOfEntries(int number);
-      /// Inform the widget of a running instance of MonitorLiveData to be used in stopLiveListener()
-      void setLiveAlgorithm(const boost::shared_ptr<Mantid::API::IAlgorithm>& monitorLiveData);
-      /// Gets the instrument currently fixed to
-      QString getInstrumentOverride();
-      /// Overrides the value of default instrument
-      void setInstrumentOverride(const QString & instName);
-
-    signals:
-      /// Emitted when the file text changes
-      void fileTextChanged(const QString &);
-      /// Emitted when the editing has finished
-      void fileEditingFinished();
-      // Emitted when files finding starts.
-      void findingFiles();
-      /// Emitted when files have been found
-      void filesFound();
-      /// Emitted when files have been found that are different to what was found last time
-      void filesFoundChanged();
-      /// Emitted when file finding is finished (files may or may not have been found).
-      void fileFindingFinished();
-      /// Emitted when the live button is toggled
-      void liveButtonPressed(bool);
-      /// Signal emitted after asynchronous checking of live stream availability
-      void liveButtonSetEnabledSignal(bool);
-
-    public slots:
-      /// Set the file text and try and find it
-      void setFileTextWithSearch(const QString & text);
-      /// Just update the file text, useful for syncing two boxes
-      void setFileTextWithoutSearch(const QString & text);
-      /// Find the files within the text edit field and cache their full paths
-      void findFiles();
-      boost::shared_ptr<const Mantid::API::IAlgorithm> stopLiveAlgorithm();
-      
-    protected:
-      //Method for handling drop events
-      void dropEvent(QDropEvent *);
-      //called when a drag event enters the class
-      void dragEnterEvent(QDragEnterEvent *);
-
-    private:
-      /// Create a file filter from a list of extensions
-      QString createFileFilter();
-      /// Create an extension list from the name algorithm and property
-      QStringList getFileExtensionsFromAlgorithm(const QString & algName, const QString &propName);
-      /// Create an extension list from the name algorithm and property
-      QStringList getFilesFromAlgorithm(const QString & algName, const QString &propName, const QString &filename);
-      /// Open a file dialog
-      QString openFileDialog();
-      /// flag a problem with the supplied entry number, an empty string means no error
-      void setEntryNumProblem(const QString & message);
-      /// displays the validator red star if either m_fileProblem or m_entryNumProblem are not empty
-      void refreshValidator();
-      /// Called asynchronously to check the availability of the live stream
-      void checkLiveConnection();
-
-    private slots:
-      /// Browse clicked slot
-      void browseClicked();
-      /// currently checks only if the entry number is any integer > 0
-      void checkEntry();
-      /// Slot called when file finding thread has finished.
-      void inspectThreadResult();
-
-    private:
-      /// Is the widget for run files or standard files
-      bool m_findRunFiles;
-      /// Allow multiple files
-      bool m_allowMultipleFiles;
-      /// Whether the widget can be empty
-      bool m_isOptional;
-      /// Whether to allow the user to state an entry number
-      bool m_multiEntry;
-      /// To use a browse button or icon or nothing at all
-      ButtonOpts m_buttonOpt;
-      /// Holds any error with the user entry for the filename, "" means no error
-      QString m_fileProblem;
-      /// If applicable holds any error with the user in entryNum, "" means no error
-      QString m_entryNumProblem;
-      /// The algorithm name and property (can be empty)
-      QString m_algorithmProperty;
-      /// The file extensions to look for
-      QStringList m_fileExtensions;
-      /// If true the exts are displayed as one option in the dialog
-      bool m_extsAsSingleOption;
-      /// If or when live button will be shown
-      LiveButtonOpts m_liveButtonState;
-      /// Handle on a running instance of MonitorLiveData
-      boost::shared_ptr<Mantid::API::IAlgorithm> m_monitorLiveData;
-
-      /// The Ui form
-      Ui::MWRunFiles m_uiForm;
-      /// An array of valid file names derived from the entries in the leNumber LineEdit
-      QStringList m_foundFiles;
-      /// An array of the last valid file names found
-      QStringList m_lastFoundFiles;
-      /// The last directory viewed by the browse dialog
-      QString m_lastDir;
-      /// A file filter for the file browser
-      QString m_fileFilter;
-      /// Thread to allow asynchronous finding of files.
-      FindFilesThread * m_thread;
-
-      QString m_defaultInstrumentName;
-    };
-  }
+namespace Mantid {
+namespace API {
+class IAlgorithm;
+}
+}
+
+namespace MantidQt {
+namespace MantidWidgets {
+/**
+ * A class to allow the asyncronous finding of files.
+ */
+class FindFilesThread : public QThread {
+  Q_OBJECT
+
+public:
+  /// Constructor.
+  FindFilesThread(QObject *parent = NULL);
+  /// Set the various file-finding values / options.
+  void set(QString text, bool isForRunFiles, bool isOptional,
+           const QString &algorithmProperty = "");
+
+  /// Returns the error string.  Empty if no error was caught.
+  std::string error() const { return m_error; }
+  /// Returns the vector of "unpacked" filenames.  Empty if no files were found,
+  /// or if there was an error.
+  std::vector<std::string> filenames() const { return m_filenames; }
+  /// Returns a string value that can be used to put in to another instance of
+  /// the algorithm to avoid searching again
+  QString valueForProperty() const { return m_valueForProperty; }
+
+protected:
+  /// Override parent class run().
+  virtual void run();
+
+private:
+  /// Use the specified algorithm and property to find files instead of using
+  /// the FileFinder.
+  void getFilesFromAlgorithm();
+
+  /// Storage for any error thrown while trying to find files.
+  std::string m_error;
+  /// Filenames found during execution of the thread.
+  std::vector<std::string> m_filenames;
+  /// Stores the string value to be used as input for an algorithm property
+  QString m_valueForProperty;
+
+  /// File name text typed in by the user.
+  std::string m_text;
+
+  QString m_algorithm;
+  QString m_property;
+  bool m_isForRunFiles;
+  bool m_isOptional;
+};
+
+/**
+This class defines a widget for file searching. It allows either single or
+multiple files
+to be specified.
+
+@author Martyn Gigg, Tessella Support Services plc
+@date 24/02/2009
+
+Copyright &copy; 2009 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+National Laboratory & European Spallation Source
+
+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_MANTIDWIDGETS MWRunFiles : public API::MantidWidget {
+  Q_OBJECT
+
+  Q_PROPERTY(bool findRunFiles READ isForRunFiles WRITE isForRunFiles)
+  Q_PROPERTY(bool findDirectory READ isForDirectory WRITE isForDirectory)
+  Q_PROPERTY(QString label READ getLabelText WRITE setLabelText)
+  Q_PROPERTY(bool multipleFiles READ allowMultipleFiles WRITE
+                 allowMultipleFiles)
+  Q_PROPERTY(bool optional READ isOptional WRITE isOptional)
+  Q_PROPERTY(bool multiEntry READ doMultiEntry WRITE doMultiEntry)
+  Q_PROPERTY(ButtonOpts buttonOpt READ doButtonOpt WRITE doButtonOpt)
+  Q_PROPERTY(QString algorithmAndProperty READ getAlgorithmProperty WRITE
+                 setAlgorithmProperty)
+  Q_PROPERTY(QStringList fileExtensions READ getFileExtensions WRITE
+                 setFileExtensions)
+  Q_PROPERTY(bool extsAsSingleOption READ extsAsSingleOption WRITE
+                 extsAsSingleOption)
+  Q_PROPERTY(LiveButtonOpts liveButton READ liveButtonState WRITE
+                 liveButtonState)
+  Q_PROPERTY(QString instrumentOverride READ getInstrumentOverride WRITE
+                 setInstrumentOverride)
+  Q_ENUMS(ButtonOpts)
+  Q_ENUMS(LiveButtonOpts)
+
+  friend class DataSelector;
+
+public:
+  /// options for bringing up the load file dialog
+  enum ButtonOpts {
+    Text, ///< use a button (normally labelled "Browse")
+    Icon, ///< use an icon
+    None  ///< disable the load file dialog
+  };
+  /// Flags for workspace entries
+  enum {
+    NO_ENTRY_NUM = -1, ///< error in the entry number setting
+    ALL_ENTRIES = -2   ///< use all entries (i.e. entry number was left blank)
+  };
+  /// Options for the live button
+  enum LiveButtonOpts {
+    Hide,            ///< Don't use the live button
+    AlwaysShow,      ///< Show whether a connection is possible or not (will be
+                     ///disabled)
+    ShowIfCanConnect ///< Only show if able to connect to the live data server
+  };
+
+  /// Default constructor
+  MWRunFiles(QWidget *parent = NULL);
+
+  /// Destructor
+  ~MWRunFiles();
+
+  // property accessors/modifiers
+  bool isForRunFiles() const;
+  void isForRunFiles(bool);
+  bool isForDirectory() const;
+  void isForDirectory(bool);
+  QString getLabelText() const;
+  void setLabelText(const QString &text);
+  void setLabelMinWidth(int);
+  bool allowMultipleFiles() const;
+  void allowMultipleFiles(bool);
+  bool isOptional() const;
+  void isOptional(bool);
+  ButtonOpts doButtonOpt() const;
+  void doButtonOpt(ButtonOpts buttonOpt);
+  bool doMultiEntry() const;
+  void doMultiEntry(bool);
+  QString getAlgorithmProperty() const;
+  void setAlgorithmProperty(const QString &name);
+  QStringList getFileExtensions() const;
+  void setFileExtensions(const QStringList &extensions);
+  bool extsAsSingleOption() const;
+  void extsAsSingleOption(bool value);
+  LiveButtonOpts liveButtonState() const;
+  void liveButtonState(LiveButtonOpts);
+
+  // Standard setters/getters
+  void liveButtonSetEnabled(bool);
+  void liveButtonSetChecked(bool);
+  bool liveButtonIsChecked() const;
+  bool isEmpty() const;
+  QString getText() const;
+
+  bool isValid() const;
+  bool isSearching() const;
+  QStringList getFilenames() const;
+  QString getFirstFilename() const;
+  int getEntryNum() const;
+  void setEntryNum(const int num);
+  /// Overridden from base class to retrieve user input through a common
+  /// interface
+  QVariant getUserInput() const;
+  /// Sets a value on the widget through a common interface
+  void setUserInput(const QVariant &value);
+  /// Sets a value on the widget but doesn't emit a signal to say it has changed
+  void setText(const QString &value);
+  /// flag a problem with the file the user entered, an empty string means no
+  /// error
+  void setFileProblem(const QString &message);
+  /// Get file problem, empty string means no error.
+  QString getFileProblem();
+  /// Read settings from the given group
+  void readSettings(const QString &group);
+  /// Save settings in the given group
+  void saveSettings(const QString &group);
+  /// Alters the text label that contains the number of entries, normally run
+  /// when the file is loaded
+  void setNumberOfEntries(int number);
+  /// Inform the widget of a running instance of MonitorLiveData to be used in
+  /// stopLiveListener()
+  void setLiveAlgorithm(
+      const boost::shared_ptr<Mantid::API::IAlgorithm> &monitorLiveData);
+  /// Gets the instrument currently fixed to
+  QString getInstrumentOverride();
+  /// Overrides the value of default instrument
+  void setInstrumentOverride(const QString &instName);
+
+signals:
+  /// Emitted when the file text changes
+  void fileTextChanged(const QString &);
+  /// Emitted when the editing has finished
+  void fileEditingFinished();
+  // Emitted when files finding starts.
+  void findingFiles();
+  /// Emitted when files have been found
+  void filesFound();
+  /// Emitted when files have been found that are different to what was found
+  /// last time
+  void filesFoundChanged();
+  /// Emitted when file finding is finished (files may or may not have been
+  /// found).
+  void fileFindingFinished();
+  /// Emitted when the live button is toggled
+  void liveButtonPressed(bool);
+  /// Signal emitted after asynchronous checking of live stream availability
+  void liveButtonSetEnabledSignal(bool);
+
+public slots:
+  /// Set the file text and try and find it
+  void setFileTextWithSearch(const QString &text);
+  /// Just update the file text, useful for syncing two boxes
+  void setFileTextWithoutSearch(const QString &text);
+  /// Clear the search from the widget
+  void clear();
+  /// Find the files within the text edit field and cache their full paths
+  void findFiles();
+  boost::shared_ptr<const Mantid::API::IAlgorithm> stopLiveAlgorithm();
+
+protected:
+  // Method for handling drop events
+  void dropEvent(QDropEvent *);
+  // called when a drag event enters the class
+  void dragEnterEvent(QDragEnterEvent *);
+
+private:
+  /// Create a file filter from a list of extensions
+  QString createFileFilter();
+  /// Create an extension list from the name algorithm and property
+  QStringList getFileExtensionsFromAlgorithm(const QString &algName,
+                                             const QString &propName);
+  /// Create an extension list from the name algorithm and property
+  QStringList getFilesFromAlgorithm(const QString &algName,
+                                    const QString &propName,
+                                    const QString &filename);
+  /// Open a file dialog
+  QString openFileDialog();
+  /// flag a problem with the supplied entry number, an empty string means no
+  /// error
+  void setEntryNumProblem(const QString &message);
+  /// displays the validator red star if either m_fileProblem or
+  /// m_entryNumProblem are not empty
+  void refreshValidator();
+  /// Called asynchronously to check the availability of the live stream
+  void checkLiveConnection();
+
+private slots:
+  /// Browse clicked slot
+  void browseClicked();
+  /// currently checks only if the entry number is any integer > 0
+  void checkEntry();
+  /// Slot called when file finding thread has finished.
+  void inspectThreadResult();
+
+private:
+  /// Is the widget for run files or standard files
+  bool m_findRunFiles;
+  /// If the widget is for directories
+  bool m_isForDirectory;
+  /// Allow multiple files
+  bool m_allowMultipleFiles;
+  /// Whether the widget can be empty
+  bool m_isOptional;
+  /// Whether to allow the user to state an entry number
+  bool m_multiEntry;
+  /// To use a browse button or icon or nothing at all
+  ButtonOpts m_buttonOpt;
+  /// Holds any error with the user entry for the filename, "" means no error
+  QString m_fileProblem;
+  /// If applicable holds any error with the user in entryNum, "" means no error
+  QString m_entryNumProblem;
+  /// The algorithm name and property (can be empty)
+  QString m_algorithmProperty;
+  /// The file extensions to look for
+  QStringList m_fileExtensions;
+  /// If true the exts are displayed as one option in the dialog
+  bool m_extsAsSingleOption;
+  /// If or when live button will be shown
+  LiveButtonOpts m_liveButtonState;
+  /// Handle on a running instance of MonitorLiveData
+  boost::shared_ptr<Mantid::API::IAlgorithm> m_monitorLiveData;
+
+  /// The Ui form
+  Ui::MWRunFiles m_uiForm;
+  /// An array of valid file names derived from the entries in the leNumber
+  /// LineEdit
+  QStringList m_foundFiles;
+  /// An array of the last valid file names found
+  QStringList m_lastFoundFiles;
+  /// The last directory viewed by the browse dialog
+  QString m_lastDir;
+  /// A file filter for the file browser
+  QString m_fileFilter;
+  /// Thread to allow asynchronous finding of files.
+  FindFilesThread *m_thread;
+
+  QString m_defaultInstrumentName;
+};
+}
 }
 
 #endif // MANTIDQTMANTIDWIDGETS_MWRUNFILES_H_
diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/PeriodicTableWidget.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/PeriodicTableWidget.h
new file mode 100644
index 0000000000000000000000000000000000000000..d875b5eb24253d20c42592d1a20b7cc4c3890a21
--- /dev/null
+++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/PeriodicTableWidget.h
@@ -0,0 +1,110 @@
+#ifndef MANTID_MANTIDWIDGETS_PERIODICTABLEWIDGET_H_
+#define MANTID_MANTIDWIDGETS_PERIODICTABLEWIDGET_H_
+
+#include "MantidQtMantidWidgets/WidgetDllOption.h"
+#include <qvector.h>
+#include <QWidget>
+#include "ui_PeriodicTableWidget.h"
+
+  /**
+    PeriodicTableWidget: A Widget representing a colour coded Periodic Table of Elements, with corresponding buttons as the elements
+
+    Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge National Laboratory & European Spallation Source
+
+    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_MANTIDWIDGETS PeriodicTableWidget : public QWidget {
+  Q_OBJECT
+
+public:
+  ///Constructor
+  PeriodicTableWidget(QWidget *parent = 0);
+
+  /// Vectors to Hold the QPushButtons of Elements in corresponding Groups
+  QVector<QPushButton *> OtherNonMetals;
+  QVector<QPushButton *> AlkaliMetals;
+  QVector<QPushButton *> AlkalineEarthMetals;
+  QVector<QPushButton *> TransitionMetals;
+  QVector<QPushButton *> Actinides;
+  QVector<QPushButton *> Lanthanides;
+  QVector<QPushButton *> UnknownProperties;
+  QVector<QPushButton *> PostTransitionMetals;
+  QVector<QPushButton *> Metalloids;
+  QVector<QPushButton *> Halogens;
+  QVector<QPushButton *> NobleGases;
+
+  /// Vector to hold all group vectors for access to All Buttons at once
+  QVector<QVector <QPushButton *> > AllElementButtons;
+
+  /// @return Comma-separated string of all the element buttons for one group that are currently checked 
+  QString elementsSelectedToString(QVector<QPushButton *> elementsSelected);
+
+  /// @return Comma-separated string of all element buttons that are checked in the whole PeriodicTableWidget
+  QString getAllCheckedElementsStr();
+
+  /// Disables all buttons associated with a group.
+  void disableButtons(QVector<QPushButton *> buttons);
+
+  /// Disables All buttons in periodicTableWidget.
+  void disableAllElementButtons();
+
+  ///Enables a button for an element by the element name i.e 'Au' for Gold.
+  void enableButtonByName(QString elementStr);
+
+  ///@return the result of the comparison between a string and the text of a button.
+  bool compareButtonNameToStr(QPushButton * buttonToCompare,QString stringToCompare);
+
+  ///Displays or hides the Legend for the colour coding of periodic groups
+  void showGroupLegend(bool checked);
+
+private:
+  ///The Form containing the PeriodicTableWidget
+  Ui::PeriodicTable ui;
+  /// Methods to colour element buttons by periodic group
+  void ColourNonMetals(const QVector<QPushButton *> &nonMetals);
+  void ColourAlkaliMetals(const QVector<QPushButton *> &alkaliMetals);
+  void ColourAlkalineEarthMetals(
+      const QVector<QPushButton *> &alkalineEarthMetals);
+  void ColourTransitionMetals(const QVector<QPushButton *> &transMetals);
+  void ColourActinides(const QVector<QPushButton *> &actinides);
+  void ColourLanthanides(const QVector<QPushButton *> &lanthanides);
+  void
+  ColourPostTransitionMetals(const QVector<QPushButton *> &postTransMetals);
+  void
+  ColourUnknownProperties(const QVector<QPushButton *> &unknownProperties);
+  void ColourMetalloids(const QVector<QPushButton *> &metalloids);
+  void ColourHalogens(const QVector<QPushButton *> &halogens);
+  void ColourNobleGases(const QVector<QPushButton *> &nobleGases);
+
+  /// Methods to colour single element button by setting styleSheet
+  void ColourButton(QPushButton *elementButton, QString colour);
+
+  ///Method to populate Group Vectors with element QPushButtons
+  void populateGroupVectors();
+
+  ///Method to populate Vector with all Group vectors
+  void populateAllButtonsVector();
+
+  /// Colour all of the elements by calls to individual group colouring methods
+  void ColourElements();
+};
+
+#endif // !MANTID_MANTIDWIDGETS_PERIODICTABLE_H_
\ No newline at end of file
diff --git a/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/PeriodicTableWidget.ui b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/PeriodicTableWidget.ui
new file mode 100644
index 0000000000000000000000000000000000000000..022c97fc5f50a9927bfadfe7eb74433846f993af
--- /dev/null
+++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/PeriodicTableWidget.ui
@@ -0,0 +1,10236 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PeriodicTable</class>
+ <widget class="QWidget" name="PeriodicTable">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>730</width>
+    <height>345</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>0</width>
+    <height>0</height>
+   </size>
+  </property>
+  <property name="maximumSize">
+   <size>
+    <width>770</width>
+    <height>345</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <property name="layoutDirection">
+   <enum>Qt::LeftToRight</enum>
+  </property>
+  <property name="autoFillBackground">
+   <bool>false</bool>
+  </property>
+  <property name="styleSheet">
+   <string notr="true"/>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="2" column="0">
+    <widget class="QScrollArea" name="scrollArea">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>700</width>
+       <height>400</height>
+      </size>
+     </property>
+     <property name="frameShadow">
+      <enum>QFrame::Sunken</enum>
+     </property>
+     <property name="verticalScrollBarPolicy">
+      <enum>Qt::ScrollBarAsNeeded</enum>
+     </property>
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <property name="alignment">
+      <set>Qt::AlignJustify|Qt::AlignVCenter</set>
+     </property>
+     <widget class="QWidget" name="scrollAreaWidgetContents">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>598</width>
+        <height>325</height>
+       </rect>
+      </property>
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="maximumSize">
+       <size>
+        <width>600</width>
+        <height>490</height>
+       </size>
+      </property>
+      <layout class="QGridLayout" name="gridLayout_4">
+       <item row="1" column="0">
+        <widget class="QGroupBox" name="groupBox">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>false</bool>
+         </property>
+         <property name="styleSheet">
+          <string notr="true">QPushButton {
+    border: 1px solid #000000;
+    border-radius: 3px;
+}
+
+QPushButton:pressed {
+	background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+                                      stop: 0 #dadbde, stop: 1 #000000);
+}
+QPushButton:checked{ background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+                                      stop: 0 #dadbde, stop: 1 #838b83);
+}
+
+</string>
+         </property>
+         <property name="title">
+          <string/>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_2">
+          <item row="10" column="21">
+           <widget class="QLabel" name="label_27">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string> 16</string>
+            </property>
+           </widget>
+          </item>
+          <item row="10" column="22">
+           <widget class="QLabel" name="label_28">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string> 17</string>
+            </property>
+           </widget>
+          </item>
+          <item row="10" column="20">
+           <widget class="QLabel" name="label_26">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  15</string>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="8">
+           <widget class="QLabel" name="label_15">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  4</string>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="14">
+           <widget class="QLabel" name="label_20">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  9</string>
+            </property>
+           </widget>
+          </item>
+          <item row="10" column="4">
+           <widget class="QLabel" name="label_13">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  2</string>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="21">
+           <widget class="QPushButton" name="S">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Sulfur</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>S</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="13">
+           <widget class="QLabel" name="label_19">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  8</string>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="4">
+           <widget class="QPushButton" name="Ba">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Barium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ba</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="19">
+           <widget class="QPushButton" name="Fl">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Flerovium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Fl</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="8">
+           <widget class="QPushButton" name="Ac">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Actinium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ac</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="4">
+           <widget class="QPushButton" name="Ca">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Calcium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ca</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="4">
+           <widget class="QPushButton" name="Mg">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Magnesium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Mg</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="4">
+           <widget class="QPushButton" name="Be">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Beryllium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Be</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="6">
+           <widget class="QPushButton" name="Y">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Yttrium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Y</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="18">
+           <widget class="QPushButton" name="Uut">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Ununtrium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Uut</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="23">
+           <widget class="QPushButton" name="Uuo">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Ununoctium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Uuo</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="22">
+           <widget class="QPushButton" name="Uus">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Ununseptium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Uus</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="21">
+           <widget class="QPushButton" name="Lv">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Livermorium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Lv</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="20">
+           <widget class="QPushButton" name="Uup">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Ununpentium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Uup</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="12">
+           <widget class="QLabel" name="label_18">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  7</string>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="15">
+           <widget class="QLabel" name="label_21">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  10</string>
+            </property>
+           </widget>
+          </item>
+          <item row="10" column="18">
+           <widget class="QLabel" name="label_24">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string> 13</string>
+            </property>
+           </widget>
+          </item>
+          <item row="10" column="19">
+           <widget class="QLabel" name="label_25">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string> 14</string>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="17">
+           <widget class="QLabel" name="label_23">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string> 12</string>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="16">
+           <widget class="QLabel" name="label_22">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  11</string>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="4">
+           <widget class="QPushButton" name="Sr">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Strontium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Sr</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="17">
+           <widget class="QPushButton" name="Cn">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Copernicium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Cn</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="18">
+           <widget class="QPushButton" name="In">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Indium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>In</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="17">
+           <widget class="QPushButton" name="Cd">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Cadmium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Cd</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="16">
+           <widget class="QPushButton" name="Cu">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Copper</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Cu</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="19">
+           <widget class="QPushButton" name="Es">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Einsteinium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Es</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="16">
+           <widget class="QPushButton" name="Rg">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Roentgenium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Rg</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="17">
+           <widget class="QPushButton" name="Zn">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Zinc</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Zn</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="11">
+           <widget class="QPushButton" name="Sg">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Seaborgium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Sg</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="14">
+           <widget class="QPushButton" name="Ir">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Iridium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ir</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="16">
+           <widget class="QPushButton" name="Ag">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Silver</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ag</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="19">
+           <widget class="QPushButton" name="Ge">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Germanium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ge</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="22">
+           <widget class="QPushButton" name="Cl">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Chlorine</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Cl</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="12">
+           <widget class="QPushButton" name="U">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Uranium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>U</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="23">
+           <widget class="QPushButton" name="Ne">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Neon</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ne</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="21">
+           <widget class="QPushButton" name="Po">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Polonium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Po</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="18">
+           <widget class="QPushButton" name="Tl">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Thalium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Tl</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="22">
+           <widget class="QPushButton" name="At">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Astatine</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>At</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="12">
+           <widget class="QPushButton" name="Bh">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Bohrium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Bh</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="22">
+           <widget class="QPushButton" name="Br">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Bromine</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Br</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="20">
+           <widget class="QPushButton" name="Er">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Erbium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Er</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="15">
+           <widget class="QPushButton" name="Ds">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Damstadtium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ds</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="14">
+           <widget class="QPushButton" name="Sm">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Samarium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Sm</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="13">
+           <widget class="QPushButton" name="Np">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Neptunium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Np</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="21">
+           <widget class="QPushButton" name="Md">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Mendelevium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Md</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="16">
+           <widget class="QPushButton" name="Gd">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Gadolinium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Gd</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="17">
+           <widget class="QPushButton" name="Tb">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Terbium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Tb</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="22">
+           <widget class="QPushButton" name="I">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Iodine</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>I</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="12">
+           <widget class="QPushButton" name="Mn">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Manganese</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Mn</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="19">
+           <widget class="QPushButton" name="C">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Carbon</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>C</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="14">
+           <widget class="QPushButton" name="Co">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Cobalt</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Co</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="19">
+           <widget class="QPushButton" name="Pb">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Lead</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Pb</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="18">
+           <widget class="QPushButton" name="B">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Boron</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>B</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="20">
+           <widget class="QPushButton" name="As">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Arsenic</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>As</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="14">
+           <widget class="QPushButton" name="Mt">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Meitnerium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Mt</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="10">
+           <widget class="QPushButton" name="Ce">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Cerium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ce</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="13">
+           <widget class="QPushButton" name="Fe">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Iron</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Fe</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="18">
+           <widget class="QPushButton" name="Al">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Aluminium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Al</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="10">
+           <widget class="QPushButton" name="Th">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Thorium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Th</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="15">
+           <widget class="QPushButton" name="Ni">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Nickel</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ni</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="18">
+           <widget class="QPushButton" name="Dy">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Dysprosium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Dy</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="23">
+           <widget class="QPushButton" name="Lr">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Lawrencium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Lr</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="12">
+           <widget class="QPushButton" name="Tc">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Technetium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Tc</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="16">
+           <widget class="QPushButton" name="Au">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Gold</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Au</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="6">
+           <widget class="QLabel" name="label_14">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  3</string>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="16">
+           <widget class="QPushButton" name="Cm">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Curium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Cm</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="11">
+           <widget class="QPushButton" name="Pa">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Protactinium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Pa</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="18">
+           <widget class="QPushButton" name="Ga">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Gallium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ga</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="19">
+           <widget class="QPushButton" name="Sn">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Tin</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Sn</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="14">
+           <widget class="QPushButton" name="Rh">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Rhodium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Rh</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="21">
+           <widget class="QPushButton" name="Te">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Tellurium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Te</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="17">
+           <widget class="QPushButton" name="Hg">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Mercury</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Hg</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="13">
+           <widget class="QPushButton" name="Os">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Osmium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Os</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="20">
+           <widget class="QPushButton" name="N">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Nitrogen</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>N</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="15">
+           <widget class="QPushButton" name="Pd">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Palladium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Pd</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="22">
+           <widget class="QPushButton" name="No">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Nobelium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>No</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="8">
+           <widget class="QPushButton" name="La">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Lanthanum</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>La</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="14">
+           <widget class="QPushButton" name="Pu">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Plutonium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Pu</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="20">
+           <widget class="QPushButton" name="P">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Phosphorus</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>P</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="23">
+           <widget class="QPushButton" name="Kr">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Krypton</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Kr</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="22">
+           <widget class="QPushButton" name="F">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Flourine</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>F</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="12">
+           <widget class="QPushButton" name="Re">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Rhenium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Re</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="21">
+           <widget class="QPushButton" name="Se">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Selenium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Se</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="10" column="23">
+           <widget class="QPushButton" name="He">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Helium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>He</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="19">
+           <widget class="QPushButton" name="Ho">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Holmium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ho</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="18">
+           <widget class="QPushButton" name="Cf">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Californium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Cf</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="13">
+           <widget class="QPushButton" name="Ru">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Ruthenium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ru</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="19">
+           <widget class="QPushButton" name="Si">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Silicon</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Si</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="20">
+           <widget class="QPushButton" name="Bi">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Bismuth</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Bi</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="20">
+           <widget class="QPushButton" name="Sb">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Antimony</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Sb</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="13">
+           <widget class="QPushButton" name="Pm">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Promethium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Pm</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="13">
+           <widget class="QPushButton" name="Hs">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Hassium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Hs</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="21">
+           <widget class="QPushButton" name="O">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Oxygen</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>O</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="15">
+           <widget class="QPushButton" name="Pt">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Platinum</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Pt</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="11">
+           <widget class="QPushButton" name="Pr">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Praseodymium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Pr</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="23">
+           <widget class="QPushButton" name="Rn">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Radon</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Rn</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="20">
+           <widget class="QPushButton" name="Fm">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Fermium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Fm</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="12">
+           <widget class="QPushButton" name="Nd">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Neodymium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Nd</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="17">
+           <widget class="QPushButton" name="Bk">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Berkelium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Bk</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="22">
+           <widget class="QPushButton" name="Yb">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Ytterbium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Yb</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="23">
+           <widget class="QPushButton" name="Lu">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="focusPolicy">
+             <enum>Qt::StrongFocus</enum>
+            </property>
+            <property name="toolTip">
+             <string>Lutetium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Lu</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="autoExclusive">
+             <bool>false</bool>
+            </property>
+            <property name="autoDefault">
+             <bool>false</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="21">
+           <widget class="QPushButton" name="Tm">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Thulium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Tm</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="23">
+           <widget class="QPushButton" name="Ar">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Argon</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ar</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="21" column="15">
+           <widget class="QPushButton" name="Eu">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Europium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Eu</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="22" column="15">
+           <widget class="QPushButton" name="Am">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Americium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Am</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="6">
+           <widget class="QPushButton" name="Sc">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Scandium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Sc</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="10">
+           <widget class="QPushButton" name="Db">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Dubnium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Db</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="10">
+           <widget class="QPushButton" name="Ta">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Tantalum</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ta</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="8">
+           <widget class="QPushButton" name="Zr">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Zirconium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Zr</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="8">
+           <widget class="QPushButton" name="Rf">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Rutherfordium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Rf</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="2">
+           <widget class="QPushButton" name="Fr">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Fracium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Fr</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="8">
+           <widget class="QPushButton" name="Ti">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Titanium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ti</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="11">
+           <widget class="QLabel" name="label_17">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  6</string>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="10">
+           <widget class="QPushButton" name="Nb">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Niobium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Nb</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="8">
+           <widget class="QPushButton" name="Hf">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Hafnium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Hf</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="10">
+           <widget class="QLabel" name="label_16">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  5</string>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="11">
+           <widget class="QPushButton" name="W">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Tungsten</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>W</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="11">
+           <widget class="QPushButton" name="Mo">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Molybdenum</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Mo</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="10">
+           <widget class="QPushButton" name="V">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Vanadium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>V</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="11">
+           <widget class="QPushButton" name="Cr">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Chromium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Cr</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="4">
+           <widget class="QPushButton" name="Ra">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Radium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Ra</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="23">
+           <widget class="QPushButton" name="Xe">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Xenon</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Xe</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="1">
+           <widget class="QLabel" name="label_33">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  4</string>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="1">
+           <widget class="QLabel" name="label_34">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  5</string>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="1">
+           <widget class="QLabel" name="label_35">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  6</string>
+            </property>
+           </widget>
+          </item>
+          <item row="16" column="1">
+           <widget class="QLabel" name="label_36">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  7</string>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="1">
+           <widget class="QLabel" name="label_32">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  3</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="2">
+           <widget class="QLabel" name="label_11">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>1</string>
+            </property>
+           </widget>
+          </item>
+          <item row="3" column="23">
+           <widget class="QLabel" name="label_29">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>18</string>
+            </property>
+           </widget>
+          </item>
+          <item row="13" column="2">
+           <widget class="QPushButton" name="K">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Potassium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>K</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="15" column="2">
+           <widget class="QPushButton" name="Cs">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Cesium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Cs</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="2">
+           <widget class="QPushButton" name="Li">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Lithium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Li</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="14" column="2">
+           <widget class="QPushButton" name="Rb">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Rubidium</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Rb</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="10" column="2">
+           <widget class="QPushButton" name="H">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>Hydrogen</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>H</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="checked">
+             <bool>false</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="11" column="1">
+           <widget class="QLabel" name="label_31">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  2</string>
+            </property>
+           </widget>
+          </item>
+          <item row="12" column="2">
+           <widget class="QPushButton" name="Na">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="font">
+             <font>
+              <weight>50</weight>
+              <bold>false</bold>
+              <stylestrategy>PreferAntialias</stylestrategy>
+              <kerning>true</kerning>
+             </font>
+            </property>
+            <property name="toolTip">
+             <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Sodium&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            </property>
+            <property name="autoFillBackground">
+             <bool>false</bool>
+            </property>
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string>Na</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+            <property name="default">
+             <bool>false</bool>
+            </property>
+            <property name="flat">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="10" column="1">
+           <widget class="QLabel" name="label_30">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="text">
+             <string>  1</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QDockWidget" name="Groups">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>106</width>
+       <height>221</height>
+      </size>
+     </property>
+     <property name="features">
+      <set>QDockWidget::NoDockWidgetFeatures</set>
+     </property>
+     <property name="windowTitle">
+      <string>Groups</string>
+     </property>
+     <widget class="QWidget" name="dockWidgetContents">
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <widget class="QLabel" name="label">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>127</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Alkali Metals&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_7">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>116</red>
+               <green>116</green>
+               <blue>116</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>174</red>
+               <green>174</green>
+               <blue>174</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>145</red>
+               <green>145</green>
+               <blue>145</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>58</red>
+               <green>58</green>
+               <blue>58</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>77</red>
+               <green>77</green>
+               <blue>77</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>116</red>
+               <green>116</green>
+               <blue>116</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>58</red>
+               <green>58</green>
+               <blue>58</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>116</red>
+               <green>116</green>
+               <blue>116</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>174</red>
+               <green>174</green>
+               <blue>174</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>145</red>
+               <green>145</green>
+               <blue>145</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>58</red>
+               <green>58</green>
+               <blue>58</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>77</red>
+               <green>77</green>
+               <blue>77</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>116</red>
+               <green>116</green>
+               <blue>116</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>58</red>
+               <green>58</green>
+               <blue>58</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>58</red>
+               <green>58</green>
+               <blue>58</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>116</red>
+               <green>116</green>
+               <blue>116</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>174</red>
+               <green>174</green>
+               <blue>174</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>145</red>
+               <green>145</green>
+               <blue>145</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>58</red>
+               <green>58</green>
+               <blue>58</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>77</red>
+               <green>77</green>
+               <blue>77</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>58</red>
+               <green>58</green>
+               <blue>58</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>58</red>
+               <green>58</green>
+               <blue>58</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>116</red>
+               <green>116</green>
+               <blue>116</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>116</red>
+               <green>116</green>
+               <blue>116</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>116</red>
+               <green>116</green>
+               <blue>116</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Post-transition Metals&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_12">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Halogens&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_4">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>213</green>
+               <blue>223</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>149</green>
+               <blue>175</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>42</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>56</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>213</green>
+               <blue>223</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>149</green>
+               <blue>175</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>42</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>56</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>42</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>213</green>
+               <blue>223</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>149</green>
+               <blue>175</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>42</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>56</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>42</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>42</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Actinides&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_9">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>63</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>63</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>127</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>63</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Unknown Properties&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_10">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>213</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>191</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>113</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>212</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>213</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>191</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>113</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>212</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>213</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>191</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>113</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Noble Gases&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_5">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>85</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>234</red>
+               <green>213</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>202</red>
+               <green>149</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>42</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>113</red>
+               <green>56</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>85</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>212</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>85</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>234</red>
+               <green>213</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>202</red>
+               <green>149</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>42</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>113</red>
+               <green>56</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>85</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>212</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>42</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>85</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>234</red>
+               <green>213</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>202</red>
+               <green>149</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>42</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>113</red>
+               <green>56</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>42</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>42</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>85</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>85</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>85</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Lanthanides&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_8">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>212</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>113</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>212</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>212</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>113</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>212</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>212</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>113</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Metalloids&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_2">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>212</red>
+               <green>212</green>
+               <blue>159</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>85</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>113</red>
+               <green>113</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>212</red>
+               <green>212</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>212</red>
+               <green>212</green>
+               <blue>159</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>85</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>113</red>
+               <green>113</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>212</red>
+               <green>212</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>85</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>212</red>
+               <green>212</green>
+               <blue>159</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>85</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>113</red>
+               <green>113</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>85</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>85</red>
+               <green>85</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>170</red>
+               <green>170</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Alkaline Earth Metals&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_3">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>213</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>191</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>113</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>212</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>213</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>191</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>113</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>212</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>213</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>191</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>113</green>
+               <blue>170</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>85</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Other Non-Metals&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_6">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>117</horstretch>
+           <verstretch>100</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="palette">
+          <palette>
+           <active>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>159</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </active>
+           <inactive>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>159</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </inactive>
+           <disabled>
+            <colorrole role="WindowText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Button">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Light">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>127</red>
+               <green>255</green>
+               <blue>191</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Midlight">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>63</red>
+               <green>255</green>
+               <blue>159</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Dark">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Mid">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>170</green>
+               <blue>84</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Text">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="BrightText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>255</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ButtonText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>127</green>
+               <blue>63</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Base">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Window">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="Shadow">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="AlternateBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>255</green>
+               <blue>127</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipBase">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>255</red>
+               <green>255</green>
+               <blue>220</blue>
+              </color>
+             </brush>
+            </colorrole>
+            <colorrole role="ToolTipText">
+             <brush brushstyle="SolidPattern">
+              <color alpha="255">
+               <red>0</red>
+               <green>0</green>
+               <blue>0</blue>
+              </color>
+             </brush>
+            </colorrole>
+           </disabled>
+          </palette>
+         </property>
+         <property name="font">
+          <font>
+           <pointsize>7</pointsize>
+           <weight>50</weight>
+           <bold>false</bold>
+          </font>
+         </property>
+         <property name="autoFillBackground">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;Transition Metals&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp
index d46513eaa59cf012890e4b7ee3894ccd98692372..3ad561e5019a923d90a5984de5195e873b12d367 100644
--- a/Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp
+++ b/Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp
@@ -35,30 +35,29 @@ using namespace MantidQt::MantidWidgets;
  *
  * @param parent :: pointer to the parent QObject.
  */
-FindFilesThread::FindFilesThread(QObject *parent) :
-  QThread(parent), m_error(), m_filenames(), m_valueForProperty(), m_text(),
-  m_algorithm(), m_property(), m_isForRunFiles(), m_isOptional()
-{
-}
+FindFilesThread::FindFilesThread(QObject *parent)
+    : QThread(parent), m_error(), m_filenames(), m_valueForProperty(), m_text(),
+      m_algorithm(), m_property(), m_isForRunFiles(), m_isOptional() {}
 
 /**
  * Set the values needed for the thread to run.
  *
- * @param text              :: the text containing the file names, typed in by the user
+ * @param text              :: the text containing the file names, typed in by
+ *the user
  * @param isForRunFiles     :: whether or not we are finding run files.
  * @param isOptional        :: whether or not the files are optional.
- * @param algorithmProperty :: the algorithm and property to use as an alternative to FileFinder.  Optional.
+ * @param algorithmProperty :: the algorithm and property to use as an
+ *alternative to FileFinder.  Optional.
  */
-void FindFilesThread::set(QString text, bool isForRunFiles, bool isOptional, const QString & algorithmProperty)
-{
+void FindFilesThread::set(QString text, bool isForRunFiles, bool isOptional,
+                          const QString &algorithmProperty) {
   m_text = text.trimmed().toStdString();
   m_isForRunFiles = isForRunFiles;
   m_isOptional = isOptional;
 
   QStringList elements = algorithmProperty.split("|");
 
-  if( elements.size() == 2 )
-  {
+  if (elements.size() == 2) {
     m_algorithm = elements[0];
     m_property = elements[1];
   }
@@ -66,24 +65,25 @@ void FindFilesThread::set(QString text, bool isForRunFiles, bool isOptional, con
 
 /**
  * Called when the thread is ran via start().  Tries to find the files, and
- * populates the error and filenames member variables with the result of the search.
+ * populates the error and filenames member variables with the result of the
+ *search.
  *
  * At present, there are two possible use cases:
  *
  * 1. Files are found directly by the FileFinder.  This is the default case.
- * 2. Files are found using the specified algorithm property.  In this case, a class user must have
- *    specified the algorithm and property via MWRunFiles::setAlgorithmProperty().
+ * 2. Files are found using the specified algorithm property.  In this case, a
+ *class user must have
+ *    specified the algorithm and property via
+ *MWRunFiles::setAlgorithmProperty().
  */
-void FindFilesThread::run()
-{
+void FindFilesThread::run() {
   // Reset result member vars.
   m_error.clear();
   m_filenames.clear();
   m_valueForProperty.clear();
 
-  if( m_text.empty() )
-  {
-    if( m_isOptional )
+  if (m_text.empty()) {
+    if (m_isOptional)
       m_error = "";
     else
       m_error = "No files specified.";
@@ -91,61 +91,52 @@ void FindFilesThread::run()
     return;
   }
 
-  Mantid::API::FileFinderImpl & fileSearcher = Mantid::API::FileFinder::Instance();
+  Mantid::API::FileFinderImpl &fileSearcher =
+      Mantid::API::FileFinder::Instance();
 
-  try
-  {
-    // Use the property of the algorithm to find files, if one has been specified.
-    if( m_algorithm.length() != 0 && m_property.length() != 0 )
-    {
+  try {
+    // Use the property of the algorithm to find files, if one has been
+    // specified.
+    if (m_algorithm.length() != 0 && m_property.length() != 0) {
       getFilesFromAlgorithm();
     }
     // Else if we are loading run files, then use findRuns.
-    else if( m_isForRunFiles )
-    {
+    else if (m_isForRunFiles) {
       m_filenames = fileSearcher.findRuns(m_text);
       m_valueForProperty = "";
-      for(auto cit = m_filenames.begin(); cit != m_filenames.end(); ++cit)
-      {
+      for (auto cit = m_filenames.begin(); cit != m_filenames.end(); ++cit) {
         m_valueForProperty += QString::fromStdString(*cit) + ",";
       }
       m_valueForProperty.chop(1);
     }
-    // Else try to run a simple parsing on the string, and find the full paths individually.
-    else
-    {
+    // Else try to run a simple parsing on the string, and find the full paths
+    // individually.
+    else {
       // Tokenise on ","
       std::vector<std::string> filestext;
       filestext = boost::split(filestext, m_text, boost::is_any_of(","));
 
       // Iterate over tokens.
       auto it = filestext.begin();
-      for( ; it != filestext.end(); ++it)
-      {
+      for (; it != filestext.end(); ++it) {
         boost::algorithm::trim(*it);
         std::string result = fileSearcher.getFullPath(*it);
         Poco::File test(result);
-        if ( ( ! result.empty() ) && test.exists() )
-        {
+        if ((!result.empty()) && test.exists()) {
           m_filenames.push_back(*it);
           m_valueForProperty += QString::fromStdString(*it) + ",";
-        }
-        else
-        {
+        } else {
           throw std::invalid_argument("File \"" + (*it) + "\" not found");
         }
       }
       m_valueForProperty.chop(1);
     }
-  }
-  catch(std::exception& exc)
-  {
+  } catch (std::exception &exc) {
     m_error = exc.what();
     m_filenames.clear();
-  }
-  catch(...)
-  {
-    m_error = "An unknown error occurred while trying to locate the file(s). Please contact the development team";
+  } catch (...) {
+    m_error = "An unknown error occurred while trying to locate the file(s). "
+              "Please contact the development team";
     m_filenames.clear();
   }
 }
@@ -153,11 +144,14 @@ void FindFilesThread::run()
 /**
  * Create a list of files from the given algorithm property.
  */
-void FindFilesThread::getFilesFromAlgorithm()
-{
-  Mantid::API::IAlgorithm_sptr algorithm = Mantid::API::AlgorithmManager::Instance().createUnmanaged(m_algorithm.toStdString());
+void FindFilesThread::getFilesFromAlgorithm() {
+  Mantid::API::IAlgorithm_sptr algorithm =
+      Mantid::API::AlgorithmManager::Instance().createUnmanaged(
+          m_algorithm.toStdString());
 
-  if(!algorithm) throw std::invalid_argument("Cannot create algorithm " + m_algorithm.toStdString() + ".");
+  if (!algorithm)
+    throw std::invalid_argument("Cannot create algorithm " +
+                                m_algorithm.toStdString() + ".");
 
   algorithm->initialize();
   const std::string propName = m_property.toStdString();
@@ -165,64 +159,66 @@ void FindFilesThread::getFilesFromAlgorithm()
 
   Property *prop = algorithm->getProperty(propName);
   m_valueForProperty = QString::fromStdString(prop->value());
-  
-  FileProperty *fileProp = dynamic_cast<FileProperty*>(prop);
-  MultipleFileProperty *multiFileProp = dynamic_cast<MultipleFileProperty*>(prop);
 
-  if( fileProp )
-  {
+  FileProperty *fileProp = dynamic_cast<FileProperty *>(prop);
+  MultipleFileProperty *multiFileProp =
+      dynamic_cast<MultipleFileProperty *>(prop);
+
+  if (fileProp) {
     m_filenames.push_back(fileProp->value());
-  }
-  else if( multiFileProp )
-  {
-    // This flattens any summed files to a set of single files so that you lose the information about
+  } else if (multiFileProp) {
+    // This flattens any summed files to a set of single files so that you lose
+    // the information about
     // what was summed
-    std::vector<std::vector<std::string> > filenames = algorithm->getProperty(propName);
-    std::vector<std::string> flattenedNames = MultipleFileProperty::flattenFileNames(filenames);
-
-    for( auto filename = flattenedNames.begin(); filename != flattenedNames.end(); ++filename )
-    {
-      m_filenames.push_back( *filename );
+    std::vector<std::vector<std::string>> filenames =
+        algorithm->getProperty(propName);
+    std::vector<std::string> flattenedNames =
+        MultipleFileProperty::flattenFileNames(filenames);
+
+    for (auto filename = flattenedNames.begin();
+         filename != flattenedNames.end(); ++filename) {
+      m_filenames.push_back(*filename);
     }
   }
-
 }
 
 ////////////////////////////////////////////////////////////////////
 // MWRunFiles
 ////////////////////////////////////////////////////////////////////
 
-MWRunFiles::MWRunFiles(QWidget *parent) 
-  : MantidWidget(parent), m_findRunFiles(true), m_allowMultipleFiles(false), 
-    m_isOptional(false), m_multiEntry(false), m_buttonOpt(Text), m_fileProblem(""),
-    m_entryNumProblem(""), m_algorithmProperty(""), m_fileExtensions(), m_extsAsSingleOption(true),
-    m_liveButtonState(Hide), m_foundFiles(), m_lastFoundFiles(), m_lastDir(), m_fileFilter()
-{
+MWRunFiles::MWRunFiles(QWidget *parent)
+    : MantidWidget(parent), m_findRunFiles(true), m_isForDirectory(false),
+      m_allowMultipleFiles(false), m_isOptional(false), m_multiEntry(false),
+      m_buttonOpt(Text), m_fileProblem(""), m_entryNumProblem(""),
+      m_algorithmProperty(""), m_fileExtensions(), m_extsAsSingleOption(true),
+      m_liveButtonState(Hide), m_foundFiles(), m_lastFoundFiles(), m_lastDir(),
+      m_fileFilter() {
   m_thread = new FindFilesThread(this);
-  
+
   m_uiForm.setupUi(this);
 
-  connect(m_uiForm.fileEditor, SIGNAL(textChanged(const QString &)), this, SIGNAL(fileTextChanged(const QString&)));
-  connect(m_uiForm.fileEditor, SIGNAL(editingFinished()), this, SIGNAL(fileEditingFinished()));
+  connect(m_uiForm.fileEditor, SIGNAL(textChanged(const QString &)), this,
+          SIGNAL(fileTextChanged(const QString &)));
+  connect(m_uiForm.fileEditor, SIGNAL(editingFinished()), this,
+          SIGNAL(fileEditingFinished()));
   connect(m_uiForm.browseBtn, SIGNAL(clicked()), this, SLOT(browseClicked()));
   connect(m_uiForm.browseIco, SIGNAL(clicked()), this, SLOT(browseClicked()));
 
   connect(this, SIGNAL(fileEditingFinished()), this, SLOT(findFiles()));
-  connect(m_uiForm.entryNum, SIGNAL(textChanged(const QString &)), this, SLOT(checkEntry()));
-  connect(m_uiForm.entryNum, SIGNAL(editingFinished()), this, SLOT(checkEntry()));
+  connect(m_uiForm.entryNum, SIGNAL(textChanged(const QString &)), this,
+          SLOT(checkEntry()));
+  connect(m_uiForm.entryNum, SIGNAL(editingFinished()), this,
+          SLOT(checkEntry()));
 
   connect(m_thread, SIGNAL(finished()), this, SLOT(inspectThreadResult()));
   connect(m_thread, SIGNAL(finished()), this, SIGNAL(fileFindingFinished()));
 
   m_uiForm.fileEditor->clear();
-  
-  if (m_multiEntry)
-  {
+
+  if (m_multiEntry) {
     m_uiForm.entryNum->show();
     m_uiForm.numEntries->show();
-  }
-  else
-  {
+  } else {
     m_uiForm.entryNum->hide();
     m_uiForm.numEntries->hide();
   }
@@ -230,34 +226,42 @@ MWRunFiles::MWRunFiles(QWidget *parent)
   doButtonOpt(m_buttonOpt);
 
   liveButtonState(m_liveButtonState);
-  connect(this, SIGNAL(liveButtonSetEnabledSignal(bool)), m_uiForm.liveButton, SLOT(setEnabled(bool)));
-  connect(this, SIGNAL(liveButtonSetEnabledSignal(bool)), m_uiForm.liveButton, SLOT(show()));
-  connect(m_uiForm.liveButton, SIGNAL(toggled(bool)), this, SIGNAL(liveButtonPressed(bool)));
+  connect(this, SIGNAL(liveButtonSetEnabledSignal(bool)), m_uiForm.liveButton,
+          SLOT(setEnabled(bool)));
+  connect(this, SIGNAL(liveButtonSetEnabledSignal(bool)), m_uiForm.liveButton,
+          SLOT(show()));
+  connect(m_uiForm.liveButton, SIGNAL(toggled(bool)), this,
+          SIGNAL(liveButtonPressed(bool)));
 
   setFocusPolicy(Qt::StrongFocus);
   setFocusProxy(m_uiForm.fileEditor);
 
-  // When first used try to starting directory better than the directory MantidPlot is installed in
+  // When first used try to starting directory better than the directory
+  // MantidPlot is installed in
   // First try default save directory
-  m_lastDir = QString::fromStdString(Mantid::Kernel::ConfigService::Instance().getString("defaultsave.directory"));
+  m_lastDir = QString::fromStdString(
+      Mantid::Kernel::ConfigService::Instance().getString(
+          "defaultsave.directory"));
 
   // If that fails pick the first data search directory
-  if(m_lastDir.isEmpty())
-  {
-    QStringList dataDirs = QString::fromStdString(Mantid::Kernel::ConfigService::Instance().getString("datasearch.directories")).split(";", QString::SkipEmptyParts);
+  if (m_lastDir.isEmpty()) {
+    QStringList dataDirs =
+        QString::fromStdString(
+            Mantid::Kernel::ConfigService::Instance().getString(
+                "datasearch.directories")).split(";", QString::SkipEmptyParts);
 
-    if(!dataDirs.isEmpty())
+    if (!dataDirs.isEmpty())
       m_lastDir = dataDirs[0];
   }
 
-  //this for accepts drops, but the underlying text input does not.
+  // this for accepts drops, but the underlying text input does not.
   this->setAcceptDrops(true);
   m_uiForm.fileEditor->setAcceptDrops(false);
 }
 
-MWRunFiles::~MWRunFiles() 
-{
-  // Before destruction, make sure the file finding thread has stopped running. Wait if necessary.
+MWRunFiles::~MWRunFiles() {
+  // Before destruction, make sure the file finding thread has stopped running.
+  // Wait if necessary.
   m_thread->exit(-1);
   m_thread->wait();
 }
@@ -266,62 +270,64 @@ MWRunFiles::~MWRunFiles()
 * Returns if this widget is for run file searching or not
 * @returns True if this widget searches for run files, false otherwise
 */
-bool MWRunFiles::isForRunFiles() const
-{
-  return m_findRunFiles;
-}
+bool MWRunFiles::isForRunFiles() const { return m_findRunFiles; }
 
 /**
 * Sets whether this widget is for run file searching or not
 * @param mode :: True if this widget searches for run files, false otherwise
 */
-void MWRunFiles::isForRunFiles(const bool mode)
-{
-  m_findRunFiles = mode;
+void MWRunFiles::isForRunFiles(const bool mode) { m_findRunFiles = mode; }
+
+/**
+ * Returns if this widget is for selecting a directory or not.
+ * @return True if selecting a directory
+ */
+bool MWRunFiles::isForDirectory() const { return m_isForDirectory; }
+
+/**
+ * Sets directory searching mode.
+ * @param mode True to search for directories only
+ */
+void MWRunFiles::isForDirectory(const bool mode) {
+  clear();
+  m_isForDirectory = mode;
 }
 
 /**
 * Return the label text on the widget
 * @returns The current value of the text on the label
 */
-QString MWRunFiles::getLabelText() const
-{ 
-  return m_uiForm.textLabel->text();
-}
+QString MWRunFiles::getLabelText() const { return m_uiForm.textLabel->text(); }
 
 /**
 * Set the text on the label
 * @param text :: A string giving the label to use for the text
 */
-void MWRunFiles::setLabelText(const QString & text) 
-{ 
+void MWRunFiles::setLabelText(const QString &text) {
   m_uiForm.textLabel->setText(text);
-  m_uiForm.textLabel->setVisible( ! text.isEmpty() );
+  m_uiForm.textLabel->setVisible(!text.isEmpty());
 }
 
 /** Set the minimum width on the label widget
  *  @param width The new minimum width of the widget
  */
-void MWRunFiles::setLabelMinWidth(const int width)
-{
+void MWRunFiles::setLabelMinWidth(const int width) {
   m_uiForm.textLabel->setMinimumWidth(width);
 }
 
 /**
-* Return whether this widget allows multiple files to be specified within the edit box
+* Return whether this widget allows multiple files to be specified within the
+* edit box
 * @returns True if multiple files can be specified, false otherwise
 */
-bool MWRunFiles::allowMultipleFiles() const
-{
-  return m_allowMultipleFiles;
-}
+bool MWRunFiles::allowMultipleFiles() const { return m_allowMultipleFiles; }
 
 /**
 * Set whether this widget allows multiple files to be specifed or not
-* @param allow :: If true then the widget will accept multiple files else only a single file may be specified
+* @param allow :: If true then the widget will accept multiple files else only a
+* single file may be specified
 */
-void MWRunFiles::allowMultipleFiles(const bool allow)
-{
+void MWRunFiles::allowMultipleFiles(const bool allow) {
   m_allowMultipleFiles = allow;
   findFiles();
 }
@@ -329,17 +335,13 @@ void MWRunFiles::allowMultipleFiles(const bool allow)
 /**
 * Return whether empty input is allowed
 */
-bool MWRunFiles::isOptional() const
-{
-  return m_isOptional;
-}
+bool MWRunFiles::isOptional() const { return m_isOptional; }
 
 /**
 * Sets if the text field is optional
 * @param optional :: Set the optional status of the text field
 */
-void MWRunFiles::isOptional(const bool optional)
-{
+void MWRunFiles::isOptional(const bool optional) {
   m_isOptional = optional;
   findFiles();
 }
@@ -348,30 +350,22 @@ void MWRunFiles::isOptional(const bool optional)
 * Returns the preference for how the dialog control should be
 * @return the setting
 */
-MWRunFiles::ButtonOpts MWRunFiles::doButtonOpt() const
-{
-  return m_buttonOpt;
-}
+MWRunFiles::ButtonOpts MWRunFiles::doButtonOpt() const { return m_buttonOpt; }
 
 /**
 * Set how the browse should appear
-* @param buttonOpt the preference for the control, if there will be one, to activate the dialog box
+* @param buttonOpt the preference for the control, if there will be one, to
+* activate the dialog box
 */
-void MWRunFiles::doButtonOpt(const MWRunFiles::ButtonOpts buttonOpt)
-{
+void MWRunFiles::doButtonOpt(const MWRunFiles::ButtonOpts buttonOpt) {
   m_buttonOpt = buttonOpt;
-  if (buttonOpt == None)
-  {
+  if (buttonOpt == None) {
     m_uiForm.browseBtn->hide();
     m_uiForm.browseIco->hide();
-  }
-  else if (buttonOpt == Text)
-  {
+  } else if (buttonOpt == Text) {
     m_uiForm.browseBtn->show();
     m_uiForm.browseIco->hide();
-  }
-  else if (buttonOpt == Icon)
-  {
+  } else if (buttonOpt == Icon) {
     m_uiForm.browseBtn->hide();
     m_uiForm.browseIco->show();
   }
@@ -382,25 +376,18 @@ void MWRunFiles::doButtonOpt(const MWRunFiles::ButtonOpts buttonOpt)
 * normal situation) of one entry
 * @return true if the widget is to look for multiple entries
 */
-bool MWRunFiles::doMultiEntry() const
-{
-  return m_multiEntry;
-}
+bool MWRunFiles::doMultiEntry() const { return m_multiEntry; }
 
 /**
 * Set to true to enable the period number box
 * @param multiEntry whether to show the multiperiod box
 */
-void MWRunFiles::doMultiEntry(const bool multiEntry)
-{
+void MWRunFiles::doMultiEntry(const bool multiEntry) {
   m_multiEntry = multiEntry;
-  if (m_multiEntry)
-  {
+  if (m_multiEntry) {
     m_uiForm.entryNum->show();
     m_uiForm.numEntries->show();
-  }
-  else
-  {
+  } else {
     m_uiForm.entryNum->hide();
     m_uiForm.numEntries->hide();
   }
@@ -411,101 +398,86 @@ void MWRunFiles::doMultiEntry(const bool multiEntry)
 * Returns the algorithm name
 * @returns The algorithm name
 */
-QString MWRunFiles::getAlgorithmProperty() const
-{
-  return m_algorithmProperty;
-}
+QString MWRunFiles::getAlgorithmProperty() const { return m_algorithmProperty; }
 
 /**
 * Sets an algorithm name that can be tied to this widget
-* @param text :: The name of the algorithm and property in the form [AlgorithmName|PropertyName]
+* @param text :: The name of the algorithm and property in the form
+* [AlgorithmName|PropertyName]
 */
-void MWRunFiles::setAlgorithmProperty(const QString & text)
-{
+void MWRunFiles::setAlgorithmProperty(const QString &text) {
   m_algorithmProperty = text;
 }
 /**
 * Returns the list of file extensions the widget will search for.
 * @return list of file extensions
 */
-QStringList MWRunFiles::getFileExtensions() const
-{
-  return m_fileExtensions;
-}
+QStringList MWRunFiles::getFileExtensions() const { return m_fileExtensions; }
 /**
-* Sets the list of file extensions the dialog will search for. Only taken notice of if AlgorithmProperty not set.
+* Sets the list of file extensions the dialog will search for. Only taken notice
+* of if AlgorithmProperty not set.
 * @param extensions :: list of file extensions
 */
-void MWRunFiles::setFileExtensions(const QStringList & extensions)
-{
+void MWRunFiles::setFileExtensions(const QStringList &extensions) {
   m_fileExtensions = extensions;
   m_fileFilter.clear();
 }
 
 /**
- * Returns whether the file dialog should display the exts as a single list or as multiple items
+ * Returns whether the file dialog should display the exts as a single list or
+ * as multiple items
  * @return boolean
  */
-bool MWRunFiles::extsAsSingleOption() const
-{
-  return m_extsAsSingleOption;
-}
+bool MWRunFiles::extsAsSingleOption() const { return m_extsAsSingleOption; }
 
 /**
- * Sets whether the file dialog should display the exts as a single list or as multiple items
- * @param value :: If true the file dialog wil contain a single entry will all filters
+ * Sets whether the file dialog should display the exts as a single list or as
+ * multiple items
+ * @param value :: If true the file dialog wil contain a single entry will all
+ * filters
  */
-void MWRunFiles::extsAsSingleOption(const bool value)
-{
+void MWRunFiles::extsAsSingleOption(const bool value) {
   m_extsAsSingleOption = value;
 }
 
 /// Returns whether the live button is being shown;
-MWRunFiles::LiveButtonOpts MWRunFiles::liveButtonState() const
-{
+MWRunFiles::LiveButtonOpts MWRunFiles::liveButtonState() const {
   return m_liveButtonState;
 }
 
-void MWRunFiles::liveButtonState(const LiveButtonOpts option)
-{
+void MWRunFiles::liveButtonState(const LiveButtonOpts option) {
   m_liveButtonState = option;
-  if ( m_liveButtonState == Hide )
-  {
+  if (m_liveButtonState == Hide) {
     m_uiForm.liveButton->hide();
-  }
-  else
-  {
-    liveButtonSetEnabled(false); // This setting ensures right outcome if the connection check fails
-    // Checks (asynchronously) whether it's possible to connect to the user's default instrument
+  } else {
+    liveButtonSetEnabled(false); // This setting ensures right outcome if the
+                                 // connection check fails
+    // Checks (asynchronously) whether it's possible to connect to the user's
+    // default instrument
     QtConcurrent::run(this, &MWRunFiles::checkLiveConnection);
-    if ( m_liveButtonState == AlwaysShow )
-    {
+    if (m_liveButtonState == AlwaysShow) {
       m_uiForm.liveButton->show();
     }
   }
 }
 
-void MWRunFiles::checkLiveConnection()
-{
+void MWRunFiles::checkLiveConnection() {
   // Checks whether it's possible to connect to the user's default instrument
-  if ( LiveListenerFactory::Instance().checkConnection(ConfigService::Instance().getInstrument().name()) )
-  {
+  if (LiveListenerFactory::Instance().checkConnection(
+          ConfigService::Instance().getInstrument().name())) {
     emit liveButtonSetEnabledSignal(true);
   }
 }
 
-void MWRunFiles::liveButtonSetEnabled(const bool enabled)
-{
+void MWRunFiles::liveButtonSetEnabled(const bool enabled) {
   m_uiForm.liveButton->setEnabled(enabled);
 }
 
-void MWRunFiles::liveButtonSetChecked(const bool checked)
-{
+void MWRunFiles::liveButtonSetChecked(const bool checked) {
   m_uiForm.liveButton->setChecked(checked);
 }
 
-bool MWRunFiles::liveButtonIsChecked() const
-{
+bool MWRunFiles::liveButtonIsChecked() const {
   return m_uiForm.liveButton->isChecked();
 }
 
@@ -513,14 +485,10 @@ bool MWRunFiles::liveButtonIsChecked() const
 * Is the input within the widget valid?
 * @returns True of the file names within the widget are valid, false otherwise
 */
-bool MWRunFiles::isValid() const
-{
-  if( m_uiForm.valid->isHidden() )
-  {
+bool MWRunFiles::isValid() const {
+  if (m_uiForm.valid->isHidden()) {
     return true;
-  }
-  else
-  {
+  } else {
     return false;
   }
 }
@@ -529,66 +497,54 @@ bool MWRunFiles::isValid() const
  * Is the widget currently searching
  * @return True if a search is inprogress
  */
-bool MWRunFiles::isSearching() const
-{
+bool MWRunFiles::isSearching() const {
   return (m_thread ? m_thread->isRunning() : false);
 }
 
-
-/** 
+/**
 * Returns the names of the files found
 * @return an array of filenames entered in the box
 */
-QStringList MWRunFiles::getFilenames() const
-{
-  return m_foundFiles;
-}
+QStringList MWRunFiles::getFilenames() const { return m_foundFiles; }
 
 /** Safer than using getRunFiles()[0] in the situation were there are no files
-*  @return an empty string is returned if no input files have been defined or one of the files can't be found, otherwise it's the name of the first input file
-*  @throw invalid_argument if one of the files couldn't be found it then no filenames are returned
+*  @return an empty string is returned if no input files have been defined or
+* one of the files can't be found, otherwise it's the name of the first input
+* file
+*  @throw invalid_argument if one of the files couldn't be found it then no
+* filenames are returned
 */
-QString MWRunFiles::getFirstFilename() const
-{
-  if( m_foundFiles.isEmpty() )
+QString MWRunFiles::getFirstFilename() const {
+  if (m_foundFiles.isEmpty())
     return "";
   else
     return m_foundFiles[0];
 }
 
-
 /** Check if any text, valid or not, has been entered into the line edit
 *  @return true if no text has been entered
 */
-bool MWRunFiles::isEmpty() const
-{
+bool MWRunFiles::isEmpty() const {
   return m_uiForm.fileEditor->text().isEmpty();
 }
 
 /** The verbatum, unexpanded text, that was entered into the box
 *  @return the contents shown in the Line Edit
 */
-QString MWRunFiles::getText() const
-{
-  return m_uiForm.fileEditor->text();
-}
+QString MWRunFiles::getText() const { return m_uiForm.fileEditor->text(); }
 
 /** The number the user entered into the entryNum lineEdit
 * or NO_ENTRY_NUM on error. Checking if isValid is true should
 * eliminate the possiblity of getting NO_ENTRY_NUM
 */
-int MWRunFiles::getEntryNum() const
-{
-  if ( m_uiForm.entryNum->text().isEmpty() || (! m_multiEntry) )
-  {
+int MWRunFiles::getEntryNum() const {
+  if (m_uiForm.entryNum->text().isEmpty() || (!m_multiEntry)) {
     return ALL_ENTRIES;
   }
-  if  (isValid())
-  {
+  if (isValid()) {
     bool isANumber;
     const int period = m_uiForm.entryNum->text().toInt(&isANumber);
-    if (isANumber)
-    {
+    if (isANumber) {
       return period;
     }
   }
@@ -598,8 +554,7 @@ int MWRunFiles::getEntryNum() const
 /** Set the entry displayed in the box to this value
 * @param num the period number to use
 */
-void MWRunFiles::setEntryNum(const int num)
-{
+void MWRunFiles::setEntryNum(const int num) {
   m_uiForm.entryNum->setText(QString::number(num));
 }
 
@@ -610,8 +565,7 @@ void MWRunFiles::setEntryNum(const int num)
  * NOTE: This knows nothing of periods yet
  * @returns A QVariant containing the text string for the algorithm property
  */
-QVariant MWRunFiles::getUserInput() const
-{
+QVariant MWRunFiles::getUserInput() const {
   return QVariant(m_thread->valueForProperty());
 }
 
@@ -623,13 +577,12 @@ QVariant MWRunFiles::getUserInput() const
  * @param value A QString containing text to be entered into the widget
  */
 
-void MWRunFiles::setText(const QString & value)
-{
+void MWRunFiles::setText(const QString &value) {
   m_uiForm.fileEditor->setText(value);
 }
 
 /**
- * Sets a value on the widget through a common interface. The 
+ * Sets a value on the widget through a common interface. The
  * QVariant is assumed to be text and to contain a file string. Note that this
  * is primarily here for use within the AlgorithmDialog.
  *
@@ -638,20 +591,20 @@ void MWRunFiles::setText(const QString & value)
  *
  * @param value A QVariant containing user text
  */
-void MWRunFiles::setUserInput(const QVariant & value)
-{
+void MWRunFiles::setUserInput(const QVariant &value) {
   m_uiForm.fileEditor->setText(value.toString());
   m_uiForm.fileEditor->setModified(true);
   emit fileEditingFinished(); // Which is connected to slot findFiles()
 }
 
 /**
- * Flag a problem with the file the user entered, an empty string means no error but
- * there may be an error with the entry box if enabled. Errors passed here are shown first
+ * Flag a problem with the file the user entered, an empty string means no error
+ * but
+ * there may be an error with the entry box if enabled. Errors passed here are
+ * shown first
  * @param message :: A message to include or "" for no error
  */
-void MWRunFiles::setFileProblem(const QString & message)
-{
+void MWRunFiles::setFileProblem(const QString &message) {
   m_fileProblem = message;
   refreshValidator();
 }
@@ -660,17 +613,13 @@ void MWRunFiles::setFileProblem(const QString & message)
 * Return the error.
 * @returns A string explaining the error.
 */
-QString MWRunFiles::getFileProblem()
-{
-  return m_fileProblem;
-}
+QString MWRunFiles::getFileProblem() { return m_fileProblem; }
 
 /**
 * Save settings to the given group
 * @param group :: The name of the group key to save to
 */
-void MWRunFiles::saveSettings(const QString & group)
-{
+void MWRunFiles::saveSettings(const QString &group) {
   QSettings settings;
   settings.beginGroup(group);
 
@@ -681,62 +630,61 @@ void MWRunFiles::saveSettings(const QString & group)
 
 /** Writes the total number of periods in a file to the NumEntries
 *  Qlabel
-*  @param number the number to write, if this is < 1 a ? will be displayed in it's place
+*  @param number the number to write, if this is < 1 a ? will be displayed in
+* it's place
 */
-void MWRunFiles::setNumberOfEntries(const int number)
-{
+void MWRunFiles::setNumberOfEntries(const int number) {
   const QString total = number > 0 ? QString::number(number) : "?";
-  {
-    m_uiForm.numEntries->setText("/"+total);
-  }
+  { m_uiForm.numEntries->setText("/" + total); }
 }
 
-/** Inform the widget of a running instance of MonitorLiveData to be used in stopLiveListener().
- *  Note that the type passed in is IAlgorithm and that no check is made that it actually refers
+/** Inform the widget of a running instance of MonitorLiveData to be used in
+ * stopLiveListener().
+ *  Note that the type passed in is IAlgorithm and that no check is made that it
+ * actually refers
  *  to an instance of MonitorLiveData.
  *  @param monitorLiveData The running algorithm
  */
-void MWRunFiles::setLiveAlgorithm(const IAlgorithm_sptr& monitorLiveData)
-{
+void MWRunFiles::setLiveAlgorithm(const IAlgorithm_sptr &monitorLiveData) {
   m_monitorLiveData = monitorLiveData;
 }
 
 /**
  * Gets the instrument currently set by the override property.
  *
- * If no override is set then the instrument set by default instrument configurtion
+ * If no override is set then the instrument set by default instrument
+ *configurtion
  * option will be used and this function returns an empty string.
  *
  * @return Name of instrument, empty if not set
  */
-QString MWRunFiles::getInstrumentOverride()
-{
-  return m_defaultInstrumentName;
-}
+QString MWRunFiles::getInstrumentOverride() { return m_defaultInstrumentName; }
 
 /**
  * Sets an instrument to fix the widget to.
  *
- * If an instrument name is geven then the widget will only look for files for that
- * instrument, providing na empty string will remove this restriction and will search
+ * If an instrument name is geven then the widget will only look for files for
+ *that
+ * instrument, providing na empty string will remove this restriction and will
+ *search
  * using the default instrument.
  *
  * @param instName Name of instrument, empty to disable override
  */
-void MWRunFiles::setInstrumentOverride(const QString & instName)
-{
+void MWRunFiles::setInstrumentOverride(const QString &instName) {
   m_defaultInstrumentName = instName;
 }
 
-/** 
-* Set the file text.  This is different to setText in that it emits findFiles, as well
-* changing the state of the text box widget to "modified = true" which is a prerequisite
+/**
+* Set the file text.  This is different to setText in that it emits findFiles,
+*as well
+* changing the state of the text box widget to "modified = true" which is a
+*prerequisite
 * of findFiles.
 *
 * @param text :: The text string to set
 */
-void MWRunFiles::setFileTextWithSearch(const QString & text)
-{
+void MWRunFiles::setFileTextWithSearch(const QString &text) {
   setFileTextWithoutSearch(text);
   findFiles();
 }
@@ -744,80 +692,95 @@ void MWRunFiles::setFileTextWithSearch(const QString & text)
 * Set the file text but do not search
 * @param text :: The text string to set
 */
-void MWRunFiles::setFileTextWithoutSearch(const QString & text)
-{
+void MWRunFiles::setFileTextWithoutSearch(const QString &text) {
   m_uiForm.fileEditor->setText(text);
   m_uiForm.fileEditor->setModified(true);
 }
 
+/**
+ * Clears the search string and found files from the widget.
+ */
+void MWRunFiles::clear() {
+  m_foundFiles.clear();
+  m_uiForm.fileEditor->setText("");
+}
+
 /**
 * Finds the files specified by the user in a background thread.
 */
-void MWRunFiles::findFiles()
-{
-  if(m_uiForm.fileEditor->isModified())
-  {
+void MWRunFiles::findFiles() {
+  // Set the values for the thread, and start it running.
+  QString searchText = m_uiForm.fileEditor->text();
+
+  if (m_isForDirectory) {
+    m_foundFiles.clear();
+    if (searchText.isEmpty()) {
+      setFileProblem("A directory must be provided");
+    } else {
+      setFileProblem("");
+      m_foundFiles.append(searchText);
+    }
+    return;
+  }
+
+  if (m_uiForm.fileEditor->isModified()) {
     // Reset modified flag.
     m_uiForm.fileEditor->setModified(false);
 
     // If the thread is running, cancel it.
-    if( m_thread->isRunning() )
-    {
+    if (m_thread->isRunning()) {
       m_thread->exit(-1);
       m_thread->wait();
     }
 
     emit findingFiles();
 
-    // Set the values for the thread, and start it running.
-    QString searchText = m_uiForm.fileEditor->text();
-
-    // If we have an override instrument then add it in appropriate places to the search text
-    if (!m_defaultInstrumentName.isEmpty())
-    {
-      // Regex to match a selection of run numbers as defined here: mantidproject.org/MultiFileLoading
+    // If we have an override instrument then add it in appropriate places to
+    // the search text
+    if (!m_defaultInstrumentName.isEmpty()) {
+      // Regex to match a selection of run numbers as defined here:
+      // mantidproject.org/MultiFileLoading
       // Also allowing spaces between delimiters as this seems to work fine
-      boost::regex runNumbers("([0-9]+)([:+-] ?[0-9]+)? ?(:[0-9]+)?", boost::regex::extended);
+      boost::regex runNumbers("([0-9]+)([:+-] ?[0-9]+)? ?(:[0-9]+)?",
+                              boost::regex::extended);
       // Regex to match a list of run numbers delimited by commas
-      boost::regex runNumberList("([0-9]+)(, ?[0-9]+)*", boost::regex::extended);
+      boost::regex runNumberList("([0-9]+)(, ?[0-9]+)*",
+                                 boost::regex::extended);
 
       // See if we can just prepend the instrument and be done
-      if (boost::regex_match(searchText.toStdString(), runNumbers))
-      {
+      if (boost::regex_match(searchText.toStdString(), runNumbers)) {
         searchText = m_defaultInstrumentName + searchText;
       }
       // If it is a list we need to prepend the instrument to all run numbers
-      else if (boost::regex_match(searchText.toStdString(), runNumberList))
-      {
+      else if (boost::regex_match(searchText.toStdString(), runNumberList)) {
         QStringList runNumbers = searchText.split(",", QString::SkipEmptyParts);
         QStringList newRunNumbers;
 
-        for(auto it = runNumbers.begin(); it != runNumbers.end(); ++it)
+        for (auto it = runNumbers.begin(); it != runNumbers.end(); ++it)
           newRunNumbers << m_defaultInstrumentName + (*it).simplified();
 
         searchText = newRunNumbers.join(",");
       }
     }
 
-    m_thread->set(searchText, isForRunFiles(), this->isOptional(), m_algorithmProperty);
+    m_thread->set(searchText, isForRunFiles(), this->isOptional(),
+                  m_algorithmProperty);
     m_thread->start();
-  }
-  else
-  {
+  } else {
     // Make sure errors are correctly set if we didn't run
     inspectThreadResult();
   }
 }
 
 /** Calls cancel on a running instance of MonitorLiveData.
- *  Requires that a handle to the MonitorLiveData instance has been set via setLiveListener()
- *  @return A handle to the cancelled algorithm (usable if the method is called directly)
+ *  Requires that a handle to the MonitorLiveData instance has been set via
+ * setLiveListener()
+ *  @return A handle to the cancelled algorithm (usable if the method is called
+ * directly)
  */
-IAlgorithm_const_sptr MWRunFiles::stopLiveAlgorithm()
-{
+IAlgorithm_const_sptr MWRunFiles::stopLiveAlgorithm() {
   IAlgorithm_const_sptr theAlgorithmBeingCancelled = m_monitorLiveData;
-  if ( m_monitorLiveData && m_monitorLiveData->isRunning() )
-  {
+  if (m_monitorLiveData && m_monitorLiveData->isRunning()) {
     m_monitorLiveData->cancel();
     m_monitorLiveData.reset();
   }
@@ -828,14 +791,12 @@ IAlgorithm_const_sptr MWRunFiles::stopLiveAlgorithm()
  * Called when the file finding thread finishes.  Inspects the result
  * of the thread, and emits fileFound() if it has been successful.
  */
-void MWRunFiles::inspectThreadResult()
-{
+void MWRunFiles::inspectThreadResult() {
   // Get results from the file finding thread.
   std::string error = m_thread->error();
   std::vector<std::string> filenames = m_thread->filenames();
 
-  if( !error.empty() )
-  {
+  if (!error.empty()) {
     setFileProblem(QString::fromStdString(error));
     return;
   }
@@ -843,43 +804,42 @@ void MWRunFiles::inspectThreadResult()
   m_lastFoundFiles = m_foundFiles;
   m_foundFiles.clear();
 
-  for( size_t i = 0; i < filenames.size(); ++i)
-  {
+  for (size_t i = 0; i < filenames.size(); ++i) {
     m_foundFiles.append(QString::fromStdString(filenames[i]));
   }
-  if( m_foundFiles.isEmpty() && !isOptional() )
-  {
-    setFileProblem("No files found. Check search paths and instrument selection.");
-  }
-  else if( m_foundFiles.count() > 1 && this->allowMultipleFiles() == false )
-  {
+  if (m_foundFiles.isEmpty() && !isOptional()) {
+    setFileProblem(
+        "No files found. Check search paths and instrument selection.");
+  } else if (m_foundFiles.count() > 1 && this->allowMultipleFiles() == false) {
     setFileProblem("Multiple files specified.");
-  }
-  else
-  {
+  } else {
     setFileProblem("");
   }
 
   // Only emit the signal if file(s) were found
-  if ( ! m_foundFiles.isEmpty() ) emit filesFound();
-  if ( m_lastFoundFiles != m_foundFiles ) emit filesFoundChanged();
+  if (!m_foundFiles.isEmpty())
+    emit filesFound();
+  if (m_lastFoundFiles != m_foundFiles)
+    emit filesFoundChanged();
 }
 
 /**
 * Read settings from the given group
 * @param group :: The name of the group key to retrieve data from
 */
-void MWRunFiles::readSettings(const QString & group)
-{
+void MWRunFiles::readSettings(const QString &group) {
   QSettings settings;
   settings.beginGroup(group);
 
   m_lastDir = settings.value("last_directory", "").toString();
 
-  if ( m_lastDir == "" )
-  {
-    QStringList datadirs = QString::fromStdString(Mantid::Kernel::ConfigService::Instance().getString("datasearch.directories")).split(";", QString::SkipEmptyParts);
-    if ( ! datadirs.isEmpty() ) m_lastDir = datadirs[0];
+  if (m_lastDir == "") {
+    QStringList datadirs =
+        QString::fromStdString(
+            Mantid::Kernel::ConfigService::Instance().getString(
+                "datasearch.directories")).split(";", QString::SkipEmptyParts);
+    if (!datadirs.isEmpty())
+      m_lastDir = datadirs[0];
   }
 
   settings.endGroup();
@@ -889,100 +849,83 @@ void MWRunFiles::readSettings(const QString & group)
 * Set a new file filter for the file dialog based on the given extensions
 * @returns A string containing the file filter
 */
-QString MWRunFiles::createFileFilter()
-{
+QString MWRunFiles::createFileFilter() {
   QStringList fileExts;
-  if( m_algorithmProperty.isEmpty() )
-  {
-    if ( !m_fileExtensions.isEmpty() )
-    {
+  if (m_algorithmProperty.isEmpty()) {
+    if (!m_fileExtensions.isEmpty()) {
       fileExts = m_fileExtensions;
-    }
-    else if( isForRunFiles() )
-    {
-      std::vector<std::string> exts = ConfigService::Instance().getFacility().extensions();
-      for( std::vector<std::string>::iterator ex= exts.begin(); ex != exts.end(); ++ex )
-      {
+    } else if (isForRunFiles()) {
+      std::vector<std::string> exts =
+          ConfigService::Instance().getFacility().extensions();
+      for (std::vector<std::string>::iterator ex = exts.begin();
+           ex != exts.end(); ++ex) {
         fileExts.append(QString::fromStdString(*ex));
       }
+    } else {
     }
-    else {}
-  }
-  else
-  {
+  } else {
     QStringList elements = m_algorithmProperty.split("|");
-    if( elements.size() == 2 )
-    {
+    if (elements.size() == 2) {
       fileExts = getFileExtensionsFromAlgorithm(elements[0], elements[1]);
     }
   }
 
   QString allFiles("All Files (*.*)");
-  if( !fileExts.isEmpty() )
-  {
-    
-    // The list may contain upper and lower cased versions, ensure these are on the same line
+  if (!fileExts.isEmpty()) {
+
+    // The list may contain upper and lower cased versions, ensure these are on
+    // the same line
     // I want this ordered
-    QList<QPair<QString, QStringList> > finalIndex;
+    QList<QPair<QString, QStringList>> finalIndex;
     QStringListIterator sitr(fileExts);
     QString ext = sitr.next();
     finalIndex.append(qMakePair(ext.toUpper(), QStringList(ext)));
-    while( sitr.hasNext() )
-    {
+    while (sitr.hasNext()) {
       ext = sitr.next();
       QString key = ext.toUpper();
       bool found(false);
       const int itemCount = finalIndex.count();
-      for( int i = 0 ; i < itemCount; ++i )
-      {
-        if( key == finalIndex[i].first )
-        {
+      for (int i = 0; i < itemCount; ++i) {
+        if (key == finalIndex[i].first) {
           finalIndex[i].second.append(ext);
           found = true;
           break;
         }
       }
-      if( !found )
-      {
+      if (!found) {
         finalIndex.append(qMakePair(key, QStringList(ext)));
       }
     }
 
-    // The file filter consists of three parts, which we will combine to create the
+    // The file filter consists of three parts, which we will combine to create
+    // the
     // complete file filter:
     QString dataFiles("Data Files (");
     QString individualFiles("");
 
-    if( extsAsSingleOption() )
-    {
-      QListIterator<QPair<QString, QStringList> > itr(finalIndex);
-      while( itr.hasNext() )
-      {
+    if (extsAsSingleOption()) {
+      QListIterator<QPair<QString, QStringList>> itr(finalIndex);
+      while (itr.hasNext()) {
         const QStringList values = itr.next().second;
-        
+
         individualFiles += "*" + values.join(" *") + ";;";
         dataFiles += "*" + values.join(" *") + " ";
       }
-      //Don't remove final ;; from individualFiles as we are going to tack on allFiles anyway
+      // Don't remove final ;; from individualFiles as we are going to tack on
+      // allFiles anyway
       dataFiles.chop(1); // Remove last space
       dataFiles += ");;";
-    }
-    else
-    {
-      QListIterator<QPair<QString, QStringList> > itr(finalIndex);
-      while( itr.hasNext() )
-      {
+    } else {
+      QListIterator<QPair<QString, QStringList>> itr(finalIndex);
+      while (itr.hasNext()) {
         const QStringList values = itr.next().second;
         dataFiles += "*" + values.join(" *") + ";;";
       }
     }
     return dataFiles + individualFiles + allFiles;
-  }
-  else
-  {
+  } else {
     return allFiles;
   }
-  
 }
 
 /**
@@ -991,44 +934,42 @@ QString MWRunFiles::createFileFilter()
 * @param propName :: The name of the property
 * @returns A list of file extensions
 */
-QStringList MWRunFiles::getFileExtensionsFromAlgorithm(const QString & algName, const QString &propName)
-{
-  Mantid::API::IAlgorithm_sptr algorithm = Mantid::API::AlgorithmManager::Instance().createUnmanaged(algName.toStdString());
+QStringList
+MWRunFiles::getFileExtensionsFromAlgorithm(const QString &algName,
+                                           const QString &propName) {
+  Mantid::API::IAlgorithm_sptr algorithm =
+      Mantid::API::AlgorithmManager::Instance().createUnmanaged(
+          algName.toStdString());
   QStringList fileExts;
-  if(!algorithm) return fileExts;
+  if (!algorithm)
+    return fileExts;
   algorithm->initialize();
   Property *prop = algorithm->getProperty(propName.toStdString());
-  FileProperty *fileProp = dynamic_cast<FileProperty*>(prop);
-  MultipleFileProperty *multiFileProp = dynamic_cast<MultipleFileProperty*>(prop);
+  FileProperty *fileProp = dynamic_cast<FileProperty *>(prop);
+  MultipleFileProperty *multiFileProp =
+      dynamic_cast<MultipleFileProperty *>(prop);
 
   std::vector<std::string> allowed;
   QString preferredExt;
 
-  if( fileProp )
-  {
+  if (fileProp) {
     allowed = fileProp->allowedValues();
     preferredExt = QString::fromStdString(fileProp->getDefaultExt());
-  }
-  else if( multiFileProp )
-  {
+  } else if (multiFileProp) {
     allowed = multiFileProp->allowedValues();
     preferredExt = QString::fromStdString(multiFileProp->getDefaultExt());
-  }
-  else
-  {
+  } else {
     return fileExts;
   }
 
   std::vector<std::string>::const_iterator iend = allowed.end();
   int index(0);
-  for(std::vector<std::string>::const_iterator it = allowed.begin(); it != iend; ++it)
-  {
-    if ( ! it->empty() )
-    {
+  for (std::vector<std::string>::const_iterator it = allowed.begin();
+       it != iend; ++it) {
+    if (!it->empty()) {
       QString ext = QString::fromStdString(*it);
       fileExts.append(ext);
-      if( ext == preferredExt )
-      {
+      if (ext == preferredExt) {
         fileExts.move(index, 0);
       }
       ++index;
@@ -1042,98 +983,91 @@ QStringList MWRunFiles::getFileExtensionsFromAlgorithm(const QString & algName,
 *  files
 *  @return the names of the selected files as a comma separated list
 */
-QString MWRunFiles::openFileDialog()
-{
+QString MWRunFiles::openFileDialog() {
   QStringList filenames;
   QString dir = m_lastDir;
 
-  if( m_fileFilter.isEmpty() )
-  {
+  if (m_fileFilter.isEmpty()) {
     m_fileFilter = createFileFilter();
   }
 
-  if ( m_allowMultipleFiles )
-  {
-    filenames = QFileDialog::getOpenFileNames(this, "Open file", dir, m_fileFilter);
-  }
-  else
-  {
-    QString file = QFileDialog::getOpenFileName(this, "Open file", dir, m_fileFilter);
-    if(  !file.isEmpty() ) filenames.append(file);
+  if (m_isForDirectory) {
+    QString file =
+        QFileDialog::getExistingDirectory(this, "Select directory", dir);
+    if (!file.isEmpty())
+      filenames.append(file);
+  } else if (m_allowMultipleFiles) {
+    filenames =
+        QFileDialog::getOpenFileNames(this, "Open file", dir, m_fileFilter);
+  } else {
+    QString file =
+        QFileDialog::getOpenFileName(this, "Open file", dir, m_fileFilter);
+    if (!file.isEmpty())
+      filenames.append(file);
   }
 
-  if(filenames.isEmpty())
-  {
+  if (filenames.isEmpty()) {
     return "";
   }
   m_lastDir = QFileInfo(filenames.front()).absoluteDir().path();
   return filenames.join(", ");
 }
 
-
-/** flag a problem with the supplied entry number, an empty string means no error.
+/** flag a problem with the supplied entry number, an empty string means no
+* error.
 *  file errors take precedence of these errors
 *  @param message the message to display
 */
-void MWRunFiles::setEntryNumProblem(const QString & message)
-{
+void MWRunFiles::setEntryNumProblem(const QString &message) {
   m_entryNumProblem = message;
   refreshValidator();
 }
 
-/** Checks the data m_fileProblem and m_entryNumProblem to see if the validator label
+/** Checks the data m_fileProblem and m_entryNumProblem to see if the validator
+* label
 *  needs to be displayed
 */
-void MWRunFiles::refreshValidator()
-{
-  if ( ! m_fileProblem.isEmpty() )
-  {
+void MWRunFiles::refreshValidator() {
+  if (!m_fileProblem.isEmpty()) {
     m_uiForm.valid->setToolTip(m_fileProblem);
     m_uiForm.valid->show();
-  }
-  else if ( ! m_entryNumProblem.isEmpty() && m_multiEntry )
-  {
+  } else if (!m_entryNumProblem.isEmpty() && m_multiEntry) {
     m_uiForm.valid->setToolTip(m_entryNumProblem);
     m_uiForm.valid->show();
-  }
-  else
-  {
+  } else {
     m_uiForm.valid->hide();
   }
 }
 
 /** This slot opens a file browser
 */
-void MWRunFiles::browseClicked()
-{
+void MWRunFiles::browseClicked() {
   QString uFile = openFileDialog();
-  if( uFile.trimmed().isEmpty() ) return;
+  if (uFile.trimmed().isEmpty())
+    return;
 
   m_uiForm.fileEditor->setText(uFile);
   m_uiForm.fileEditor->setModified(true);
 
   emit fileEditingFinished();
 }
+
 /** Currently just checks that entryNum contains an int > 0 and hence might be a
 *  valid entry number
 */
-void MWRunFiles::checkEntry()
-{
-  if (m_uiForm.entryNum->text().isEmpty())
-  {
+void MWRunFiles::checkEntry() {
+  if (m_uiForm.entryNum->text().isEmpty()) {
     setEntryNumProblem("");
     return;
   }
 
   bool good;
   const int num = m_uiForm.entryNum->text().toInt(&good);
-  if (! good )
-  {
+  if (!good) {
     setEntryNumProblem("The entry number must be an integer");
     return;
   }
-  if ( num < 1 )
-  {
+  if (num < 1) {
     setEntryNumProblem("The entry number must be an integer > 0");
     return;
   }
@@ -1145,38 +1079,33 @@ void MWRunFiles::checkEntry()
   * Called when an item is dropped
   * @param de :: the drop event data package
   */
-void MWRunFiles::dropEvent(QDropEvent *de)
-{
-  const QMimeData *mimeData = de->mimeData(); 
-  if (mimeData->hasUrls()){
-    auto url_list = mimeData->urls(); 
+void MWRunFiles::dropEvent(QDropEvent *de) {
+  const QMimeData *mimeData = de->mimeData();
+  if (mimeData->hasUrls()) {
+    auto url_list = mimeData->urls();
     m_uiForm.fileEditor->setText(url_list[0].toLocalFile());
     de->acceptProposedAction();
-  }else if (mimeData->hasText()){
+  } else if (mimeData->hasText()) {
     QString text = mimeData->text();
-    m_uiForm.fileEditor->setText(text); 
+    m_uiForm.fileEditor->setText(text);
     de->acceptProposedAction();
   }
-  
 }
 
 /**
   * Called when an item is dragged onto a control
   * @param de :: the drag event data package
   */
-void MWRunFiles::dragEnterEvent(QDragEnterEvent *de)
-{
-  const QMimeData *mimeData = de->mimeData();  
-  if (mimeData->hasUrls()){
-    auto listurl = mimeData->urls(); 
+void MWRunFiles::dragEnterEvent(QDragEnterEvent *de) {
+  const QMimeData *mimeData = de->mimeData();
+  if (mimeData->hasUrls()) {
+    auto listurl = mimeData->urls();
     if (listurl.empty())
       return;
     if (!listurl[0].isLocalFile())
       return;
     de->acceptProposedAction();
-  }
-  else if(mimeData->hasText()) 
-  {
+  } else if (mimeData->hasText()) {
     QString text = mimeData->text();
     if (text.contains(" = mtd[\""))
       de->setDropAction(Qt::IgnoreAction);
diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/PeriodicTableWidget.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/PeriodicTableWidget.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c7144af4da6dab42683359544d22500f2fe906f8
--- /dev/null
+++ b/Code/Mantid/MantidQt/MantidWidgets/src/PeriodicTableWidget.cpp
@@ -0,0 +1,361 @@
+#include "MantidQtMantidWidgets/PeriodicTableWidget.h"
+#include <QVector>
+
+/**
+ * Default constructor
+ * @param parent :: default parameter
+ */
+PeriodicTableWidget::PeriodicTableWidget(QWidget *parent) : QWidget(parent) {
+  ui.setupUi(this);
+  populateGroupVectors();
+  populateAllButtonsVector();
+  ColourElements();
+  ///Hide the legend by default
+  ui.Groups->setVisible(false);
+}
+
+// slot for showing group legend dependant on state of radioButton
+void PeriodicTableWidget::showGroupLegend(bool checked) {
+    if (checked) {
+    ui.Groups->setVisible(true);
+    }
+    else{
+    ui.Groups->setVisible(false);
+  }
+}
+
+void PeriodicTableWidget::ColourElements() {
+  ColourActinides(Actinides);
+  ColourAlkalineEarthMetals(AlkalineEarthMetals);
+  ColourAlkaliMetals(AlkaliMetals);
+  ColourHalogens(Halogens);
+  ColourLanthanides(Lanthanides);
+  ColourMetalloids(Metalloids);
+  ColourNobleGases(NobleGases);
+  ColourNonMetals(OtherNonMetals);
+  ColourPostTransitionMetals(PostTransitionMetals);
+  ColourTransitionMetals(TransitionMetals);
+  ColourUnknownProperties(UnknownProperties);
+}
+void PeriodicTableWidget::ColourActinides(
+    const QVector<QPushButton *> &actinides) {
+  QString buttonColourStr = "background-color: rgb(255, 85, 127, 255)";
+  for (auto i = actinides.begin(); i != actinides.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourAlkaliMetals(
+    const QVector<QPushButton *> &alkaliMetals) {
+  QString buttonColourStr = "background-color: rgb(255, 255, 0, 255)";
+  for (auto i = alkaliMetals.begin(); i != alkaliMetals.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourAlkalineEarthMetals(
+    const QVector<QPushButton *> &alkalineEarthMetals) {
+  QString buttonColourStr = "background-color: rgb(170, 170, 127, 255)";
+  for (auto i = alkalineEarthMetals.begin(); i != alkalineEarthMetals.end();
+       i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourHalogens(
+    const QVector<QPushButton *> &halogens) {
+  QString buttonColourStr = "background-color: rgb(0, 255, 255, 255)";
+  for (auto i = halogens.begin(); i != halogens.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourLanthanides(
+    const QVector<QPushButton *> &lanthanides) {
+  QString buttonColourStr = "background-color: rgb(170, 85, 255, 255)";
+  for (auto i = lanthanides.begin(); i != lanthanides.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourMetalloids(
+    const QVector<QPushButton *> &metalloids) {
+  QString buttonColourStr = "background-color: rgb(255, 170, 255, 255)";
+  for (auto i = metalloids.begin(); i != metalloids.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourNobleGases(
+    const QVector<QPushButton *> &nobleGases) {
+  QString buttonColourStr = "background-color: rgb(255, 170, 0, 255)";
+  for (auto i = nobleGases.begin(); i != nobleGases.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourNonMetals(
+    const QVector<QPushButton *> &nonMetals) {
+  QString buttonColourStr = "background-color: rgb(0, 170, 255, 255)";
+  for (auto i = nonMetals.begin(); i != nonMetals.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourPostTransitionMetals(
+    const QVector<QPushButton *> &postTransMetals) {
+  QString buttonColourStr = "background-color: rgb(116, 116, 116, 255)";
+  for (auto i = postTransMetals.begin(); i != postTransMetals.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourTransitionMetals(
+    const QVector<QPushButton *> &transMetals) {
+  QString buttonColourStr = "background-color: rgb(0, 255, 127, 255)";
+  for (auto i = transMetals.begin(); i != transMetals.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+void PeriodicTableWidget::ColourUnknownProperties(
+    const QVector<QPushButton *> &UnknownProperties) {
+  QString buttonColourStr = "background-color: rgb(255, 0, 0, 255)";
+  for (auto i = UnknownProperties.begin(); i != UnknownProperties.end(); i++) {
+    ColourButton(*i, buttonColourStr);
+    update();
+  }
+}
+
+
+void PeriodicTableWidget::enableButtonByName(QString elementStr) {
+  for (auto vector_i = AllElementButtons.begin();
+       vector_i != AllElementButtons.end(); vector_i++) {
+    for (auto btn_i = (*vector_i).begin(); btn_i != (*vector_i).end();
+         btn_i++) {
+      if (compareButtonNameToStr((*btn_i), elementStr)) {
+        (*btn_i)->setDisabled(false);
+      }
+    }
+  }
+}
+
+bool PeriodicTableWidget::compareButtonNameToStr(QPushButton *buttonToCompare,
+                                                 QString stringToCompare) {
+  return (strcmp(buttonToCompare->text().toStdString().c_str(),
+                 stringToCompare.toStdString().c_str()) == 0);
+}
+
+void PeriodicTableWidget::disableAllElementButtons() {
+  disableButtons(Actinides);
+  disableButtons(AlkaliMetals);
+  disableButtons(AlkalineEarthMetals);
+  disableButtons(Halogens);
+  disableButtons(Lanthanides);
+  disableButtons(Metalloids);
+  disableButtons(NobleGases);
+  disableButtons(OtherNonMetals);
+  disableButtons(PostTransitionMetals);
+  disableButtons(TransitionMetals);
+  disableButtons(UnknownProperties);
+}
+void PeriodicTableWidget::ColourButton(QPushButton *element, QString colourStr) {
+  element->setStyleSheet(
+      "QPushButton{border:1px solid rgb(0, 0, 0); " + colourStr + ";}" +
+      "QPushButton:checked{ background-color:rgb(175,255,255)}" +
+      "QPushButton:!enabled{background-color: rgb(204,204,204);" +
+      "}");
+}
+
+QString
+PeriodicTableWidget::elementsSelectedToString(QVector<QPushButton *> elements) {
+  QString selectedElements = "";
+  /* Loop through QPushButtons and if they are checked
+   * then retrieve the text on the button i.e the
+   * element and add it to the string (space delimiter).
+   */
+  for (auto i = elements.begin(); i != elements.end(); i++) {
+    if ((*i)->isChecked()) {
+      selectedElements += (*i)->text() + ",";
+    }
+  }
+  return selectedElements;
+}
+
+QString PeriodicTableWidget::getAllCheckedElementsStr() {
+  /*checking all groups of buttons to see if they
+  * have been selected in the Widget.
+  * if they have been selected, the button text is added to
+  * the comma-separated list of elements checked.
+  */
+  QString allCheckedElementsStr = "";
+  allCheckedElementsStr += elementsSelectedToString(Actinides);
+  allCheckedElementsStr += elementsSelectedToString(AlkaliMetals);
+  allCheckedElementsStr += elementsSelectedToString(AlkalineEarthMetals);
+  allCheckedElementsStr += elementsSelectedToString(Halogens);
+  allCheckedElementsStr += elementsSelectedToString(Lanthanides);
+  allCheckedElementsStr += elementsSelectedToString(NobleGases);
+  allCheckedElementsStr += elementsSelectedToString(Metalloids);
+  allCheckedElementsStr += elementsSelectedToString(OtherNonMetals);
+  allCheckedElementsStr += elementsSelectedToString(PostTransitionMetals);
+  allCheckedElementsStr += elementsSelectedToString(TransitionMetals);
+  allCheckedElementsStr += elementsSelectedToString(UnknownProperties);
+
+  // return a string with all the elements that have been selected
+  return allCheckedElementsStr;
+}
+
+void PeriodicTableWidget::disableButtons(
+    QVector<QPushButton *> buttonsToDisable) {
+  for (auto i = buttonsToDisable.begin(); i != buttonsToDisable.end(); i++) {
+    (*i)->setDisabled(true);
+  }
+}
+
+void PeriodicTableWidget::populateGroupVectors() {
+  /*Populate Group Vectors with corresponding Element Buttons*/
+
+  // Populate Other Non-Metals
+  OtherNonMetals.push_back(ui.C);  // Carbon
+  OtherNonMetals.push_back(ui.N);  // Nitrogen
+  OtherNonMetals.push_back(ui.H);  // Hydrogen
+  OtherNonMetals.push_back(ui.O);  // Oxygen
+  OtherNonMetals.push_back(ui.Se); // Selenium
+  OtherNonMetals.push_back(ui.S);  // Sulfur
+  OtherNonMetals.push_back(ui.P);  // Phospherus
+  // Populate Alkali Metals
+  AlkaliMetals.push_back(ui.Cs); // Cesium
+  AlkaliMetals.push_back(ui.Fr); // Francium
+  AlkaliMetals.push_back(ui.Li); // Lithium
+  AlkaliMetals.push_back(ui.K);  // Potassium
+  AlkaliMetals.push_back(ui.Rb); // Rubidium
+  AlkaliMetals.push_back(ui.Na); // Sodium
+  // Populate Alkaline Earth Metals
+  AlkalineEarthMetals.push_back(ui.Ba); // Barium
+  AlkalineEarthMetals.push_back(ui.Be); // Beryllium
+  AlkalineEarthMetals.push_back(ui.Ca); // Calcium
+  AlkalineEarthMetals.push_back(ui.Mg); // Magnesium
+  AlkalineEarthMetals.push_back(ui.Ra); // Radium
+  AlkalineEarthMetals.push_back(ui.Sr); // Strontium
+  // Populate Transition Metals
+  TransitionMetals.push_back(ui.Ag); // Silver
+  TransitionMetals.push_back(ui.Au); // Gold
+  TransitionMetals.push_back(ui.Bh); // Bohrium
+  TransitionMetals.push_back(ui.Cd); // Cadmium
+  TransitionMetals.push_back(ui.Cn); // Copernicium
+  TransitionMetals.push_back(ui.Co); // Cobalt
+  TransitionMetals.push_back(ui.Cr); // Chromium
+  TransitionMetals.push_back(ui.Cu); // Copper
+  TransitionMetals.push_back(ui.Db); // Dubnium
+  TransitionMetals.push_back(ui.Fe); // Iron
+  TransitionMetals.push_back(ui.Hf); // Hafnium
+  TransitionMetals.push_back(ui.Hg); // Mercury
+  TransitionMetals.push_back(ui.Hs); // Hassium
+  TransitionMetals.push_back(ui.Ir); // Iridium
+  TransitionMetals.push_back(ui.Mn); // Manganese
+  TransitionMetals.push_back(ui.Mo); // Molybdenum
+  TransitionMetals.push_back(ui.Nb); // Niobium
+  TransitionMetals.push_back(ui.Ni); // Nickel
+  TransitionMetals.push_back(ui.Os); // Osmium
+  TransitionMetals.push_back(ui.Pd); // Palladium
+  TransitionMetals.push_back(ui.Pt); // Platinum
+  TransitionMetals.push_back(ui.Re); // Rhenium
+  TransitionMetals.push_back(ui.Rf); // Rutherfordium
+  TransitionMetals.push_back(ui.Rh); // Rhodium
+  TransitionMetals.push_back(ui.Ru); // Ruthenium
+  TransitionMetals.push_back(ui.Sc); // Scandium
+  TransitionMetals.push_back(ui.Sg); // Seaborgium
+  TransitionMetals.push_back(ui.Ta); // Tantalum
+  TransitionMetals.push_back(ui.Tc); // Technetium
+  TransitionMetals.push_back(ui.Ti); // Titanium
+  TransitionMetals.push_back(ui.V);  // Vanadium
+  TransitionMetals.push_back(ui.W);  // Tungsten
+  TransitionMetals.push_back(ui.Y);  // Yttrium
+  TransitionMetals.push_back(ui.Zn); // Zinc
+  TransitionMetals.push_back(ui.Zr); // Zirconium
+  // Populate Actinides
+  Actinides.push_back(ui.Ac); // Actinium
+  Actinides.push_back(ui.Am); // Americium
+  Actinides.push_back(ui.Bk); // Berkelium
+  Actinides.push_back(ui.Cf); // Californium
+  Actinides.push_back(ui.Cm); // Curium
+  Actinides.push_back(ui.Es); // Einsteinium
+  Actinides.push_back(ui.Fm); // Fermium
+  Actinides.push_back(ui.Lr); // Lawrencium
+  Actinides.push_back(ui.Md); // Mendelevium
+  Actinides.push_back(ui.No); // Nobelium
+  Actinides.push_back(ui.Np); // Neptunium
+  Actinides.push_back(ui.Pa); // Protractinium
+  Actinides.push_back(ui.Pu); // Plutonium
+  Actinides.push_back(ui.Th); // Thorium
+  Actinides.push_back(ui.U);  // Uranium
+  // Populate Lanthanides
+  Lanthanides.push_back(ui.Ce); // Cerium
+  Lanthanides.push_back(ui.Dy); // Dysprosium
+  Lanthanides.push_back(ui.Er); // Erbium
+  Lanthanides.push_back(ui.Eu); // Europium
+  Lanthanides.push_back(ui.Gd); // Gadolinium
+  Lanthanides.push_back(ui.Ho); // Holmium
+  Lanthanides.push_back(ui.La); // Lanthanum
+  Lanthanides.push_back(ui.Lu); // Lutetium
+  Lanthanides.push_back(ui.Nd); // Neodymium
+  Lanthanides.push_back(ui.Pm); // Promethium
+  Lanthanides.push_back(ui.Pr); // Praseodymium
+  Lanthanides.push_back(ui.Sm); // Samarium
+  Lanthanides.push_back(ui.Tb); // Terbium
+  Lanthanides.push_back(ui.Tm); // Thulium
+  Lanthanides.push_back(ui.Yb); // Yttrbium
+  // Populate Unknown Properties
+  UnknownProperties.push_back(ui.Ds);  // Damstadium
+  UnknownProperties.push_back(ui.Fl);  // Flerovium
+  UnknownProperties.push_back(ui.Lv);  // Livermorium
+  UnknownProperties.push_back(ui.Mt);  // Meitnerium
+  UnknownProperties.push_back(ui.Rg);  // Roentgenium
+  UnknownProperties.push_back(ui.Uuo); // Ununoctium
+  UnknownProperties.push_back(ui.Uup); // Ununpentium
+  UnknownProperties.push_back(ui.Uus); // Ununseptium
+  UnknownProperties.push_back(ui.Uut); // Ununtrium
+  // Populate Post-Transition Metals
+  PostTransitionMetals.push_back(ui.Al); // Aluminium
+  PostTransitionMetals.push_back(ui.Bi); // Bismuth
+  PostTransitionMetals.push_back(ui.Ga); // Gallium
+  PostTransitionMetals.push_back(ui.In); // Indium
+  PostTransitionMetals.push_back(ui.Pb); // Lead
+  PostTransitionMetals.push_back(ui.Po); // Polonium
+  PostTransitionMetals.push_back(ui.Sn); // Tin
+  PostTransitionMetals.push_back(ui.Tl); // Thalium
+  // Populate Metalloids
+  Metalloids.push_back(ui.As); // Arsenic
+  Metalloids.push_back(ui.B);  // Boron
+  Metalloids.push_back(ui.Ge); // Germanium
+  Metalloids.push_back(ui.Sb); // Antimony
+  Metalloids.push_back(ui.Si); // Silicon
+  Metalloids.push_back(ui.Te); // Tellurium
+  // Populate Halogens
+  Halogens.push_back(ui.At); // Astatine
+  Halogens.push_back(ui.Cl); // Chlorine
+  Halogens.push_back(ui.Br); // Bromine
+  Halogens.push_back(ui.F);  // Flourine
+  Halogens.push_back(ui.I);  // Iodine
+  // Populate Noble Gases
+  NobleGases.push_back(ui.Ar); // Argon
+  NobleGases.push_back(ui.He); // Helium
+  NobleGases.push_back(ui.Kr); // Krypton
+  NobleGases.push_back(ui.Ne); // Neon
+  NobleGases.push_back(ui.Rn); // Radon
+  NobleGases.push_back(ui.Xe); // Xenon
+}
+
+void PeriodicTableWidget::populateAllButtonsVector() {
+  AllElementButtons.push_back(Actinides);
+  AllElementButtons.push_back(OtherNonMetals);
+  AllElementButtons.push_back(AlkaliMetals);
+  AllElementButtons.push_back(AlkalineEarthMetals);
+  AllElementButtons.push_back(TransitionMetals);
+  AllElementButtons.push_back(Lanthanides);
+  AllElementButtons.push_back(UnknownProperties);
+  AllElementButtons.push_back(PostTransitionMetals);
+  AllElementButtons.push_back(Metalloids);
+  AllElementButtons.push_back(Halogens);
+  AllElementButtons.push_back(NobleGases);
+}
\ No newline at end of file
diff --git a/Code/Mantid/Testing/Data/UnitTest/NaF_DISF.cdl.md5 b/Code/Mantid/Testing/Data/UnitTest/NaF_DISF.cdl.md5
new file mode 100644
index 0000000000000000000000000000000000000000..666beb56eab31af61f09992846a31f955a2a77af
--- /dev/null
+++ b/Code/Mantid/Testing/Data/UnitTest/NaF_DISF.cdl.md5
@@ -0,0 +1 @@
+80494aa80fdbeae27ee67c4a5ebde597
diff --git a/Code/Mantid/Testing/SystemTests/tests/analysis/ISISIndirectSimulationTest.py b/Code/Mantid/Testing/SystemTests/tests/analysis/ISISIndirectSimulationTest.py
index 2e4a6a9d1439611c5f640d3e84538a1950477276..1be4b4a36253c7070cce16c02e804a6bc382abc5 100644
--- a/Code/Mantid/Testing/SystemTests/tests/analysis/ISISIndirectSimulationTest.py
+++ b/Code/Mantid/Testing/SystemTests/tests/analysis/ISISIndirectSimulationTest.py
@@ -6,7 +6,7 @@ import mantid.simpleapi as ms
 class MolDynCdlTest(stresstesting.MantidStressTest):
 
     def runTest(self):
-        ms.MolDyn(Filename='DISF_NaF.cdl',
+        ms.MolDyn(Data='DISF_NaF.cdl',
                   Functions=['Fqt-total', 'Sqw-total'],
                   Plot='None',
                   Save=False,
@@ -56,7 +56,7 @@ class MolDynCdlTest(stresstesting.MantidStressTest):
 class MolDynDatTest(stresstesting.MantidStressTest):
 
     def runTest(self):
-        ms.MolDyn(Filename='WSH_test.dat',
+        ms.MolDyn(Data='WSH_test.dat',
                   Plot='None',
                   Save=False,
                   OutputWorkspace='WSH_test_iqt')
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
index d5fc3f1ecd90bf8286eb31eb5521fdab56cbfff8..c781ebe3bf3eac17f1056065fe625678b245eb4e 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewReaders/MDHWNexusReader/vtkMDHWNexusReader.cxx
@@ -180,11 +180,14 @@ int vtkMDHWNexusReader::RequestInformation(
   
   m_presenter->executeLoadMetadata();
   setTimeRange(outputVector);
-  std::vector<int> extents = dynamic_cast<MDHWNexusLoadingPresenter*>(m_presenter)->getExtents();
-  outputVector->GetInformationObject(0)
-      ->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), &extents[0],
-            static_cast<int>(extents.size()));
-
+  MDHWNexusLoadingPresenter *castPresenter =
+      dynamic_cast<MDHWNexusLoadingPresenter *>(m_presenter);
+  if (castPresenter) {
+    std::vector<int> extents = castPresenter->getExtents();
+    outputVector->GetInformationObject(0)
+        ->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), &extents[0],
+              static_cast<int>(extents.size()));
+  }
   return 1;
 }
 
diff --git a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
index ca9d0fb7dbe5feba4a935959f1c1dd78b5f688f2..ad8e2080bfd5757de5c7e7329749aebb89fc43b1 100644
--- a/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
+++ b/Code/Mantid/Vates/ParaviewPlugins/ParaViewSources/MDHWSource/vtkMDHWSource.cxx
@@ -227,24 +227,30 @@ int vtkMDHWSource::RequestInformation(vtkInformation *vtkNotUsed(request), vtkIn
                                                    new ADSWorkspaceProvider<Mantid::API::IMDHistoWorkspace>,
                                                    m_wsName);
   }
-  if (m_presenter == NULL)
+  if (m_presenter) {
+    if (!m_presenter->canReadFile()) {
+      vtkErrorMacro(<< "Cannot fetch the specified workspace from Mantid ADS.");
+      return 0;
+    } else {
+      m_presenter->executeLoadMetadata();
+      setTimeRange(outputVector);
+      MDHWInMemoryLoadingPresenter *castPresenter =
+          dynamic_cast<MDHWInMemoryLoadingPresenter *>(m_presenter);
+      if (castPresenter) {
+        std::vector<int> extents = castPresenter->getExtents();
+        outputVector->GetInformationObject(0)
+            ->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), &extents[0],
+                  static_cast<int>(extents.size()));
+      }
+      return 1;
+    }
+  } else //(m_presenter == NULL)
   {
-    // updater information has been called prematurely. We will reexecute once all attributes are setup.
+    // updater information has been called prematurely. We will reexecute once
+    // all attributes are setup.
     return 1;
   }
-  if(!m_presenter->canReadFile())
-  {
-    vtkErrorMacro(<<"Cannot fetch the specified workspace from Mantid ADS.");
-    return 0;
-  }
-  m_presenter->executeLoadMetadata();
-  setTimeRange(outputVector);
-  std::vector<int> extents = dynamic_cast<MDHWInMemoryLoadingPresenter*>(m_presenter)->getExtents();
-  outputVector->GetInformationObject(0)
-      ->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), &extents[0],
-            static_cast<int>(extents.size()));
 
-  return 1;
 }
 
 void vtkMDHWSource::PrintSelf(ostream& os, vtkIndent indent)
diff --git a/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHWSignalArray.h b/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHWSignalArray.h
index 17778e71a4dd62bb33fdc69f62e5912e77424ecd..d34976b0d7d85b7fb891d2991970d8973e7c79db 100644
--- a/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHWSignalArray.h
+++ b/Code/Mantid/Vates/VatesAPI/inc/MantidVatesAPI/vtkMDHWSignalArray.h
@@ -487,7 +487,9 @@ void vtkMDHWSignalArray<Scalar>::InsertValue(vtkIdType, Scalar) {
 }
 
 //------------------------------------------------------------------------------
-template <class Scalar> vtkMDHWSignalArray<Scalar>::vtkMDHWSignalArray() {}
+template <class Scalar>
+vtkMDHWSignalArray<Scalar>::vtkMDHWSignalArray()
+    : m_offset(0) {}
 
 //------------------------------------------------------------------------------
 template <class Scalar> vtkMDHWSignalArray<Scalar>::~vtkMDHWSignalArray() {}
diff --git a/Code/Mantid/Vates/VatesAPI/src/Common.cpp b/Code/Mantid/Vates/VatesAPI/src/Common.cpp
index e2e19d031e714e363d3a70444b707b3583babcde..e48e5f16614c44d9e7be15f6977aff3dec902a9a 100644
--- a/Code/Mantid/Vates/VatesAPI/src/Common.cpp
+++ b/Code/Mantid/Vates/VatesAPI/src/Common.cpp
@@ -9,6 +9,7 @@
 #include "vtkPVChangeOfBasisHelper.h"
 
 #include <boost/math/special_functions/fpclassify.hpp>
+#include <boost/regex.hpp>
 
 // using namespace Mantid::Geometry;
 namespace Mantid {
@@ -18,7 +19,11 @@ std::string makeAxisTitle(Dimension_const_sptr dim) {
   title += " (";
   title += dim->getUnits();
   title += ")";
-  return title;
+  // update inverse angstrom symbol so it is rendered in mathtex.
+  // Consider removing after ConvertToMD provides unit labels with latex
+  // symbols.
+  boost::regex re("A\\^-1");
+  return boost::regex_replace(title, re, "$\\\\AA^{-1}$");
 }
 
 void setAxisLabel(std::string metadataLabel, std::string labelString,
diff --git a/Code/Mantid/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp b/Code/Mantid/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp
index 76096de74155c844b3ea43537eb8b20b1852d84a..2081e450c33edbe27e0fedbda37656685879f64f 100644
--- a/Code/Mantid/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp
+++ b/Code/Mantid/Vates/VatesAPI/src/MDHWNexusLoadingPresenter.cpp
@@ -175,8 +175,9 @@ void MDHWNexusLoadingPresenter::loadWorkspace( ProgressAction& loadingProgressUp
     alg->addObserver(observer);
     alg->execute();
     alg->removeObserver(observer);
-    Workspace_sptr result = AnalysisDataService::Instance().retrieve("MD_HISTO_WS_ID");
-    m_histoWs = boost::dynamic_pointer_cast<Mantid::API::IMDHistoWorkspace>(result);
+    m_histoWs =
+        AnalysisDataService::Instance()
+            .retrieveWS<Mantid::API::IMDHistoWorkspace>("MD_HISTO_WS_ID");
 }
 
 }
diff --git a/Code/Mantid/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h b/Code/Mantid/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
index efab02b5bb7d3f2b1e9e8b15eb76fd4c6ff91db1..83063f3b3a4a2b9d49743ea8e1b165f6f9cd606f 100644
--- a/Code/Mantid/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
+++ b/Code/Mantid/Vates/VatesAPI/test/MDHWNexusLoadingPresenterTest.h
@@ -175,13 +175,13 @@ void testAxisLabels()
   TSM_ASSERT_THROWS_NOTHING("Should pass", presenter.setAxisLabels(product));
   TSM_ASSERT_EQUALS("X Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForX"),
-                    "[H,0,0] (in 1.992 A^-1)");
+                    "[H,0,0] (in 1.992 $\\AA^{-1}$)");
   TSM_ASSERT_EQUALS("Y Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForY"),
-                    "[0,K,0] (in 1.992 A^-1)");
+                    "[0,K,0] (in 1.992 $\\AA^{-1}$)");
   TSM_ASSERT_EQUALS("Z Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForZ"),
-                    "[0,0,L] (in 1.087 A^-1)");
+                    "[0,0,L] (in 1.087 $\\AA^{-1}$)");
 
   TS_ASSERT(Mock::VerifyAndClearExpectations(view));
   TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
diff --git a/Code/Mantid/Vates/VatesAPI/test/SQWLoadingPresenterTest.h b/Code/Mantid/Vates/VatesAPI/test/SQWLoadingPresenterTest.h
index 5864dac114190487acefe43b99713ff457ab2afb..682c63ed286759b4453d4fc0469eb04143db2b9d 100644
--- a/Code/Mantid/Vates/VatesAPI/test/SQWLoadingPresenterTest.h
+++ b/Code/Mantid/Vates/VatesAPI/test/SQWLoadingPresenterTest.h
@@ -231,13 +231,13 @@ void testAxisLabels()
   TSM_ASSERT_THROWS_NOTHING("Should pass", presenter.setAxisLabels(product));
   TSM_ASSERT_EQUALS("X Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForX"),
-                    "qx (A^-1)");
+                    "qx ($\\AA^{-1}$)");
   TSM_ASSERT_EQUALS("Y Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForY"),
-                    "qy (A^-1)");
+                    "qy ($\\AA^{-1}$)");
   TSM_ASSERT_EQUALS("Z Label should match exactly",
                     getStringFieldDataValue(product, "AxisTitleForZ"),
-                    "qz (A^-1)");
+                    "qz ($\\AA^{-1}$)");
 
   TS_ASSERT(Mock::VerifyAndClearExpectations(view));
   TS_ASSERT(Mock::VerifyAndClearExpectations(&factory));
diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkMDHistoHex4DFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkMDHistoHex4DFactoryTest.h
index 43fca2b39daa9dc06e1eec652c758df9a28d2138..cacd884f38e46ad3c519bf50652c30b3b836825b 100644
--- a/Code/Mantid/Vates/VatesAPI/test/vtkMDHistoHex4DFactoryTest.h
+++ b/Code/Mantid/Vates/VatesAPI/test/vtkMDHistoHex4DFactoryTest.h
@@ -54,18 +54,18 @@ public:
 
     TS_ASSERT_EQUALS((10*10*10), insideProduct->GetNumberOfCells());
     for (auto i = 0; i < insideProduct->GetNumberOfCells(); ++i) {
-      TS_ASSERT_EQUALS(insideProduct->IsCellVisible(i), true)
+      TS_ASSERT(insideProduct->IsCellVisible(i) != 0);
     }
 
     // This has changed. Cells are still present but not visible.
     TS_ASSERT_EQUALS((10 * 10 * 10), belowProduct->GetNumberOfCells());
     for (auto i = 0; i < belowProduct->GetNumberOfCells(); ++i) {
-      TS_ASSERT_EQUALS(belowProduct->IsCellVisible(i), false)
+      TS_ASSERT(belowProduct->IsCellVisible(i) == 0);
     }
 
     TS_ASSERT_EQUALS((10 * 10 * 10), aboveProduct->GetNumberOfCells());
     for (auto i = 0; i < aboveProduct->GetNumberOfCells(); ++i) {
-      TS_ASSERT_EQUALS(aboveProduct->IsCellVisible(i), false)
+      TS_ASSERT(aboveProduct->IsCellVisible(i) == 0);
     }
   }
 
diff --git a/Code/Mantid/Vates/VatesAPI/test/vtkMDHistoHexFactoryTest.h b/Code/Mantid/Vates/VatesAPI/test/vtkMDHistoHexFactoryTest.h
index 4b5fe94d92416d6fad2d82b5b4cd0858efaa2e4d..b3bb0d8578d76d66bc672c110ddcd9138a15cc94 100644
--- a/Code/Mantid/Vates/VatesAPI/test/vtkMDHistoHexFactoryTest.h
+++ b/Code/Mantid/Vates/VatesAPI/test/vtkMDHistoHexFactoryTest.h
@@ -54,18 +54,18 @@ class vtkMDHistoHexFactoryTest: public CxxTest::TestSuite
 
     TS_ASSERT_EQUALS((10*10*10), insideProduct->GetNumberOfCells());
     for (auto i = 0; i < insideProduct->GetNumberOfCells(); ++i) {
-      TS_ASSERT_EQUALS(insideProduct->IsCellVisible(i), true)
+      TS_ASSERT(insideProduct->IsCellVisible(i) != 0);
     }
 
     // This has changed. Cells are still present but not visible.
     TS_ASSERT_EQUALS((10 * 10 * 10), belowProduct->GetNumberOfCells());
     for (auto i = 0; i < belowProduct->GetNumberOfCells(); ++i) {
-      TS_ASSERT_EQUALS(belowProduct->IsCellVisible(i), false)
+      TS_ASSERT(belowProduct->IsCellVisible(i) == 0);
     }
 
     TS_ASSERT_EQUALS((10 * 10 * 10), aboveProduct->GetNumberOfCells());
     for (auto i = 0; i < aboveProduct->GetNumberOfCells(); ++i) {
-      TS_ASSERT_EQUALS(aboveProduct->IsCellVisible(i), false)
+      TS_ASSERT(aboveProduct->IsCellVisible(i) == 0);
     }
   }
 
diff --git a/Code/Mantid/docs/source/algorithms/CreateSampleWorkspace-v1.rst b/Code/Mantid/docs/source/algorithms/CreateSampleWorkspace-v1.rst
index 0c5c7b3ca29a4130d944b6b0818900c46d6e427a..04e566cc4a19110d6f8e8a7f2b16380e7a08fe26 100644
--- a/Code/Mantid/docs/source/algorithms/CreateSampleWorkspace-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CreateSampleWorkspace-v1.rst
@@ -11,14 +11,14 @@ Description
 
 Creates sample workspaces for usage examples and other situations.
 
-You can select a predefined function for the data or enter your own by
-selecting User Defined in the drop down.
+You can select a predefined function for the data or enter your own by selecting
+User Defined in the drop down.
 
-The data will be the same for each spectrum, and is defined by the
-function selected, and a little noise if Random is selected. All values
-are taken converted to absolute values at present so negative values
-will become positive. For event workspaces the intensity of the graph
-will be affected by the number of events selected.
+The data will be the same for each spectrum, and is defined by the function
+selected, and a little noise if Random is selected. All values are taken
+converted to absolute values at present so negative values will become positive.
+For event workspaces the intensity of the graph will be affected by the number
+of events selected.
 
 Here is an example of a user defined formula containing two peaks and a
 background.::
@@ -32,22 +32,33 @@ workspaces. If Random is selected the results will differ between runs
 of the algorithm and will not be comparable. If comparing the output is
 important set Random to false or uncheck the box.
 
+.. note::
+  For the Quasielastic and Quasielastic Tunnelling presets the XMin and XMax
+  values should be set to a range symmetrical around x=0.
+
 Instrument
 ~~~~~~~~~~
 
-The instrument created by CreateSample workspace is very simple and looks like this.
+The instrument created by CreateSample workspace is very simple and looks like
+this.
 
 .. image:: ../images/CreateSampleWorkspaceInstrument.png
     :width: 100%
-    :alt: A labelled image of the instrument created by CreateSampleWorkspace     
+    :alt: A labelled image of the instrument created by CreateSampleWorkspace
+
+The sample is placed at the origin.  The source is seperated from the sample in
+the negative direction by the vlue you specify in "SourceDistanceFromSample".
+The instrument has "NumBanks" detector banks, each bank is moved down the X axis
+by "BankDistanceFromSample" from the Sample or the previous bank.
 
-The sample is placed at the origin.  The source is seperated from the sample in the negative direction by the vlue you specify in "SourceDistanceFromSample".  The instrument has "NumBanks" detector banks, each bank is moved down the X axis by "BankDistanceFromSample" from the Sample or the previous bank.
-Each bank is a square rectangular bank comprising of "BankPixelWidth" pixels in width and height.  The size of each pixel 4mm square, but additional padding can be set using "PixelSpacing".
+Each bank is a square rectangular bank comprising of "BankPixelWidth" pixels in
+width and height.  The size of each pixel 4mm square, but additional padding can
+be set using "PixelSpacing".
 
 Usage
 -----
 
-**Example - create a simple histogram workspace:**  
+**Example - create a simple histogram workspace:**
 
 .. testcode:: ExHistSimple
 
@@ -57,17 +68,17 @@ Usage
    print "Number of spectra: " +  str(ws.getNumberHistograms())
    print "Number of bins: " +  str(ws.blocksize())
    print "Each spectra has a level backgound of " + str(ws.readY(0)[0]) + \
-    " counts and a peak in the centre of " + str(ws.readY(0)[50]) + " counts."		
+    " counts and a peak in the centre of " + str(ws.readY(0)[50]) + " counts."
 
 Output:
 
 .. testoutput:: ExHistSimple
-   
+
    Number of spectra: 200
    Number of bins: 100
    Each spectra has a level backgound of 0.3 counts and a peak in the centre of 10.3 counts.
 
-**Example - create a simple event workspace:**  
+**Example - create a simple event workspace:**
 
 .. testcode:: ExEventSimple
 
@@ -80,22 +91,22 @@ Output:
    print "Event Workspaces come with bins set by default to a bin width of " + str(ws.readX(0)[1]-ws.readX(0)[0])
    #The data itensity of an EventWorkspce is scaled by the number of events used, so the values differ from the histogram above.
    print "Each spectra has a level backgound of " + str(ws.readY(0)[0]) + \
-   	" counts and a peak in the centre of " + str(ws.readY(0)[50]) + " counts."				
-      
+   	" counts and a peak in the centre of " + str(ws.readY(0)[50]) + " counts."
+
 Output:
 
 .. testoutput:: ExEventSimple
-   
+
    Number of spectra: 200
    Number of bins: 100
    Number of events: 800000
    Event Workspaces come with bins set by default to a bin width of 200.0
    Each spectra has a level backgound of 30.0 counts and a peak in the centre of 1030.0 counts.
 
-**Example - Using the preset functions:**  
+**Example - Using the preset functions:**
 
 .. testcode:: ExHistPresets
-   
+
    # create a workspace with Flat Background
    wsFlat = CreateSampleWorkspace("Histogram","Flat background")
    print "Flat background has a constant value of " + str(wsFlat.readY(0)[0]) + " counts."
@@ -103,7 +114,7 @@ Output:
    # create a workspace with multiple peaks
    wsMulti = CreateSampleWorkspace("Histogram","Multiple Peaks")
    print "Multiple Peaks has a level backgound of " + str(wsMulti.readY(0)[0]),
-   print "counts and two gaussian peaks, the largest of which is " + str(wsMulti.readY(0)[60]) + " counts."	
+   print "counts and two gaussian peaks, the largest of which is " + str(wsMulti.readY(0)[60]) + " counts."
 
    # create a workspace with Exponential Decay
    wsExp = CreateSampleWorkspace("Histogram","Exp Decay")
@@ -117,11 +128,10 @@ Output:
    Multiple Peaks has a level backgound of 0.3 counts and two gaussian peaks, the largest of which is 8.3 counts.
    Exp Decay starts high and drops rapidly to 0.03 counts at 8,000 us (with the default binning).
 
-
-**Example - Using the your own function:**  
+**Example - Using the your own function:**
 
 .. testcode:: ExHistUserFunc
-   
+
    # create a workspace with data defined using the function string below
    myFunc = "name=LinearBackground, A0=0.5;name=Gaussian, PeakCentre=10000, Height=50, Sigma=0.5;name=Gaussian, PeakCentre=1000, Height=80, Sigma=0.5"
 
@@ -131,7 +141,6 @@ Output:
    print "With a peak reaching "+ str(ws.readY(0)[5]) + " counts at 1,000 us,"
    print "and another reaching "+ str(ws.readY(0)[50]) + " counts at 10,000 us."
 
-
 Output:
 
 .. testoutput:: ExHistUserFunc
@@ -140,10 +149,30 @@ Output:
    With a peak reaching 80.5 counts at 1,000 us,
    and another reaching 50.5 counts at 10,000 us.
 
-**Example - Setting every Option:**  
+**Example - Quasielastic:**
+
+.. testcode:: ExQuasielastic
+
+   ws=CreateSampleWorkspace(Function="Quasielastic",
+                            XUnit="DeltaE",
+                            XMin=-0.5,
+                            XMax=0.5,
+                            BinWidth=0.01)
+
+   print "Number of spectra: " +  str(ws.getNumberHistograms())
+   print "Number of bins: " +  str(ws.blocksize())
+
+Output:
+
+.. testoutput:: ExQuasielastic
+
+   Number of spectra: 200
+   Number of bins: 100
+
+**Example - Setting every Option:**
 
 .. testcode:: ExEveryOption
-   
+
    #Random adds a little random noise to the data function
    ws=CreateSampleWorkspace(WorkspaceType="Event",Function="One Peak",NumBanks=4,BankPixelWidth=5,NumEvents=500,Random=True,XUnit="tof",XMin=0, XMax=8000, BinWidth=100)
 
@@ -156,10 +185,7 @@ Output:
 
    Number of spectra: 100
    Number of bins: 80
-   
+
 .. categories::
 
 .. sourcelink::
-
-
-
diff --git a/Code/Mantid/docs/source/algorithms/DNSFlippingRatioCorr-v1.rst b/Code/Mantid/docs/source/algorithms/DNSFlippingRatioCorr-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..9d44906666fbcdddd0594eeb213cd22969d628ae
--- /dev/null
+++ b/Code/Mantid/docs/source/algorithms/DNSFlippingRatioCorr-v1.rst
@@ -0,0 +1,158 @@
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+.. warning::
+
+   This algorithm is being developed for a specific instrument. It might get changed or even 
+   removed without a notification, should instrument scientists decide to do so.
+
+This algorithm applies flipping ratio correction to a given data workspaces. As a result, following workspaces will be created: 
+
+-  output workspace with corrected spin-flip data. Sample logs will be copied from the data spin-flip workspace. 
+-  output workspace with corrected non spin-flip data. Sample logs will be copied from the data non spin-flip workspace. 
+-  if data workspaces have workspaces with normalization data (monitor counts or experiment duration by user's choice), this normalization workspaces will be cloned. The normalization workspace is named same as the output workspace, but has suffix "_NORM". 
+
+Flipping ratio correction is performed using the measurements of :math:`Ni_{0.89}\,Cr_{0.11}` standard sample (hereafter NiCr). Background for NiCr must be also measured and provided to the algorithm as an input. Both, spin-flip anf non spin-flip measurements are required. This algorithm performs the flipping ratio correction for a particular run in following steps:
+
+1. Normalize both, spin-flip (hereafter SF) and non spin-flip (hereafter NSF), workspaces to a chosen normalization:
+
+   :math:`(N^{SF}_i)_{Norm} = \frac{(N^{SF}_i)_{Raw}}{(C^{SF}_i)_N}`
+
+   :math:`(N^{NSF}_i)_{Norm} = \frac{(N^{NSF}_i)_{Raw}}{(C^{NSF}_i)_N}`
+
+   where :math:`(N^{SF,\,NSF}_i)_{Raw}` is the signal from the :math:`i` th detector in the NiCr spin-flip and non spin-flip workspace, respectively and :math:`(C^{SF,\,NSF}_i)_N` is the number in the corresponding bin of the normalization workspace. The :ref:`algm-Divide` algorithm is used for this step.
+
+2. Normalize Background workspace to a chosen normalization:
+
+   :math:`(B^{SF,\,NSF}_i)_{Norm} = \frac{(B^{SF,\,NSF}_i)_{Raw}}{(C^{SF,\,NSF}_i)_B}`
+   
+   where :math:`(B^{SF,\,NSF}_i)_{Raw}` is the signal from the :math:`i` th detector in the spin-flip and non spin-flip background workspace, respectively and :math:`(C^{SF,\,NSF}_i)_B` is the number in the corresponding bin of the normalization workspace. The :ref:`algm-Divide` algorithm is used for this step.
+
+.. warning::
+
+    Normalization workspaces are created by the :ref:`algm-LoadDNSLegacy` algorithm. 
+    It is responsibility of the user to take care about the same type of normalization for given workspaces.
+
+3. Subtract Background from NiCr:
+
+   :math:`N^{SF,\,NSF}_i = (N^{SF,\,NSF}_i)_{Norm} - (B^{SF,\,NSF}_i)_{Norm}`
+
+   The :ref:`algm-Minus` algorithm is used for this step. In the case of negative result, the error message will be produced and the algorithm terminates.
+
+4. Calculate the correction coefficients:
+
+   :math:`k_i = \frac{N^{NSF}_i}{N^{SF}_i}`
+
+   The :ref:`algm-Divide` algorithm is used for this step.
+
+5. Apply correction to the data:
+
+   :math:`(I^{NSF}_i)_{corr0} = I^{NSF}_i - \frac{I^{SF}_i}{k_i}`
+   
+   :math:`(I^{SF}_i)_{corr0} = I^{SF}_i - \frac{I^{NSF}_i}{k_i}`
+
+   where :math:`I^{SF,\,NSF}_i` are the neutron counts in the **SFDataWorkspace** and **NSFDataWorkspace**, respectively.
+
+6. Apply correction for a double spin-flip scattering:
+
+   :math:`(I^{NSF}_i)_{corr} = (I^{NSF}_i)_{corr0} - (I^{SF}_i)_{corr0}\cdot f`
+
+   :math:`(I^{SF}_i)_{corr} = (I^{SF}_i)_{corr0}`
+
+   where :math:`f` is a double spin-flip scattering probability. It is a number between 0 and 1.
+
+
+Valid input workspaces
+######################
+
+The input workspaces have to have the following in order to be valid inputs for this algorithm.
+
+-  The same number of dimensions
+-  The same number of spectra
+-  The same number of bins
+-  All workspaces except of **SFDataWorkspace** and **NSFDataWorkspace** must have the corresponding normalization workspace
+-  All given workspaces must have the same polarisation (algorithm checks for the 'polarisation' sample log)
+-  All given workspaces must have the appropriate flipper status (algorithm checks for 'flipper' sample log): spin-flip workspaces must have flipper 'ON' and non spin-flip workspaces must have flipper 'OFF'
+
+If any of these conditions is not fulfilled, the algorithm terminates.
+
+For the physically meaningful correction it is also important that these workspaces have the same slits size, detector bank rotation angle and the neutron wavelength. If some of these parameters are different, algorithm produces warning. If these properties are not specified in the workspace sample logs, no comparison is performed.
+
+
+Usage
+-----
+
+**Example - Apply flipping ratio correction to a Vanadium run:**
+
+.. code-block:: python
+
+    from os.path import join
+    import numpy as np
+
+    datapath = "/path/to/data/dns/rc36b_standard_dz"
+
+    # define input files.
+    sf_vanafile = join(datapath, 'dz29100525vana.d_dat')
+    nsf_vanafile = join(datapath, 'dz29100526vana.d_dat')
+
+    sf_bkgrfile = join(datapath, 'dz29100645leer.d_dat')
+    nsf_bkgrfile = join(datapath, 'dz29100646leer.d_dat')
+
+    sf_nicrfile = join(datapath, 'dz29100585nicr.d_dat')
+    nsf_nicrfile = join(datapath, 'dz29100586nicr.d_dat')
+
+    # load files to workspaces
+    sf_vana = LoadDNSLegacy(sf_vanafile, Normalization='duration', Polarisation='x')
+    nsf_vana = LoadDNSLegacy(nsf_vanafile, Normalization='duration', Polarisation='x')
+
+    sf_nicr = LoadDNSLegacy(sf_nicrfile, Normalization='duration', Polarisation='x')
+    nsf_nicr = LoadDNSLegacy(nsf_nicrfile, Normalization='duration', Polarisation='x')
+
+    sf_bkgr = LoadDNSLegacy(sf_bkgrfile, Normalization='duration', Polarisation='x')
+    nsf_bkgr = LoadDNSLegacy(nsf_bkgrfile, Normalization='duration', Polarisation='x')
+
+    # for a physically meaningful correction, we must subtract background from Vanadium
+    # this step is usually not required for other kinds of samples
+    # retrieve normalization workspaces
+    sf_vana_norm = mtd['sf_vana_NORM']
+    sf_bkgr_norm = mtd['sf_bkgr_NORM']
+    nsf_vana_norm = mtd['nsf_vana_NORM']
+    nsf_bkgr_norm = mtd['nsf_bkgr_NORM']
+    # subtract background
+    sf_vana_bg = sf_vana/sf_vana_norm - sf_bkgr/sf_bkgr_norm
+    nsf_vana_bg = nsf_vana/nsf_vana_norm - nsf_bkgr/nsf_bkgr_norm
+
+    # apply correction
+    DNSFlippingRatioCorr(sf_vana_bg, nsf_vana_bg, sf_nicr, nsf_nicr, sf_bkgr, nsf_bkgr,
+                         SFOutputWorkspace='sf_corrected', NSFOutputWorkspace='nsf_corrected',
+                         DoubleSpinFlipScatteringProbability=0.03)
+
+    # retrieve output workspaces
+    sf_corrected = mtd['sf_corrected']
+    nsf_corrected = mtd['nsf_corrected']
+
+    # calculate ratio of spin-flip to non spin-flip
+    vana_ratio = sf_corrected/nsf_corrected
+
+    # ratio must be around 2, print first 5 points of the data array
+    print np.around(vana_ratio.extractY()[:5])
+
+Output:
+
+   [[ 2.]
+   [ 2.]
+   [ 2.]
+   [ 2.]
+   [ 2.]]
+
+.. categories::
+
+.. sourcelink::
diff --git a/Code/Mantid/docs/source/algorithms/DNSMergeRuns-v1.rst b/Code/Mantid/docs/source/algorithms/DNSMergeRuns-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..63413ade26d5c4c1e1aa2fe2eb94c5bf9e2f07e8
--- /dev/null
+++ b/Code/Mantid/docs/source/algorithms/DNSMergeRuns-v1.rst
@@ -0,0 +1,120 @@
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+.. warning::
+
+   This algorithm is being developed for a specific instrument. It might get changed or even 
+   removed without a notification, should instrument scientists decide to do so.
+
+This algorithm merges given matrix workspaces to a :ref:`Workspace2D <Workspace2D>`. The purpose of this algorithm is to merge the DNS diffraction mode data measured at different detector bank positions. The algorithm is not suitable to merge DNS single crystal diffraction data measured at different sample rotation angles.
+
+.. note::
+    The **OutputWorkspace** will have no connection to the instrument. Part of the sample logs will be lost either. This algorithm can be executed at any step of the data reduction to view the result. However, further data reduction must be performed on the original workspaces.
+
+As a result, following output will be produced: 
+-  Output workspace with corrected data. Part of sample logs will be copied from the first data workspace. The data will be normalized to monitor or run duration if the **Normalize** option is checked. 
+-  If the **Normalize** option is unchecked, workspace with normalization data (monitor counts or run duration) will be created. The normalization workspace is named same as the data workspace, but has suffix "_NORM". 
+
+.. warning::
+
+    Normalization workspaces are created by the :ref:`algm-LoadDNSLegacy` algorithm. 
+    It is responsibility of the user to take care about the same type of normalization (monitor counts or run duration) for all given workspaces.
+
+Absolute value of the momentum transfer :math:`|Q|` is calculated as
+
+:math:`|Q| = \left|\frac{4\pi\sin\theta}{\lambda}\right|`
+
+where :math:`\theta` is the scattering angle and :math:`\lambda` is the neutron wavelength.
+
+d-Spacing :math:`d` is calculated as:
+
+:math:`d = \left|\frac{\lambda}{2\,\sin\theta}\right|`
+
+Valid input workspaces
+######################
+
+The input workspaces (**WorkspaceNames**) have to have the following in order to be valid inputs for this algorithm.
+
+-  The same number of dimensions
+-  The same number of spectra
+-  The same number of bins
+-  Have the corresponding normalization workspace
+-  Have the same wavelength in the sample logs
+
+For the physically meaningful merge result, it is also important that these workspaces have the same slits size, polarisation, and flipper status. If some of these parameters are different, algorithm produces warning. If these properties are not specified in the workspace sample logs, no comparison is performed.
+
+Usage
+-----
+
+**Example - Merge a set of selected runs**
+
+.. code-block:: python
+
+    from os import listdir
+    from os.path import isfile, join, splitext
+    import re
+    import numpy as np
+
+    # path to the directory containing data files
+    mypath = "/path/to/data/dns/rc36b_standard_dz"
+
+    # filter the data files in the given directory
+    p = re.compile('^dz(\d{8})vana.d_dat$')
+
+    # we choose only the runs with 'x' polarisation
+    filelist = [str(i*6 + 29100501) for i in range(10)]
+
+    def is_in_filelist(fname, p, flist):
+        m = re.match(p, fname)
+        if m:
+            num = m.group(1)
+            return num in flist
+        else:
+            return False
+
+    datafiles = sorted([f for f in listdir(mypath) if isfile(join(mypath,f)) and is_in_filelist(f, p, filelist)])
+
+    # load data to workspaces
+    wslist = []
+    for f in datafiles:
+        try:
+            wname = splitext(f)[0]
+            #print "Processing ", wname  # uncomment if needed
+            LoadDNSLegacy(Filename=join(mypath, f), OutputWorkspace=wname, Polarisation='x', Normalization='duration')
+        except RuntimeError as err:
+            print err
+        else:
+            wslist.append(wname)
+
+    # merge the given workspaces
+    merged = DNSMergeRuns(wslist, HorizontalAxis='2theta', Normalize=True)
+    mergedQ = DNSMergeRuns(wslist, HorizontalAxis='|Q|')
+    mergedD = DNSMergeRuns(wslist, HorizontalAxis='d-Spacing')
+
+    # print selected values from merged workspaces
+    two_theta = merged.extractX()[0]
+    print "First 5 2Theta values: ", two_theta[:5]
+    q = mergedQ.extractX()[0]
+    print "First 5 |Q| values: ", np.round(q[:5], 3)
+    d = mergedD.extractX()[0]
+    print "First 5 d values: ", np.round(d[:5], 3)
+
+Output:
+
+   First 5 2Theta values:  [ 7.5  8.   8.5  9.   9.5]
+   
+   First 5 Q values:  [ 0.249  0.266  0.282  0.299  0.315]
+   
+   First 5 d values:  [ 1.844  1.848  1.852  1.856  1.86 ]
+
+.. categories::
+
+.. sourcelink::
diff --git a/Code/Mantid/docs/source/algorithms/EnggVanadiumCorrections-v1.rst b/Code/Mantid/docs/source/algorithms/EnggVanadiumCorrections-v1.rst
index 46a308aed122ea2f3bc5cb3dcb58d7be55a742b6..f03b34bd38e260751af1a9bffc47706ab7904982 100644
--- a/Code/Mantid/docs/source/algorithms/EnggVanadiumCorrections-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/EnggVanadiumCorrections-v1.rst
@@ -85,11 +85,11 @@ Usage
    # # To generate the pre-calculated features (integration and curves), for a new
    # Vanadium run, and apply the corrections on a workspace:
    #             
-   # data_ws = Load('ENGINX00213855.nxs')
+   # sample_ws = Load('ENGINX00213855.nxs')
    # van_ws = Load('ENGINX00236516.nxs')
-   # EnggVanadiumCorrections(Workspace = data_ws, VanadiumWorkspace = van_ws
-   #                         IntegrationWorkspace = 'integ_ws',
-   #                         CurvesWorkspace = 'curves_ws')
+   # EnggVanadiumCorrections(Workspace = sample_ws, VanadiumWorkspace = van_ws
+   #                         OutIntegrationWorkspace = 'integ_ws',
+   #                         OutCurvesWorkspace = 'curves_ws')
    #
    # # Now you can save the two pre-calculated features / workspaces:
    # SaveNexus(InputWorkspace='integ_ws',
diff --git a/Code/Mantid/docs/source/algorithms/LoadNMoldyn4Ascii-v1.rst b/Code/Mantid/docs/source/algorithms/LoadNMoldyn4Ascii-v1.rst
index a9146f232eb1ae29959d9daf7218a37395d379c8..8f7bb7a8828ee13b0ce86e3f2ae6e2eb30cc2415 100644
--- a/Code/Mantid/docs/source/algorithms/LoadNMoldyn4Ascii-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/LoadNMoldyn4Ascii-v1.rst
@@ -20,9 +20,28 @@ Assumptions on data format
 --------------------------
 
 The ``Directory`` property must be given the directory that is produced when you
-extract the ``.tar`` archive from nMMOLDYN without modifications which must only
+extract the ``.tar`` archive from nMOLDYN without modifications which must only
 contain the data files produces from a single export operation from nMOLDYN.
 
+Axis Unit Conversions
+---------------------
+
+When loading certain axis from nMOLDYN 4 the units may be converted to an
+equivalent unit in Mantid. The possible conversions are shown in the table
+below:
+
++-----------+---------+------------------+--------------+
+| nMOLDYN             | Mantid                          |
++-----------+---------+------------------+--------------+
+| name      | unit    | name             | unit         |
++===========+=========+==================+==============+
+| frequency | THz     | Energy           | meV          |
++-----------+---------+------------------+--------------+
+| q         | nm**-1  | MomentumTransfer | Angstrom**-1 |
++-----------+---------+------------------+--------------+
+| Time      | pSecond | TOF              | uSecond      |
++-----------+---------+------------------+--------------+
+
 Usage
 -----
 
diff --git a/Code/Mantid/docs/source/algorithms/MolDyn-v1.rst b/Code/Mantid/docs/source/algorithms/MolDyn-v1.rst
index 22b793f2b1bfcf469b2a12a32dc6ebcd649ef601..85ff7f79b34533e8e4269d9730c8a7016ede135b 100644
--- a/Code/Mantid/docs/source/algorithms/MolDyn-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/MolDyn-v1.rst
@@ -33,7 +33,7 @@ Usage
 
 .. testcode:: ExLoadCDLFile
 
-    out_ws_group = MolDyn(Filename='NaF_DISF.cdl',
+    out_ws_group = MolDyn(Data='NaF_DISF.cdl',
                           Functions=['Fqt-total', 'Sqw-total'])
 
     for ws_name in out_ws_group.getNames():
diff --git a/Code/Mantid/docs/source/algorithms/ProcessIndirectFitParameters-v1.rst b/Code/Mantid/docs/source/algorithms/ProcessIndirectFitParameters-v1.rst
new file mode 100644
index 0000000000000000000000000000000000000000..e3ef0a364c7e244c4be1dd06bdf02641dfcabcd4
--- /dev/null
+++ b/Code/Mantid/docs/source/algorithms/ProcessIndirectFitParameters-v1.rst
@@ -0,0 +1,60 @@
+
+.. algorithm::
+
+.. summary::
+
+.. alias::
+
+.. properties::
+
+Description
+-----------
+
+An Algorithm designed to allow for the TableWorkspace output of the 
+PlotPeakByLogValue algorithm to be transformed into a Matrix workspace 
+based on the desired parameters.
+
+
+Usage
+-----
+
+**Example - ProcessIndirectFitParameters**
+
+.. testcode:: ProcessIndirectFitParametersExample
+
+   # Create a host workspace
+   tws = WorkspaceFactory.createTable()
+   tws.addColumn("double", "A")
+   tws.addColumn("double", "B")
+   tws.addColumn("double", "B_Err")
+   tws.addColumn("double", "D")
+   tws.addRow([1,2,3,4])
+   tws.addRow([5,6,7,8])
+   tws.addRow([9,0,1,2])
+   tws.addRow([0,0,0,1])
+   
+   # Add to Mantid Workspace list
+   mtd.addOrReplace("TableWs",tws)
+   wsName = "outputWorkspace"
+
+   # "D" is not included in the algorithm params list
+   ProcessIndirectFitParameters(tws, 'A', "B", OutputWorkspace=wsName)
+
+   wsOut = mtd[wsName]
+
+   # Print the result
+   print "%s is a %s and the Y values are:" % (wsOut, wsOut.id())
+   print wsOut.readY(0)
+   
+Output:
+
+.. testoutput:: ProcessIndirectFitParametersExample
+    :options: +NORMALIZE_WHITESPACE
+	
+    outputWorkspace is a Workspace2D and the Y values are:
+	[ 2.  6.  0.  0.]
+	
+.. categories::
+
+.. sourcelink::
+
diff --git a/Code/Mantid/docs/source/algorithms/TOFSANSResolutionByPixel-v1.rst b/Code/Mantid/docs/source/algorithms/TOFSANSResolutionByPixel-v1.rst
index 3fd5521c20df58b5a7fd144e4e1597eb01a25a03..ec913ce7281eea5bf0494b29fe38c99d81375ce1 100644
--- a/Code/Mantid/docs/source/algorithms/TOFSANSResolutionByPixel-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/TOFSANSResolutionByPixel-v1.rst
@@ -13,7 +13,7 @@ Calculates the Q-resolution per pixel according to Mildner and Carpenter equatio
 
 .. math:: (\sigma_Q )^2 = \frac{4\pi^2}{12\lambda^2} [ 3(\frac{R_1}{L_1})^2 + 3(\frac{R_2}{L_3})^2 + (\frac{\Delta R}{L_2})^2 ] + Q^2(\frac{\sigma_{\lambda}}{\lambda})^2
 
-where :math:`L1` and :math:`L2` are the primary and secondary flight-paths respectively and 
+where :math:`L1` and :math:`L2`  are the collimation length and sample-to-detector distance respectively and 
 
 .. math:: \frac{1}{L_3} = \frac{1}{L_1} + \frac{1}{L_2}
 
@@ -25,6 +25,12 @@ where :math:`\sigma_{\lambda}` is the overall wavelength std from TOF binning
 and moderator, :math:`\Delta \lambda` is taken from the binning of the InputWorkspace 
 and the :math:`\sigma_{moderator}` is the wavelenght spread from the moderator.
 
+where :math:`\sigma_{\lambda}` is the effective standard deviation, and :math:`\Delta \lambda`,
+originating from the TOF binning of the InputWorkspace, is the (rectangular)
+width, of the moderator wavelength distribution. :math:`\sigma_{moderator}` is the
+moderator time spread (the variation in time for the moderator to emit neutrons
+of a given wavelength).
+
 :math:`\sigma_Q` is returned as the y-values of the InputWorkspace, and the 
 remaining variables in the main equation above are related to parameters of this
 algorithm as follows:
@@ -35,7 +41,7 @@ algorithm as follows:
 * :math:`\sigma_{moderator}` equals SigmaModerator  
 * :math:`\L_1` equals CollimationLength
 
-:math:`\lambda` in the equation is the midtpoint of wavelength 
+:math:`\lambda` in the equation is the midpoint of wavelength 
 histogram bin values of InputWorkspace.
 
 Collimation length :math:`L_1` in metres in the equation here is the distance between the
@@ -48,6 +54,7 @@ scalar :math:`Q`, and making some small angle approximations. Results on higher
 may not be accurate. For data reduction sliced in different directions on the detector
 (e.g. GISANS) adjust the calling parameters to suit the collimation in that direction.
 
+This version of the algorithm neglects wavelength-dependent detector detection depth effects.
 
 .. categories::
 
diff --git a/Code/Mantid/docs/source/interfaces/Indirect_Simulation.rst b/Code/Mantid/docs/source/interfaces/Indirect_Simulation.rst
index e856900caf6eadf887b216c2ae96c3c0bcaf63dd..4c1cf715a647823f6737987379ca20cf2456dc5e 100644
--- a/Code/Mantid/docs/source/interfaces/Indirect_Simulation.rst
+++ b/Code/Mantid/docs/source/interfaces/Indirect_Simulation.rst
@@ -34,13 +34,18 @@ MolDyn
 
 The MolDyn interface is used to import simulation data created using nMOLDYN (by
 using the :ref:`MolDyn <algm-MolDyn>` algorithm), tab operates on either *.dat*
-or *.cdl* files.
+or *.cdl* files for nMOLDYN 3 or a directory containing the files extracted from
+the *.tar* archive crated by nMOLDYN 4.
 
 Options
 ~~~~~~~
 
-Sample Run
-  The data file (*.cdl* or *.dat*) to load.
+Version
+  The version of nMOLDYN the imported data was exported from.
+
+Data
+  The data file (*.cdl* or *.dat*) to load when using nMOLDYN 3 or the directory
+  for the export taken from nMOLDYN 4.
 
 Function Names
   A comm separated list of functions to load from a .cdl file.
diff --git a/Code/Mantid/instrument/CNCS_Definition.xml b/Code/Mantid/instrument/CNCS_Definition.xml
index aeb0522695370801f4b06dcf66f12ddd56c33fcc..51927d54be9e807d441bbd93bcbb139af605bcc1 100644
--- a/Code/Mantid/instrument/CNCS_Definition.xml
+++ b/Code/Mantid/instrument/CNCS_Definition.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='ASCII'?>
-<instrument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.mantidproject.org/IDF/1.0" last-modified="2015-01-30 16:42:36.216202" name="CNCS" valid-from="2015-01-30 00:00:00" valid-to="2100-01-31 23:59:59" xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 Schema/IDFSchema.xsd">
+<instrument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.mantidproject.org/IDF/1.0" last-modified="2015-08-17 14:50:39.469748" name="CNCS" valid-from="2015-08-01 00:00:00" valid-to="2100-01-31 23:59:59" xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd">
   <!--Created by Michael Reuter-->
   <defaults>
     <length unit="metre"/>
@@ -187,350 +187,350 @@
   </type>
   <type name="bank1">
     <component type="eightpack">
-      <location x="2.61865" y="0.0" z="-2.27917">
+      <location x="2.63849" y="0.0" z="-2.29644">
         <rot axis-x="0" axis-y="1" axis-z="0" val="311.035"/>
       </location>
     </component>
   </type>
   <type name="bank2">
     <component type="eightpack">
-      <location x="2.76078" y="0.0" z="-2.11421">
+      <location x="2.77661" y="0.0" z="-2.12633">
         <rot axis-x="0" axis-y="1" axis-z="0" val="307.445"/>
       </location>
     </component>
   </type>
   <type name="bank3">
     <component type="eightpack">
-      <location x="2.88682" y="0.0" z="-1.93657">
+      <location x="2.90095" y="0.0" z="-1.94605">
         <rot axis-x="0" axis-y="1" axis-z="0" val="303.855"/>
       </location>
     </component>
   </type>
   <type name="bank4">
     <component type="eightpack">
-      <location x="3.00841" y="0.0" z="-1.75551">
+      <location x="3.02106" y="0.0" z="-1.76289">
         <rot axis-x="0" axis-y="1" axis-z="0" val="300.265"/>
       </location>
     </component>
   </type>
   <type name="bank5">
     <component type="eightpack">
-      <location x="3.1118" y="0.0" z="-1.56337">
+      <location x="3.12465" y="0.0" z="-1.56983">
         <rot axis-x="0" axis-y="1" axis-z="0" val="296.675"/>
       </location>
     </component>
   </type>
   <type name="bank6">
     <component type="eightpack">
-      <location x="3.20565" y="0.0" z="-1.36634">
+      <location x="3.2183" y="0.0" z="-1.37173">
         <rot axis-x="0" axis-y="1" axis-z="0" val="293.085"/>
       </location>
     </component>
   </type>
   <type name="bank7">
     <component type="eightpack">
-      <location x="3.28608" y="0.0" z="-1.16334">
+      <location x="3.29715" y="0.0" z="-1.16726">
         <rot axis-x="0" axis-y="1" axis-z="0" val="289.495"/>
       </location>
     </component>
   </type>
   <type name="bank8">
     <component type="eightpack">
-      <location x="3.34352" y="0.0" z="-0.952742">
+      <location x="3.36295" y="0.0" z="-0.95828">
         <rot axis-x="0" axis-y="1" axis-z="0" val="285.905"/>
       </location>
     </component>
   </type>
   <type name="bank9">
     <component type="eightpack">
-      <location x="3.38894" y="0.0" z="-0.739838">
+      <location x="3.41642" y="0.0" z="-0.74584">
         <rot axis-x="0" axis-y="1" axis-z="0" val="282.315"/>
       </location>
     </component>
   </type>
   <type name="bank10">
     <component type="eightpack">
-      <location x="3.42736" y="0.0" z="-0.52599">
+      <location x="3.45681" y="0.0" z="-0.53051">
         <rot axis-x="0" axis-y="1" axis-z="0" val="278.725"/>
       </location>
     </component>
   </type>
   <type name="bank11">
     <component type="eightpack">
-      <location x="3.45894" y="0.0" z="-0.310832">
+      <location x="3.47705" y="0.0" z="-0.31246">
         <rot axis-x="0" axis-y="1" axis-z="0" val="275.135"/>
       </location>
     </component>
   </type>
   <type name="bank12">
     <component type="eightpack">
-      <location x="3.48182" y="0.0" z="-0.093911">
+      <location x="3.49549" y="0.0" z="-0.09428">
         <rot axis-x="0" axis-y="1" axis-z="0" val="271.545"/>
       </location>
     </component>
   </type>
   <type name="bank13">
     <component type="eightpack">
-      <location x="3.4906" y="0.0" z="0.124639">
+      <location x="3.49601" y="0.0" z="0.12483">
         <rot axis-x="0" axis-y="1" axis-z="0" val="267.955"/>
       </location>
     </component>
   </type>
   <type name="bank14">
     <component type="eightpack">
-      <location x="3.47923" y="0.0" z="0.343287">
+      <location x="3.48266" y="0.0" z="0.34363">
         <rot axis-x="0" axis-y="1" axis-z="0" val="264.365"/>
       </location>
     </component>
   </type>
   <type name="bank15">
     <component type="eightpack">
-      <location x="3.4502" y="0.0" z="0.560356">
+      <location x="3.45253" y="0.0" z="0.56073">
         <rot axis-x="0" axis-y="1" axis-z="0" val="260.775"/>
       </location>
     </component>
   </type>
   <type name="bank16">
     <component type="eightpack">
-      <location x="3.40653" y="0.0" z="0.774882">
+      <location x="3.41025" y="0.0" z="0.77573">
         <rot axis-x="0" axis-y="1" axis-z="0" val="257.185"/>
       </location>
     </component>
   </type>
   <type name="bank17">
     <component type="eightpack">
-      <location x="3.35209" y="0.0" z="0.986891">
+      <location x="3.35477" y="0.0" z="0.98768">
         <rot axis-x="0" axis-y="1" axis-z="0" val="253.595"/>
       </location>
     </component>
   </type>
   <type name="bank18">
     <component type="eightpack">
-      <location x="3.2853" y="0.0" z="1.19543">
+      <location x="3.28769" y="0.0" z="1.1963">
         <rot axis-x="0" axis-y="1" axis-z="0" val="250.005"/>
       </location>
     </component>
   </type>
   <type name="bank19">
     <component type="eightpack">
-      <location x="3.20508" y="0.0" z="1.39927">
+      <location x="3.20685" y="0.0" z="1.40004">
         <rot axis-x="0" axis-y="1" axis-z="0" val="246.415"/>
       </location>
     </component>
   </type>
   <type name="bank20">
     <component type="eightpack">
-      <location x="3.11035" y="0.0" z="1.59679">
+      <location x="3.11124" y="0.0" z="1.59725">
         <rot axis-x="0" axis-y="1" axis-z="0" val="242.825"/>
       </location>
     </component>
   </type>
   <type name="bank21">
     <component type="eightpack">
-      <location x="3.0034" y="0.0" z="1.7879">
+      <location x="3.00392" y="0.0" z="1.78821">
         <rot axis-x="0" axis-y="1" axis-z="0" val="239.235"/>
       </location>
     </component>
   </type>
   <type name="bank22">
     <component type="eightpack">
-      <location x="2.88564" y="0.0" z="1.97251">
+      <location x="2.888" y="0.0" z="1.97413">
         <rot axis-x="0" axis-y="1" axis-z="0" val="235.645"/>
       </location>
     </component>
   </type>
   <type name="bank23">
     <component type="eightpack">
-      <location x="2.75681" y="0.0" z="2.1496">
+      <location x="2.75727" y="0.0" z="2.14996">
         <rot axis-x="0" axis-y="1" axis-z="0" val="232.055"/>
       </location>
     </component>
   </type>
   <type name="bank24">
     <component type="eightpack">
-      <location x="2.61368" y="0.0" z="2.31524">
+      <location x="2.61572" y="0.0" z="2.31704">
         <rot axis-x="0" axis-y="1" axis-z="0" val="228.465"/>
       </location>
     </component>
   </type>
   <type name="bank25">
     <component type="eightpack">
-      <location x="2.46263" y="0.0" z="2.4734">
+      <location x="2.46566" y="0.0" z="2.47644">
         <rot axis-x="0" axis-y="1" axis-z="0" val="224.875"/>
       </location>
     </component>
   </type>
   <type name="bank26">
     <component type="eightpack">
-      <location x="2.30747" y="0.0" z="2.62793">
+      <location x="2.30853" y="0.0" z="2.62914">
         <rot axis-x="0" axis-y="1" axis-z="0" val="221.285"/>
       </location>
     </component>
   </type>
   <type name="bank27">
     <component type="eightpack">
-      <location x="2.13842" y="0.0" z="2.76729">
+      <location x="2.13857" y="0.0" z="2.76748">
         <rot axis-x="0" axis-y="1" axis-z="0" val="217.695"/>
       </location>
     </component>
   </type>
   <type name="bank28">
     <component type="eightpack">
-      <location x="1.95965" y="0.0" z="2.89385">
+      <location x="1.96178" y="0.0" z="2.89699">
         <rot axis-x="0" axis-y="1" axis-z="0" val="214.105"/>
       </location>
     </component>
   </type>
   <type name="bank29">
     <component type="eightpack">
-      <location x="1.77371" y="0.0" z="3.00936">
+      <location x="1.77444" y="0.0" z="3.0106">
         <rot axis-x="0" axis-y="1" axis-z="0" val="210.515"/>
       </location>
     </component>
   </type>
   <type name="bank30">
     <component type="eightpack">
-      <location x="1.58375" y="0.0" z="3.11837">
+      <location x="1.58334" y="0.0" z="3.11756">
         <rot axis-x="0" axis-y="1" axis-z="0" val="206.925"/>
       </location>
     </component>
   </type>
   <type name="bank31">
     <component type="eightpack">
-      <location x="1.3854" y="0.0" z="3.21146">
+      <location x="1.38489" y="0.0" z="3.21028">
         <rot axis-x="0" axis-y="1" axis-z="0" val="203.335"/>
       </location>
     </component>
   </type>
   <type name="bank32">
     <component type="eightpack">
-      <location x="1.18032" y="0.0" z="3.28838">
+      <location x="1.18075" y="0.0" z="3.28955">
         <rot axis-x="0" axis-y="1" axis-z="0" val="199.745"/>
       </location>
     </component>
   </type>
   <type name="bank33">
     <component type="eightpack">
-      <location x="0.972527" y="0.0" z="3.3573">
+      <location x="0.97224" y="0.0" z="3.35632">
         <rot axis-x="0" axis-y="1" axis-z="0" val="196.155"/>
       </location>
     </component>
   </type>
   <type name="bank34">
     <component type="eightpack">
-      <location x="0.760383" y="0.0" z="3.41154">
+      <location x="0.76027" y="0.0" z="3.41104">
         <rot axis-x="0" axis-y="1" axis-z="0" val="192.565"/>
       </location>
     </component>
   </type>
   <type name="bank35">
     <component type="eightpack">
-      <location x="0.545012" y="0.0" z="3.45081">
+      <location x="0.54487" y="0.0" z="3.44994">
         <rot axis-x="0" axis-y="1" axis-z="0" val="188.975"/>
       </location>
     </component>
   </type>
   <type name="bank36">
     <component type="eightpack">
-      <location x="0.327961" y="0.0" z="3.47919">
+      <location x="0.328" y="0.0" z="3.47956">
         <rot axis-x="0" axis-y="1" axis-z="0" val="185.385"/>
       </location>
     </component>
   </type>
   <type name="bank37">
     <component type="eightpack">
-      <location x="-0.327368" y="0.0" z="3.47289">
+      <location x="-0.32802" y="0.0" z="3.47979">
         <rot axis-x="0" axis-y="1" axis-z="0" val="174.615"/>
       </location>
     </component>
   </type>
   <type name="bank38">
     <component type="eightpack">
-      <location x="-0.544931" y="0.0" z="3.4503">
+      <location x="-0.54538" y="0.0" z="3.45312">
         <rot axis-x="0" axis-y="1" axis-z="0" val="171.025"/>
       </location>
     </component>
   </type>
   <type name="bank39">
     <component type="eightpack">
-      <location x="-0.759928" y="0.0" z="3.4095">
+      <location x="-0.76055" y="0.0" z="3.41229">
         <rot axis-x="0" axis-y="1" axis-z="0" val="167.435"/>
       </location>
     </component>
   </type>
   <type name="bank40">
     <component type="eightpack">
-      <location x="-0.97205" y="0.0" z="3.35565">
+      <location x="-0.97256" y="0.0" z="3.3574">
         <rot axis-x="0" axis-y="1" axis-z="0" val="163.845"/>
       </location>
     </component>
   </type>
   <type name="bank41">
     <component type="eightpack">
-      <location x="-1.18055" y="0.0" z="3.289">
+      <location x="-1.18094" y="0.0" z="3.29009">
         <rot axis-x="0" axis-y="1" axis-z="0" val="160.255"/>
       </location>
     </component>
   </type>
   <type name="bank42">
     <component type="eightpack">
-      <location x="-1.38472" y="0.0" z="3.20988">
+      <location x="-1.38525" y="0.0" z="3.21111">
         <rot axis-x="0" axis-y="1" axis-z="0" val="156.665"/>
       </location>
     </component>
   </type>
   <type name="bank43">
     <component type="eightpack">
-      <location x="-1.58047" y="0.0" z="3.11191">
+      <location x="-1.58218" y="0.0" z="3.11528">
         <rot axis-x="0" axis-y="1" axis-z="0" val="153.075"/>
       </location>
     </component>
   </type>
   <type name="bank44">
     <component type="eightpack">
-      <location x="-1.76808" y="0.0" z="2.99981">
+      <location x="-1.77593" y="0.0" z="3.01313">
         <rot axis-x="0" axis-y="1" axis-z="0" val="149.485"/>
       </location>
     </component>
   </type>
   <type name="bank45">
     <component type="eightpack">
-      <location x="-1.94916" y="0.0" z="2.87836">
+      <location x="-1.9561" y="0.0" z="2.8886">
         <rot axis-x="0" axis-y="1" axis-z="0" val="145.895"/>
       </location>
     </component>
   </type>
   <type name="bank46">
     <component type="eightpack">
-      <location x="-2.12181" y="0.0" z="2.7458">
+      <location x="-2.12942" y="0.0" z="2.75565">
         <rot axis-x="0" axis-y="1" axis-z="0" val="142.305"/>
       </location>
     </component>
   </type>
   <type name="bank47">
     <component type="eightpack">
-      <location x="-2.28737" y="0.0" z="2.60504">
+      <location x="-2.29762" y="0.0" z="2.61671">
         <rot axis-x="0" axis-y="1" axis-z="0" val="138.715"/>
       </location>
     </component>
   </type>
   <type name="bank48">
     <component type="eightpack">
-      <location x="-2.44663" y="0.0" z="2.45733">
+      <location x="-2.45607" y="0.0" z="2.46681">
         <rot axis-x="0" axis-y="1" axis-z="0" val="135.125"/>
       </location>
     </component>
   </type>
   <type name="bank49">
     <component type="eightpack">
-      <location x="-2.59486" y="0.0" z="2.29857">
+      <location x="-2.59826" y="0.0" z="2.30157">
         <rot axis-x="0" axis-y="1" axis-z="0" val="131.535"/>
       </location>
     </component>
   </type>
   <type name="bank50">
     <component type="eightpack">
-      <location x="-2.72685" y="0.0" z="2.12623">
+      <location x="-2.74021" y="0.0" z="2.13666">
         <rot axis-x="0" axis-y="1" axis-z="0" val="127.945"/>
       </location>
     </component>
diff --git a/Code/Mantid/instrument/CNCS_Definition_20150130-20150731.xml b/Code/Mantid/instrument/CNCS_Definition_20150130-20150731.xml
new file mode 100644
index 0000000000000000000000000000000000000000..41a4911d5d3e87501ed46456389adadac1cfb8be
--- /dev/null
+++ b/Code/Mantid/instrument/CNCS_Definition_20150130-20150731.xml
@@ -0,0 +1,729 @@
+<?xml version='1.0' encoding='ASCII'?>
+<instrument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.mantidproject.org/IDF/1.0" last-modified="2015-01-30 16:42:36.216202" name="CNCS" valid-from="2015-01-30 00:00:00" valid-to="2015-07-31 23:59:59" xsi:schemaLocation="http://www.mantidproject.org/IDF/1.0 Schema/IDFSchema.xsd">
+  <!--Created by Michael Reuter-->
+  <defaults>
+    <length unit="metre"/>
+    <angle unit="degree"/>
+    <reference-frame>
+      <along-beam axis="z"/>
+      <pointing-up axis="y"/>
+      <handedness val="right"/>
+    </reference-frame>
+  </defaults>
+  <!--SOURCE AND SAMPLE POSITION-->
+  <component type="moderator">
+    <location z="-36.262"/>
+  </component>
+  <type is="Source" name="moderator"/>
+  <component type="sample-position">
+    <location x="0.0" y="0.0" z="0.0"/>
+  </component>
+  <type is="SamplePos" name="sample-position"/>
+  <!--MONITORS-->
+  <component idlist="monitors" type="monitors">
+    <location/>
+  </component>
+  <type name="monitors">
+    <component type="monitor">
+      <location name="monitor1" z="-29.949"/>
+      <location name="monitor2" z="-28.706"/>
+      <location name="monitor3" z="-1.416"/>
+    </component>
+  </type>
+  <component idlist="detectors" type="detectors">
+    <location/>
+  </component>
+  <type name="detectors">
+    <component type="bank1">
+      <location/>
+    </component>
+    <component type="bank2">
+      <location/>
+    </component>
+    <component type="bank3">
+      <location/>
+    </component>
+    <component type="bank4">
+      <location/>
+    </component>
+    <component type="bank5">
+      <location/>
+    </component>
+    <component type="bank6">
+      <location/>
+    </component>
+    <component type="bank7">
+      <location/>
+    </component>
+    <component type="bank8">
+      <location/>
+    </component>
+    <component type="bank9">
+      <location/>
+    </component>
+    <component type="bank10">
+      <location/>
+    </component>
+    <component type="bank11">
+      <location/>
+    </component>
+    <component type="bank12">
+      <location/>
+    </component>
+    <component type="bank13">
+      <location/>
+    </component>
+    <component type="bank14">
+      <location/>
+    </component>
+    <component type="bank15">
+      <location/>
+    </component>
+    <component type="bank16">
+      <location/>
+    </component>
+    <component type="bank17">
+      <location/>
+    </component>
+    <component type="bank18">
+      <location/>
+    </component>
+    <component type="bank19">
+      <location/>
+    </component>
+    <component type="bank20">
+      <location/>
+    </component>
+    <component type="bank21">
+      <location/>
+    </component>
+    <component type="bank22">
+      <location/>
+    </component>
+    <component type="bank23">
+      <location/>
+    </component>
+    <component type="bank24">
+      <location/>
+    </component>
+    <component type="bank25">
+      <location/>
+    </component>
+    <component type="bank26">
+      <location/>
+    </component>
+    <component type="bank27">
+      <location/>
+    </component>
+    <component type="bank28">
+      <location/>
+    </component>
+    <component type="bank29">
+      <location/>
+    </component>
+    <component type="bank30">
+      <location/>
+    </component>
+    <component type="bank31">
+      <location/>
+    </component>
+    <component type="bank32">
+      <location/>
+    </component>
+    <component type="bank33">
+      <location/>
+    </component>
+    <component type="bank34">
+      <location/>
+    </component>
+    <component type="bank35">
+      <location/>
+    </component>
+    <component type="bank36">
+      <location/>
+    </component>
+    <component type="bank37">
+      <location/>
+    </component>
+    <component type="bank38">
+      <location/>
+    </component>
+    <component type="bank39">
+      <location/>
+    </component>
+    <component type="bank40">
+      <location/>
+    </component>
+    <component type="bank41">
+      <location/>
+    </component>
+    <component type="bank42">
+      <location/>
+    </component>
+    <component type="bank43">
+      <location/>
+    </component>
+    <component type="bank44">
+      <location/>
+    </component>
+    <component type="bank45">
+      <location/>
+    </component>
+    <component type="bank46">
+      <location/>
+    </component>
+    <component type="bank47">
+      <location/>
+    </component>
+    <component type="bank48">
+      <location/>
+    </component>
+    <component type="bank49">
+      <location/>
+    </component>
+    <component type="bank50">
+      <location/>
+    </component>
+  </type>
+  <type name="bank1">
+    <component type="eightpack">
+      <location x="2.61865" y="0.0" z="-2.27917">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="311.035"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank2">
+    <component type="eightpack">
+      <location x="2.76078" y="0.0" z="-2.11421">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="307.445"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank3">
+    <component type="eightpack">
+      <location x="2.88682" y="0.0" z="-1.93657">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="303.855"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank4">
+    <component type="eightpack">
+      <location x="3.00841" y="0.0" z="-1.75551">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="300.265"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank5">
+    <component type="eightpack">
+      <location x="3.1118" y="0.0" z="-1.56337">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="296.675"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank6">
+    <component type="eightpack">
+      <location x="3.20565" y="0.0" z="-1.36634">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="293.085"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank7">
+    <component type="eightpack">
+      <location x="3.28608" y="0.0" z="-1.16334">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="289.495"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank8">
+    <component type="eightpack">
+      <location x="3.34352" y="0.0" z="-0.952742">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="285.905"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank9">
+    <component type="eightpack">
+      <location x="3.38894" y="0.0" z="-0.739838">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="282.315"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank10">
+    <component type="eightpack">
+      <location x="3.42736" y="0.0" z="-0.52599">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="278.725"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank11">
+    <component type="eightpack">
+      <location x="3.45894" y="0.0" z="-0.310832">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="275.135"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank12">
+    <component type="eightpack">
+      <location x="3.48182" y="0.0" z="-0.093911">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="271.545"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank13">
+    <component type="eightpack">
+      <location x="3.4906" y="0.0" z="0.124639">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="267.955"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank14">
+    <component type="eightpack">
+      <location x="3.47923" y="0.0" z="0.343287">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="264.365"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank15">
+    <component type="eightpack">
+      <location x="3.4502" y="0.0" z="0.560356">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="260.775"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank16">
+    <component type="eightpack">
+      <location x="3.40653" y="0.0" z="0.774882">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="257.185"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank17">
+    <component type="eightpack">
+      <location x="3.35209" y="0.0" z="0.986891">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="253.595"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank18">
+    <component type="eightpack">
+      <location x="3.2853" y="0.0" z="1.19543">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="250.005"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank19">
+    <component type="eightpack">
+      <location x="3.20508" y="0.0" z="1.39927">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="246.415"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank20">
+    <component type="eightpack">
+      <location x="3.11035" y="0.0" z="1.59679">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="242.825"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank21">
+    <component type="eightpack">
+      <location x="3.0034" y="0.0" z="1.7879">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="239.235"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank22">
+    <component type="eightpack">
+      <location x="2.88564" y="0.0" z="1.97251">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="235.645"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank23">
+    <component type="eightpack">
+      <location x="2.75681" y="0.0" z="2.1496">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="232.055"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank24">
+    <component type="eightpack">
+      <location x="2.61368" y="0.0" z="2.31524">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="228.465"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank25">
+    <component type="eightpack">
+      <location x="2.46263" y="0.0" z="2.4734">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="224.875"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank26">
+    <component type="eightpack">
+      <location x="2.30747" y="0.0" z="2.62793">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="221.285"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank27">
+    <component type="eightpack">
+      <location x="2.13842" y="0.0" z="2.76729">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="217.695"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank28">
+    <component type="eightpack">
+      <location x="1.95965" y="0.0" z="2.89385">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="214.105"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank29">
+    <component type="eightpack">
+      <location x="1.77371" y="0.0" z="3.00936">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="210.515"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank30">
+    <component type="eightpack">
+      <location x="1.58375" y="0.0" z="3.11837">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="206.925"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank31">
+    <component type="eightpack">
+      <location x="1.3854" y="0.0" z="3.21146">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="203.335"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank32">
+    <component type="eightpack">
+      <location x="1.18032" y="0.0" z="3.28838">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="199.745"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank33">
+    <component type="eightpack">
+      <location x="0.972527" y="0.0" z="3.3573">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="196.155"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank34">
+    <component type="eightpack">
+      <location x="0.760383" y="0.0" z="3.41154">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="192.565"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank35">
+    <component type="eightpack">
+      <location x="0.545012" y="0.0" z="3.45081">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="188.975"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank36">
+    <component type="eightpack">
+      <location x="0.327961" y="0.0" z="3.47919">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="185.385"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank37">
+    <component type="eightpack">
+      <location x="-0.327368" y="0.0" z="3.47289">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="174.615"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank38">
+    <component type="eightpack">
+      <location x="-0.544931" y="0.0" z="3.4503">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="171.025"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank39">
+    <component type="eightpack">
+      <location x="-0.759928" y="0.0" z="3.4095">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="167.435"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank40">
+    <component type="eightpack">
+      <location x="-0.97205" y="0.0" z="3.35565">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="163.845"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank41">
+    <component type="eightpack">
+      <location x="-1.18055" y="0.0" z="3.289">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="160.255"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank42">
+    <component type="eightpack">
+      <location x="-1.38472" y="0.0" z="3.20988">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="156.665"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank43">
+    <component type="eightpack">
+      <location x="-1.58047" y="0.0" z="3.11191">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="153.075"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank44">
+    <component type="eightpack">
+      <location x="-1.76808" y="0.0" z="2.99981">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="149.485"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank45">
+    <component type="eightpack">
+      <location x="-1.94916" y="0.0" z="2.87836">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="145.895"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank46">
+    <component type="eightpack">
+      <location x="-2.12181" y="0.0" z="2.7458">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="142.305"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank47">
+    <component type="eightpack">
+      <location x="-2.28737" y="0.0" z="2.60504">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="138.715"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank48">
+    <component type="eightpack">
+      <location x="-2.44663" y="0.0" z="2.45733">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="135.125"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank49">
+    <component type="eightpack">
+      <location x="-2.59486" y="0.0" z="2.29857">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="131.535"/>
+      </location>
+    </component>
+  </type>
+  <type name="bank50">
+    <component type="eightpack">
+      <location x="-2.72685" y="0.0" z="2.12623">
+        <rot axis-x="0" axis-y="1" axis-z="0" val="127.945"/>
+      </location>
+    </component>
+  </type>
+  <!--STANDARD 8-PACK-->
+  <type name="eightpack">
+    <properties/>
+    <component type="tube">
+      <location name="tube1" x="-0.096012"/>
+      <location name="tube2" x="-0.06858"/>
+      <location name="tube3" x="-0.041148"/>
+      <location name="tube4" x="-0.013716"/>
+      <location name="tube5" x="0.013716"/>
+      <location name="tube6" x="0.041148"/>
+      <location name="tube7" x="0.06858"/>
+      <location name="tube8" x="0.096012"/>
+    </component>
+  </type>
+  <!--STANDARD 2m 128 PIXEL TUBE-->
+  <type name="tube" outline="yes">
+    <properties/>
+    <component type="pixel">
+      <location name="pixel1" y="-0.9921875"/>
+      <location name="pixel2" y="-0.9765625"/>
+      <location name="pixel3" y="-0.9609375"/>
+      <location name="pixel4" y="-0.9453125"/>
+      <location name="pixel5" y="-0.9296875"/>
+      <location name="pixel6" y="-0.9140625"/>
+      <location name="pixel7" y="-0.8984375"/>
+      <location name="pixel8" y="-0.8828125"/>
+      <location name="pixel9" y="-0.8671875"/>
+      <location name="pixel10" y="-0.8515625"/>
+      <location name="pixel11" y="-0.8359375"/>
+      <location name="pixel12" y="-0.8203125"/>
+      <location name="pixel13" y="-0.8046875"/>
+      <location name="pixel14" y="-0.7890625"/>
+      <location name="pixel15" y="-0.7734375"/>
+      <location name="pixel16" y="-0.7578125"/>
+      <location name="pixel17" y="-0.7421875"/>
+      <location name="pixel18" y="-0.7265625"/>
+      <location name="pixel19" y="-0.7109375"/>
+      <location name="pixel20" y="-0.6953125"/>
+      <location name="pixel21" y="-0.6796875"/>
+      <location name="pixel22" y="-0.6640625"/>
+      <location name="pixel23" y="-0.6484375"/>
+      <location name="pixel24" y="-0.6328125"/>
+      <location name="pixel25" y="-0.6171875"/>
+      <location name="pixel26" y="-0.6015625"/>
+      <location name="pixel27" y="-0.5859375"/>
+      <location name="pixel28" y="-0.5703125"/>
+      <location name="pixel29" y="-0.5546875"/>
+      <location name="pixel30" y="-0.5390625"/>
+      <location name="pixel31" y="-0.5234375"/>
+      <location name="pixel32" y="-0.5078125"/>
+      <location name="pixel33" y="-0.4921875"/>
+      <location name="pixel34" y="-0.4765625"/>
+      <location name="pixel35" y="-0.4609375"/>
+      <location name="pixel36" y="-0.4453125"/>
+      <location name="pixel37" y="-0.4296875"/>
+      <location name="pixel38" y="-0.4140625"/>
+      <location name="pixel39" y="-0.3984375"/>
+      <location name="pixel40" y="-0.3828125"/>
+      <location name="pixel41" y="-0.3671875"/>
+      <location name="pixel42" y="-0.3515625"/>
+      <location name="pixel43" y="-0.3359375"/>
+      <location name="pixel44" y="-0.3203125"/>
+      <location name="pixel45" y="-0.3046875"/>
+      <location name="pixel46" y="-0.2890625"/>
+      <location name="pixel47" y="-0.2734375"/>
+      <location name="pixel48" y="-0.2578125"/>
+      <location name="pixel49" y="-0.2421875"/>
+      <location name="pixel50" y="-0.2265625"/>
+      <location name="pixel51" y="-0.2109375"/>
+      <location name="pixel52" y="-0.1953125"/>
+      <location name="pixel53" y="-0.1796875"/>
+      <location name="pixel54" y="-0.1640625"/>
+      <location name="pixel55" y="-0.1484375"/>
+      <location name="pixel56" y="-0.1328125"/>
+      <location name="pixel57" y="-0.1171875"/>
+      <location name="pixel58" y="-0.1015625"/>
+      <location name="pixel59" y="-0.0859375"/>
+      <location name="pixel60" y="-0.0703125"/>
+      <location name="pixel61" y="-0.0546875"/>
+      <location name="pixel62" y="-0.0390625"/>
+      <location name="pixel63" y="-0.0234375"/>
+      <location name="pixel64" y="-0.0078125"/>
+      <location name="pixel65" y="0.0078125"/>
+      <location name="pixel66" y="0.0234375"/>
+      <location name="pixel67" y="0.0390625"/>
+      <location name="pixel68" y="0.0546875"/>
+      <location name="pixel69" y="0.0703125"/>
+      <location name="pixel70" y="0.0859375"/>
+      <location name="pixel71" y="0.1015625"/>
+      <location name="pixel72" y="0.1171875"/>
+      <location name="pixel73" y="0.1328125"/>
+      <location name="pixel74" y="0.1484375"/>
+      <location name="pixel75" y="0.1640625"/>
+      <location name="pixel76" y="0.1796875"/>
+      <location name="pixel77" y="0.1953125"/>
+      <location name="pixel78" y="0.2109375"/>
+      <location name="pixel79" y="0.2265625"/>
+      <location name="pixel80" y="0.2421875"/>
+      <location name="pixel81" y="0.2578125"/>
+      <location name="pixel82" y="0.2734375"/>
+      <location name="pixel83" y="0.2890625"/>
+      <location name="pixel84" y="0.3046875"/>
+      <location name="pixel85" y="0.3203125"/>
+      <location name="pixel86" y="0.3359375"/>
+      <location name="pixel87" y="0.3515625"/>
+      <location name="pixel88" y="0.3671875"/>
+      <location name="pixel89" y="0.3828125"/>
+      <location name="pixel90" y="0.3984375"/>
+      <location name="pixel91" y="0.4140625"/>
+      <location name="pixel92" y="0.4296875"/>
+      <location name="pixel93" y="0.4453125"/>
+      <location name="pixel94" y="0.4609375"/>
+      <location name="pixel95" y="0.4765625"/>
+      <location name="pixel96" y="0.4921875"/>
+      <location name="pixel97" y="0.5078125"/>
+      <location name="pixel98" y="0.5234375"/>
+      <location name="pixel99" y="0.5390625"/>
+      <location name="pixel100" y="0.5546875"/>
+      <location name="pixel101" y="0.5703125"/>
+      <location name="pixel102" y="0.5859375"/>
+      <location name="pixel103" y="0.6015625"/>
+      <location name="pixel104" y="0.6171875"/>
+      <location name="pixel105" y="0.6328125"/>
+      <location name="pixel106" y="0.6484375"/>
+      <location name="pixel107" y="0.6640625"/>
+      <location name="pixel108" y="0.6796875"/>
+      <location name="pixel109" y="0.6953125"/>
+      <location name="pixel110" y="0.7109375"/>
+      <location name="pixel111" y="0.7265625"/>
+      <location name="pixel112" y="0.7421875"/>
+      <location name="pixel113" y="0.7578125"/>
+      <location name="pixel114" y="0.7734375"/>
+      <location name="pixel115" y="0.7890625"/>
+      <location name="pixel116" y="0.8046875"/>
+      <location name="pixel117" y="0.8203125"/>
+      <location name="pixel118" y="0.8359375"/>
+      <location name="pixel119" y="0.8515625"/>
+      <location name="pixel120" y="0.8671875"/>
+      <location name="pixel121" y="0.8828125"/>
+      <location name="pixel122" y="0.8984375"/>
+      <location name="pixel123" y="0.9140625"/>
+      <location name="pixel124" y="0.9296875"/>
+      <location name="pixel125" y="0.9453125"/>
+      <location name="pixel126" y="0.9609375"/>
+      <location name="pixel127" y="0.9765625"/>
+      <location name="pixel128" y="0.9921875"/>
+    </component>
+  </type>
+  <!--PIXEL FOR STANDARD 2m 128 PIXEL TUBE-->
+  <type is="detector" name="pixel">
+    <cylinder id="cyl-approx">
+      <centre-of-bottom-base p="0.0" r="0.0" t="0.0"/>
+      <axis x="0.0" y="1.0" z="0.0"/>
+      <radius val="0.0127"/>
+      <height val="0.015625"/>
+    </cylinder>
+    <algebra val="cyl-approx"/>
+  </type>
+  <!--MONITOR SHAPE-->
+  <!--FIXME: Do something real here.-->
+  <type is="monitor" name="monitor">
+    <cylinder id="cyl-approx">
+      <centre-of-bottom-base p="0.0" r="0.0" t="0.0"/>
+      <axis x="0.0" y="0.0" z="1.0"/>
+      <radius val="0.01"/>
+      <height val="0.03"/>
+    </cylinder>
+    <algebra val="cyl-approx"/>
+  </type>
+  <!--DETECTOR IDs-->
+  <idlist idname="detectors">
+    <id end="51199" start="0"/>
+  </idlist>
+  <!--MONITOR IDs-->
+  <idlist idname="monitors">
+    <id val="-1"/>
+    <id val="-2"/>
+    <id val="-3"/>
+  </idlist>
+  <!--DETECTOR PARAMETERS-->
+  <component-link name="detectors">
+    <parameter name="tube_pressure">
+      <value units="atm" val="6.0"/>
+    </parameter>
+    <parameter name="tube_thickness">
+      <value units="metre" val="0.0008"/>
+    </parameter>
+    <parameter name="tube_temperature">
+      <value units="K" val="290.0"/>
+    </parameter>
+  </component-link>
+</instrument>
diff --git a/Code/Mantid/instrument/Facilities.xml b/Code/Mantid/instrument/Facilities.xml
index b9559d1881ac6ae422c23016d07d84404c0578d1..c63dedb34e839ca2ea7ecd46879606a8398acea7 100644
--- a/Code/Mantid/instrument/Facilities.xml
+++ b/Code/Mantid/instrument/Facilities.xml
@@ -394,7 +394,7 @@
 
    <instrument name="USANS" shortname="USANS" beamline="1A">
       <technique>Small Angle Scattering</technique>
-      <livedata address="usans-daq1.sns.gov:31415" />
+      <livedata address="bl1a-daq1.sns.gov:31415" />
    </instrument>
 
    <instrument name="VULCAN" beamline="7">
@@ -404,7 +404,7 @@
    <instrument name="CORELLI" beamline="9">
 	<technique>Neutron Diffraction</technique>
 	<technique>Diffuse Scattering</technique>
-	<livedata address="corelli-daq1.sns.gov:31415" />
+	<livedata address="bl9-daq1.sns.gov:31415" />
    </instrument>
 
    <instrument name="POWGEN" shortname="PG3" beamline="11A">
@@ -434,14 +434,14 @@
     <technique>Neutron Spectroscopy</technique>
     <technique>TOF Indirect Geometry Spectroscopy</technique>
     <technique>Neutron Diffraction</technique>
-    <livedata address="vision-daq1.sns.gov:31415" />
+    <livedata address="bl16b-daq1.sns.gov:31415" />
   </instrument>
 
    <instrument name="SEQUOIA" shortname="SEQ" beamline="17">
     <technique>Neutron Spectroscopy</technique>
     <technique>TOF Direct Geometry Spectroscopy</technique>
     <technique>Neutron Diffraction</technique>
-    <livedata address="sequoia-sms.sns.gov:31415" />
+    <livedata address="bl17-daq1.sns.gov:31415" />
    </instrument>
 
    <instrument name="ARCS" beamline="18">
diff --git a/Code/Mantid/instrument/MANDI_Definition_2014_08_01.xml b/Code/Mantid/instrument/MANDI_Definition_2014_08_01.xml
index 281024a9208b3a79b86fb788ec150a3092af746e..21a80fbf6ac42584cd4b4d4d42fa01694dba1d77 100644
--- a/Code/Mantid/instrument/MANDI_Definition_2014_08_01.xml
+++ b/Code/Mantid/instrument/MANDI_Definition_2014_08_01.xml
@@ -1,12 +1,12 @@
 <?xml version='1.0' encoding='UTF-8'?>
-<!-- For help on the notation used to specify an Instrument Definition File 
+<!-- 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" 
+<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 http://schema.mantidproject.org/IDF/1.0/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">
+                         valid-to     ="2015-07-31 23:59:59"
+		         last-modified="2015-08-18 12:00:00">
   <!--Created by Vickie Lynch-->
   <!--Modified by Vickie Lynch using the MANDI.py script from the Translation Service calibration/geometry/ code. -->
 
@@ -49,7 +49,7 @@
       <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">
@@ -57,343 +57,343 @@
     <rot val="90.000000" axis-x="0" axis-y="1" axis-z="0" />
   </rot>
 </location>
-</component> 
+</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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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>
 <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> 
+</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
 -->
diff --git a/Code/Mantid/instrument/MANDI_Definition_2015_08_01.xml b/Code/Mantid/instrument/MANDI_Definition_2015_08_01.xml
new file mode 100644
index 0000000000000000000000000000000000000000..6d92ec0e4db71a438db2adb95d9fd37201c02b79
--- /dev/null
+++ b/Code/Mantid/instrument/MANDI_Definition_2015_08_01.xml
@@ -0,0 +1,470 @@
+<?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 http://schema.mantidproject.org/IDF/1.0/IDFSchema.xsd"
+ name="MANDI" valid-from   ="2015-08-01 00:00:00"
+                         valid-to     ="2100-01-31 23:59:59"
+		         last-modified="2015-08-18 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="65536" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.409194" t="66.000154" p="-90.000000" name="bank1" rot="90.000000" 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="131072" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.439191" t="66.708491" p="-64.501198" name="bank2" rot="134.999991" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="55.999978">
+    <rot val="90.000000" axis-x="0" axis-y="1" axis-z="0" />
+  </rot>
+</location>
+</component>
+<component type="panel" idstart="196608" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.409194" t="90.000086" p="-66.000154" name="bank3" rot="-179.999790" 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="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="458752" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.409194" t="90.000086" p="-113.999846" name="bank7" rot="-0.000210" 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="524288" idfillbyfirst="y" idstepbyrow="256">
+<location r="0.439191" t="66.708491" p="-115.498802" name="bank8" rot="45.000009" axis-x="0" axis-y="1" axis-z="0">
+  <rot val="55.999978">
+    <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>
+
+<!-- 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/scripts/Engineering/EnggUtils.py b/Code/Mantid/scripts/Engineering/EnggUtils.py
index 410ea6ed66cf3ddb0fd5231f8be0ce211f4596f3..aaca870ea651dbff4c7d3e9368cbf02da44a4ae3 100644
--- a/Code/Mantid/scripts/Engineering/EnggUtils.py
+++ b/Code/Mantid/scripts/Engineering/EnggUtils.py
@@ -149,10 +149,17 @@ def getDetIDsForBank(bank):
 
     alg = AlgorithmManager.create('LoadDetectorsGroupingFile')
     alg.setProperty('InputFile', groupingFilePath)
-    alg.setProperty('OutputWorkspace', '__EnginXGrouping')
+    grpName = '__EnginXGrouping'
+    alg.setProperty('OutputWorkspace', grpName)
     alg.execute()
 
-    grouping = mtd['__EnginXGrouping']
+    # LoadDetectorsGroupingFile produces a 'Grouping' workspace.
+    # PropertyWithValue<GroupingWorkspace> not working (GitHub issue 13437)
+    # => cannot run as child and get outputworkspace property properly
+    if not AnalysisDataService.doesExist(grpName):
+        raise RuntimeError('LoadDetectorsGroupingFile did not run correctly. Could not '
+                           'find its output workspace: ' + grpName)
+    grouping = mtd[grpName]
 
     detIDs = set()
 
diff --git a/Code/Mantid/scripts/FilterEvents/ErrorMessage.ui b/Code/Mantid/scripts/FilterEvents/ErrorMessage.ui
index 1d6c9a96615e1841de2b1937fcd192a6f99a0a6b..9c54a0c41fcf40bad9046df36dad1d195f1a8ffb 100644
--- a/Code/Mantid/scripts/FilterEvents/ErrorMessage.ui
+++ b/Code/Mantid/scripts/FilterEvents/ErrorMessage.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>408</width>
-    <height>262</height>
+    <width>400</width>
+    <height>225</height>
    </rect>
   </property>
   <property name="minimumSize">
@@ -17,9 +17,22 @@
    </size>
   </property>
   <property name="windowTitle">
-   <string>Dialog</string>
+   <string>Error</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
+   <item row="1" column="0">
+    <spacer name="verticalSpacer_3">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>17</width>
+       <height>37</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
    <item row="0" column="0">
     <layout class="QVBoxLayout" name="verticalLayout_3">
      <item>
@@ -210,19 +223,6 @@
      </item>
     </layout>
    </item>
-   <item row="1" column="0">
-    <spacer name="verticalSpacer_3">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <resources/>
diff --git a/Code/Mantid/scripts/FilterEvents/MainWindow.ui b/Code/Mantid/scripts/FilterEvents/MainWindow.ui
index 9ca23e97f14df047496de79e7bd5eb06462b8f1e..b1289d6367a9d4201562c0f9ebff02e92de1c229 100644
--- a/Code/Mantid/scripts/FilterEvents/MainWindow.ui
+++ b/Code/Mantid/scripts/FilterEvents/MainWindow.ui
@@ -6,1344 +6,1363 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1332</width>
-    <height>1259</height>
+    <width>729</width>
+    <height>915</height>
    </rect>
   </property>
   <property name="windowTitle">
-   <string>MainWindow</string>
+   <string>Filter Events Interface</string>
   </property>
   <widget class="QWidget" name="centralwidget">
-   <layout class="QGridLayout" name="gridLayout">
-    <item row="0" column="0">
-     <layout class="QVBoxLayout" name="verticalLayout_5">
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
-         <widget class="QLabel" name="label_logname_2">
-          <property name="minimumSize">
-           <size>
-            <width>40</width>
-            <height>0</height>
-           </size>
-          </property>
-          <property name="toolTip">
-           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the NeXus file or the run number to load&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-          <property name="whatsThis">
-           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Label for file name or run number&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-          <property name="text">
-           <string>File / Run </string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_5">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit">
-          <property name="toolTip">
-           <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the NeXus file or the run number to load. &lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Run number should be InstrumentName_RunNumber (for example, NOM_11788)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_browse">
-          <property name="text">
-           <string>Browse</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_6">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_load">
-          <property name="text">
-           <string>Load</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <spacer name="verticalSpacer">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeType">
-         <enum>QSizePolicy::Fixed</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>20</width>
-          <height>5</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_2">
-        <item>
-         <widget class="QPushButton" name="pushButton_refreshWS">
-          <property name="maximumSize">
-           <size>
-            <width>200</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>Refresh</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_7">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QComboBox" name="comboBox">
-          <property name="minimumSize">
-           <size>
-            <width>80</width>
-            <height>0</height>
-           </size>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_8">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_3">
-          <property name="maximumSize">
-           <size>
-            <width>200</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>Use</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <spacer name="verticalSpacer_2">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeType">
-         <enum>QSizePolicy::Preferred</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>20</width>
-          <height>40</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_3">
-        <item>
-         <widget class="QLabel" name="label_logname">
-          <property name="maximumSize">
-           <size>
-            <width>160</width>
-            <height>16777215</height>
-           </size>
-          </property>
-          <property name="text">
-           <string>Log Name</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_lognamevalue">
-          <property name="text">
-           <string>?</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_25">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_4">
-        <item>
-         <widget class="MplFigureCanvas" name="graphicsView"/>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_9">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <layout class="QVBoxLayout" name="verticalLayout">
-          <item>
-           <widget class="QSlider" name="verticalSlider">
-            <property name="orientation">
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="tickPosition">
-             <enum>QSlider::TicksAbove</enum>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QSlider" name="verticalSlider_2">
-            <property name="orientation">
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="tickPosition">
-             <enum>QSlider::TicksBelow</enum>
+   <widget class="QPushButton" name="helpBtn">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>870</y>
+      <width>20</width>
+      <height>20</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>?</string>
+    </property>
+   </widget>
+   <widget class="QWidget" name="layoutWidget">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>721</width>
+      <height>861</height>
+     </rect>
+    </property>
+    <layout class="QVBoxLayout" name="verticalLayout_5">
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout">
+       <item>
+        <widget class="QLabel" name="label_logname_2">
+         <property name="minimumSize">
+          <size>
+           <width>40</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the NeXus file or the run number to load&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="whatsThis">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Label for file name or run number&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+         <property name="text">
+          <string>File / Run </string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_5">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit">
+         <property name="toolTip">
+          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the NeXus file or the run number to load. &lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Run number should be InstrumentName_RunNumber (for example, NOM_11788)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_browse">
+         <property name="text">
+          <string>Browse</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_6">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_load">
+         <property name="text">
+          <string>Load</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="verticalSpacer">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Fixed</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>13</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_2">
+       <item>
+        <widget class="QPushButton" name="pushButton_refreshWS">
+         <property name="maximumSize">
+          <size>
+           <width>200</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Refresh</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_7">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QComboBox" name="comboBox">
+         <property name="minimumSize">
+          <size>
+           <width>80</width>
+           <height>0</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_8">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_3">
+         <property name="maximumSize">
+          <size>
+           <width>200</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Use</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="verticalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Preferred</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>40</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_3">
+       <item>
+        <widget class="QLabel" name="label_logname">
+         <property name="maximumSize">
+          <size>
+           <width>160</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>Log Name</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_lognamevalue">
+         <property name="text">
+          <string>?</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_25">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_4">
+       <item>
+        <widget class="MplFigureCanvas" name="graphicsView"/>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_9">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QSlider" name="verticalSlider">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="tickPosition">
+            <enum>QSlider::TicksAbove</enum>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QSlider" name="verticalSlider_2">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="tickPosition">
+            <enum>QSlider::TicksBelow</enum>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_5">
+       <item>
+        <widget class="QSlider" name="horizontalSlider">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="tickPosition">
+          <enum>QSlider::TicksAbove</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_10">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QSlider" name="horizontalSlider_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="tickPosition">
+          <enum>QSlider::TicksAbove</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_11">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="verticalSpacer_3">
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Preferred</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>20</width>
+         <height>40</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_6">
+       <item>
+        <widget class="QLabel" name="label_3">
+         <property name="text">
+          <string>Starting Time</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit_3"/>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_setT0">
+         <property name="text">
+          <string>Set</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_12">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_4">
+         <property name="text">
+          <string>Stopping Time</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit_4"/>
+       </item>
+       <item>
+        <widget class="QPushButton" name="pushButton_setTf">
+         <property name="text">
+          <string>Set</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="horizontalLayout_7">
+       <item>
+        <widget class="QLabel" name="label_outwsname">
+         <property name="text">
+          <string>Output Name</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit_outwsname"/>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer_13">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="label_5">
+         <property name="text">
+          <string>Splitter Title</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QLineEdit" name="lineEdit_title"/>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <widget class="QTabWidget" name="filterTab">
+       <property name="minimumSize">
+        <size>
+         <width>0</width>
+         <height>100</height>
+        </size>
+       </property>
+       <property name="currentIndex">
+        <number>0</number>
+       </property>
+       <widget class="QWidget" name="tab">
+        <attribute name="title">
+         <string>Filter By Log</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_2">
+         <item row="0" column="0">
+          <widget class="QScrollArea" name="scrollArea">
+           <property name="widgetResizable">
+            <bool>true</bool>
+           </property>
+           <widget class="QWidget" name="scrollAreaWidgetContents">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>0</y>
+              <width>693</width>
+              <height>234</height>
+             </rect>
             </property>
+            <layout class="QGridLayout" name="gridLayout_5">
+             <item row="0" column="0">
+              <layout class="QVBoxLayout" name="verticalLayout_2">
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_8">
+                 <item>
+                  <widget class="QLabel" name="label_7">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Sample Log</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_2"/>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_14">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QPushButton" name="pushButton_4">
+                   <property name="text">
+                    <string>Plot</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_24">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_9">
+                 <item>
+                  <widget class="QLabel" name="label_mean">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Mean</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_meanvalue">
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_avg">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Time Average</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_timeAvgValue">
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_26">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_10">
+                 <item>
+                  <widget class="QLabel" name="label_freq">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Frequency</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_freqValue">
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_logsize">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Log Size</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_logsizevalue">
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>40</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_11">
+                 <item>
+                  <widget class="QLabel" name="label_8">
+                   <property name="text">
+                    <string>Minimum Value</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_5"/>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_15">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_9">
+                   <property name="text">
+                    <string>Maximum Value</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_6"/>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_12">
+                 <item>
+                  <widget class="QLabel" name="label_10">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Log Step Size</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_7">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_16">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_11">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Value Change Direction</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_4"/>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_13">
+                 <item>
+                  <widget class="QLabel" name="label_19">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Log Value Tolerance</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_8">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_17">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_21">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Log Boundary</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_5"/>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_14">
+                 <item>
+                  <widget class="QLabel" name="label_20">
+                   <property name="maximumSize">
+                    <size>
+                     <width>160</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Time Tolerance</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_9">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_18">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QPushButton" name="pushButton_filterLog">
+                   <property name="minimumSize">
+                    <size>
+                     <width>200</width>
+                     <height>0</height>
+                    </size>
+                   </property>
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Filter</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_23">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </item>
+            </layout>
            </widget>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_5">
-        <item>
-         <widget class="QSlider" name="horizontalSlider">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="tickPosition">
-           <enum>QSlider::TicksAbove</enum>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_10">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QSlider" name="horizontalSlider_2">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="tickPosition">
-           <enum>QSlider::TicksAbove</enum>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_11">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <spacer name="verticalSpacer_3">
-        <property name="orientation">
-         <enum>Qt::Vertical</enum>
-        </property>
-        <property name="sizeType">
-         <enum>QSizePolicy::Preferred</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>20</width>
-          <height>40</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_6">
-        <item>
-         <widget class="QLabel" name="label_3">
-          <property name="text">
-           <string>Starting Time</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit_3"/>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_setT0">
-          <property name="text">
-           <string>Set</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_12">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_4">
-          <property name="text">
-           <string>Stopping Time</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit_4"/>
-        </item>
-        <item>
-         <widget class="QPushButton" name="pushButton_setTf">
-          <property name="text">
-           <string>Set</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout_7">
-        <item>
-         <widget class="QLabel" name="label_outwsname">
-          <property name="text">
-           <string>Output Name</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit_outwsname"/>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer_13">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::Preferred</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_5">
-          <property name="text">
-           <string>Splitter Title</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="lineEdit_title"/>
-        </item>
-       </layout>
-      </item>
-      <item>
-       <widget class="QTabWidget" name="filterTab">
-        <property name="minimumSize">
-         <size>
-          <width>0</width>
-          <height>100</height>
-         </size>
-        </property>
-        <property name="currentIndex">
-         <number>0</number>
-        </property>
-        <widget class="QWidget" name="tab">
-         <attribute name="title">
-          <string>Filter By Log</string>
-         </attribute>
-         <layout class="QGridLayout" name="gridLayout_2">
-          <item row="0" column="0">
-           <widget class="QScrollArea" name="scrollArea">
-            <property name="widgetResizable">
-             <bool>true</bool>
-            </property>
-            <widget class="QWidget" name="scrollAreaWidgetContents">
-             <property name="geometry">
-              <rect>
-               <x>0</x>
-               <y>0</y>
-               <width>1288</width>
-               <height>383</height>
-              </rect>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+       <widget class="QWidget" name="tab_2">
+        <attribute name="title">
+         <string>Filter By Time</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_3">
+         <item row="0" column="0">
+          <layout class="QHBoxLayout" name="horizontalLayout_15">
+           <item>
+            <widget class="QLabel" name="label_6">
+             <property name="maximumSize">
+              <size>
+               <width>160</width>
+               <height>16777215</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>Time Interval</string>
              </property>
-             <layout class="QGridLayout" name="gridLayout_5">
-              <item row="0" column="0">
-               <layout class="QVBoxLayout" name="verticalLayout_2">
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_8">
-                  <item>
-                   <widget class="QLabel" name="label_7">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Sample Log</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_2"/>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_14">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="pushButton_4">
-                    <property name="text">
-                     <string>Plot</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_24">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_9">
-                  <item>
-                   <widget class="QLabel" name="label_mean">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Mean</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_meanvalue">
-                    <property name="maximumSize">
-                     <size>
-                      <width>16777215</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>?</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_avg">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Time Average</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_timeAvgValue">
-                    <property name="maximumSize">
-                     <size>
-                      <width>16777215</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>?</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_26">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_10">
-                  <item>
-                   <widget class="QLabel" name="label_freq">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Frequency</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_freqValue">
-                    <property name="maximumSize">
-                     <size>
-                      <width>16777215</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>?</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_logsize">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Log Size</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_logsizevalue">
-                    <property name="maximumSize">
-                     <size>
-                      <width>16777215</width>
-                      <height>40</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>?</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_11">
-                  <item>
-                   <widget class="QLabel" name="label_8">
-                    <property name="text">
-                     <string>Minimum Value</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_5"/>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_15">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_9">
-                    <property name="text">
-                     <string>Maximum Value</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_6"/>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_12">
-                  <item>
-                   <widget class="QLabel" name="label_10">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Log Step Size</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_7">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_16">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_11">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Value Change Direction</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_4"/>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_13">
-                  <item>
-                   <widget class="QLabel" name="label_19">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Log Value Tolerance</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_8">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_17">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QLabel" name="label_21">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Log Boundary</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_5"/>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_14">
-                  <item>
-                   <widget class="QLabel" name="label_20">
-                    <property name="maximumSize">
-                     <size>
-                      <width>160</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Time Tolerance</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_9">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_18">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="pushButton_filterLog">
-                    <property name="minimumSize">
-                     <size>
-                      <width>200</width>
-                      <height>0</height>
-                     </size>
-                    </property>
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Filter</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_23">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-               </layout>
-              </item>
-             </layout>
             </widget>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-        <widget class="QWidget" name="tab_2">
-         <attribute name="title">
-          <string>Filter By Time</string>
-         </attribute>
-         <layout class="QGridLayout" name="gridLayout_3">
-          <item row="0" column="0">
-           <layout class="QHBoxLayout" name="horizontalLayout_15">
-            <item>
-             <widget class="QLabel" name="label_6">
-              <property name="maximumSize">
-               <size>
-                <width>160</width>
-                <height>16777215</height>
-               </size>
-              </property>
-              <property name="text">
-               <string>Time Interval</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer_2">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeType">
-               <enum>QSizePolicy::Preferred</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QLineEdit" name="lineEdit_timeInterval">
-              <property name="maximumSize">
-               <size>
-                <width>200</width>
-                <height>16777215</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-            <item>
-             <widget class="QPushButton" name="pushButton_filterTime">
-              <property name="minimumSize">
-               <size>
-                <width>200</width>
-                <height>0</height>
-               </size>
-              </property>
-              <property name="text">
-               <string>Filter</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <spacer name="horizontalSpacer_19">
-              <property name="orientation">
-               <enum>Qt::Horizontal</enum>
-              </property>
-              <property name="sizeType">
-               <enum>QSizePolicy::Preferred</enum>
-              </property>
-              <property name="sizeHint" stdset="0">
-               <size>
-                <width>40</width>
-                <height>20</height>
-               </size>
-              </property>
-             </spacer>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </widget>
-        <widget class="QWidget" name="tab_3">
-         <attribute name="title">
-          <string>Advanced Setup</string>
-         </attribute>
-         <layout class="QGridLayout" name="gridLayout_4">
-          <item row="0" column="0">
-           <widget class="QScrollArea" name="scrollArea_2">
-            <property name="widgetResizable">
-             <bool>true</bool>
-            </property>
-            <widget class="QWidget" name="scrollAreaWidgetContents_2">
-             <property name="geometry">
-              <rect>
-               <x>0</x>
-               <y>0</y>
-               <width>1288</width>
-               <height>383</height>
-              </rect>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_2">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
              </property>
-             <layout class="QGridLayout" name="gridLayout_6">
-              <item row="0" column="0">
-               <layout class="QVBoxLayout" name="verticalLayout_4">
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_16">
-                  <item>
-                   <widget class="QLabel" name="label_12">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>TOF Correction To Sample</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_tofCorr">
-                    <item>
-                     <property name="text">
-                      <string>None</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Elastic</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Direct</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Indirect</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Customized</string>
-                     </property>
-                    </item>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_20">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_17">
-                  <item>
-                   <widget class="QLabel" name="label_Ei">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Incident Energy</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QLineEdit" name="lineEdit_Ei">
-                    <property name="maximumSize">
-                     <size>
-                      <width>400</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_21">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_18">
-                  <item>
-                   <widget class="QLabel" name="label_Ei_2">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>TOF Correction Workspace</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_corrWS"/>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="pushButton_refreshCorrWSList">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string>Refresh</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_22">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <widget class="Line" name="line">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_19">
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_fastLog">
-                    <property name="font">
-                     <font>
-                      <weight>75</weight>
-                      <bold>true</bold>
-                      <strikeout>false</strikeout>
-                     </font>
-                    </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Preferred</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QLineEdit" name="lineEdit_timeInterval">
+             <property name="maximumSize">
+              <size>
+               <width>200</width>
+               <height>16777215</height>
+              </size>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QPushButton" name="pushButton_filterTime">
+             <property name="minimumSize">
+              <size>
+               <width>200</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="text">
+              <string>Filter</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_19">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeType">
+              <enum>QSizePolicy::Preferred</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </widget>
+       <widget class="QWidget" name="tab_3">
+        <attribute name="title">
+         <string>Advanced Setup</string>
+        </attribute>
+        <layout class="QGridLayout" name="gridLayout_4">
+         <item row="0" column="0">
+          <widget class="QScrollArea" name="scrollArea_2">
+           <property name="widgetResizable">
+            <bool>true</bool>
+           </property>
+           <widget class="QWidget" name="scrollAreaWidgetContents_2">
+            <property name="geometry">
+             <rect>
+              <x>0</x>
+              <y>0</y>
+              <width>693</width>
+              <height>234</height>
+             </rect>
+            </property>
+            <layout class="QGridLayout" name="gridLayout_6">
+             <item row="0" column="0">
+              <layout class="QVBoxLayout" name="verticalLayout_4">
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_16">
+                 <item>
+                  <widget class="QLabel" name="label_12">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>TOF Correction To Sample</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_tofCorr">
+                   <item>
                     <property name="text">
-                     <string>Fast Log</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_doParallel">
-                    <property name="font">
-                     <font>
-                      <weight>75</weight>
-                      <bold>true</bold>
-                     </font>
+                     <string>None</string>
                     </property>
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Generate Filter In Parallel</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <widget class="Line" name="line_2">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_20">
-                  <item>
-                   <widget class="QLabel" name="label_13">
-                    <property name="maximumSize">
-                     <size>
-                      <width>200</width>
-                      <height>16777215</height>
-                     </size>
+                     <string>Elastic</string>
                     </property>
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Spectrum without Detector</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_3">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Fixed</enum>
+                     <string>Direct</string>
                     </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                  <item>
-                   <widget class="QComboBox" name="comboBox_skipSpectrum">
-                    <property name="maximumSize">
-                     <size>
-                      <width>600</width>
-                      <height>16777215</height>
-                     </size>
-                    </property>
-                    <item>
-                     <property name="text">
-                      <string>Skip</string>
-                     </property>
-                    </item>
-                    <item>
-                     <property name="text">
-                      <string>Skip only if TOF correction</string>
-                     </property>
-                    </item>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_4">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeType">
-                     <enum>QSizePolicy::Preferred</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_21">
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_filterByPulse">
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Filter By Pulse Time</string>
+                     <string>Indirect</string>
                     </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_from1">
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Output Workspace Indexed From 1</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-                <item>
-                 <layout class="QHBoxLayout" name="horizontalLayout_22">
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_groupWS">
+                     <string>Customized</string>
+                    </property>
+                   </item>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_20">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_17">
+                 <item>
+                  <widget class="QLabel" name="label_Ei">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Incident Energy</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLineEdit" name="lineEdit_Ei">
+                   <property name="maximumSize">
+                    <size>
+                     <width>400</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_21">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_18">
+                 <item>
+                  <widget class="QLabel" name="label_Ei_2">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>TOF Correction Workspace</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_corrWS"/>
+                 </item>
+                 <item>
+                  <widget class="QPushButton" name="pushButton_refreshCorrWSList">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Refresh</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_22">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <widget class="Line" name="line">
+                 <property name="orientation">
+                  <enum>Qt::Horizontal</enum>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_19">
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_fastLog">
+                   <property name="font">
+                    <font>
+                     <weight>75</weight>
+                     <bold>true</bold>
+                     <strikeout>false</strikeout>
+                    </font>
+                   </property>
+                   <property name="text">
+                    <string>Fast Log</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_doParallel">
+                   <property name="font">
+                    <font>
+                     <weight>75</weight>
+                     <bold>true</bold>
+                    </font>
+                   </property>
+                   <property name="text">
+                    <string>Generate Filter In Parallel</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <widget class="Line" name="line_2">
+                 <property name="orientation">
+                  <enum>Qt::Horizontal</enum>
+                 </property>
+                </widget>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_20">
+                 <item>
+                  <widget class="QLabel" name="label_13">
+                   <property name="maximumSize">
+                    <size>
+                     <width>200</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string>Spectrum without Detector</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_3">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Fixed</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                 <item>
+                  <widget class="QComboBox" name="comboBox_skipSpectrum">
+                   <property name="maximumSize">
+                    <size>
+                     <width>600</width>
+                     <height>16777215</height>
+                    </size>
+                   </property>
+                   <item>
                     <property name="text">
-                     <string>Group Output Workspace</string>
+                     <string>Skip</string>
                     </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QCheckBox" name="checkBox_splitLog">
+                   </item>
+                   <item>
                     <property name="text">
-                     <string>Split Sample Logs</string>
-                    </property>
-                   </widget>
-                  </item>
-                 </layout>
-                </item>
-               </layout>
-              </item>
-             </layout>
-            </widget>
+                     <string>Skip only if TOF correction</string>
+                    </property>
+                   </item>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_4">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Preferred</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_21">
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_filterByPulse">
+                   <property name="text">
+                    <string>Filter By Pulse Time</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_from1">
+                   <property name="text">
+                    <string>Output Workspace Indexed From 1</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_22">
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_groupWS">
+                   <property name="text">
+                    <string>Group Output Workspace</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QCheckBox" name="checkBox_splitLog">
+                   <property name="text">
+                    <string>Split Sample Logs</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </item>
+            </layout>
            </widget>
-          </item>
-         </layout>
-        </widget>
+          </widget>
+         </item>
+        </layout>
        </widget>
-      </item>
-     </layout>
-    </item>
-   </layout>
+      </widget>
+     </item>
+    </layout>
+   </widget>
   </widget>
   <widget class="QMenuBar" name="menubar">
    <property name="geometry">
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>1332</width>
-     <height>25</height>
+     <width>729</width>
+     <height>21</height>
     </rect>
    </property>
   </widget>
@@ -1356,6 +1375,52 @@
    <header>MplFigureCanvas.h</header>
   </customwidget>
  </customwidgets>
+ <tabstops>
+  <tabstop>helpBtn</tabstop>
+  <tabstop>pushButton_browse</tabstop>
+  <tabstop>pushButton_load</tabstop>
+  <tabstop>pushButton_refreshWS</tabstop>
+  <tabstop>comboBox</tabstop>
+  <tabstop>pushButton_3</tabstop>
+  <tabstop>graphicsView</tabstop>
+  <tabstop>verticalSlider</tabstop>
+  <tabstop>verticalSlider_2</tabstop>
+  <tabstop>horizontalSlider</tabstop>
+  <tabstop>horizontalSlider_2</tabstop>
+  <tabstop>lineEdit_3</tabstop>
+  <tabstop>pushButton_setT0</tabstop>
+  <tabstop>lineEdit_4</tabstop>
+  <tabstop>pushButton_setTf</tabstop>
+  <tabstop>lineEdit_outwsname</tabstop>
+  <tabstop>lineEdit_title</tabstop>
+  <tabstop>filterTab</tabstop>
+  <tabstop>scrollArea</tabstop>
+  <tabstop>comboBox_2</tabstop>
+  <tabstop>pushButton_4</tabstop>
+  <tabstop>lineEdit_5</tabstop>
+  <tabstop>lineEdit_6</tabstop>
+  <tabstop>lineEdit_7</tabstop>
+  <tabstop>comboBox_4</tabstop>
+  <tabstop>lineEdit_8</tabstop>
+  <tabstop>comboBox_5</tabstop>
+  <tabstop>lineEdit_9</tabstop>
+  <tabstop>pushButton_filterLog</tabstop>
+  <tabstop>lineEdit_timeInterval</tabstop>
+  <tabstop>pushButton_filterTime</tabstop>
+  <tabstop>scrollArea_2</tabstop>
+  <tabstop>comboBox_tofCorr</tabstop>
+  <tabstop>lineEdit_Ei</tabstop>
+  <tabstop>comboBox_corrWS</tabstop>
+  <tabstop>pushButton_refreshCorrWSList</tabstop>
+  <tabstop>checkBox_fastLog</tabstop>
+  <tabstop>checkBox_doParallel</tabstop>
+  <tabstop>comboBox_skipSpectrum</tabstop>
+  <tabstop>checkBox_filterByPulse</tabstop>
+  <tabstop>checkBox_from1</tabstop>
+  <tabstop>checkBox_groupWS</tabstop>
+  <tabstop>checkBox_splitLog</tabstop>
+  <tabstop>lineEdit</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
diff --git a/Code/Mantid/scripts/FilterEvents/eventFilterGUI.py b/Code/Mantid/scripts/FilterEvents/eventFilterGUI.py
index 8e3e041c53879c90cd90492303423a067646503a..176ff8f55973b1224f44fb838fc81042dbf9fbc8 100644
--- a/Code/Mantid/scripts/FilterEvents/eventFilterGUI.py
+++ b/Code/Mantid/scripts/FilterEvents/eventFilterGUI.py
@@ -11,6 +11,7 @@ from matplotlib.pyplot import setp
 import mantid
 import mantid.simpleapi as api
 import mantid.kernel
+from mantid.kernel import Logger
 from mantid.simpleapi import AnalysisDataService
 
 from mantid.kernel import ConfigService
@@ -210,6 +211,9 @@ class MainWindow(QtGui.QMainWindow):
 
         self.connect(self.ui.pushButton_filterLog, SIGNAL('clicked()'), self.filterByLogValue)
 
+        #Set up help button
+        self.connect(self.ui.helpBtn, QtCore.SIGNAL('clicked()'), self.helpClicked)
+
         # Set up vertical slide
         self._upperSlideValue = 99
         self._lowerSlideValue = 0
@@ -226,6 +230,7 @@ class MainWindow(QtGui.QMainWindow):
 
         # Set up for filtering (advanced setup)
         self._tofcorrection = False
+        self.ui.checkBox_fastLog.setChecked(False)
         self.ui.checkBox_filterByPulse.setChecked(False)
         self.ui.checkBox_from1.setChecked(False)
         self.ui.checkBox_groupWS.setChecked(True)
@@ -346,7 +351,8 @@ class MainWindow(QtGui.QMainWindow):
         """ Set the starting time and left slide bar
         """
         inps = str(self.ui.lineEdit_3.text())
-        print "Starting time = %s" % (inps)
+        info_msg = "Starting time = %s" % (inps)
+        Logger("Filter_Events").information(info_msg)
 
         xlim = self.ui.mainplot.get_xlim()
         if inps == "":
@@ -357,7 +363,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Convert to integer slide value
         ileftvalue = int( (newtime0-xlim[0])/(xlim[1] - xlim[0])*100 )
-        print "iLeftSlide = %d" % (ileftvalue)
+        debug_msg = "iLeftSlide = %s" % str(ileftvalue)
+        Logger("Filter_Events").debug(debug_msg)
 
         # Skip if same as origina
         if ileftvalue == self._leftSlideValue:
@@ -376,7 +383,8 @@ class MainWindow(QtGui.QMainWindow):
 
         if resetT is True:
             newtime0 = xlim[0] + ileftvalue*(xlim[1]-xlim[0])*0.01
-        print "Corrected iLeftSlide = %d (vs. right = %d)" % (ileftvalue, self._rightSlideValue)
+        info_msg = "Corrected iLeftSlide = %s (vs. right = %s)" % (str(ileftvalue), str(self._rightSlideValue))
+        Logger("Filter_Events").information(info_msg)
 
         # Move the slide bar (left)
         self._leftSlideValue = ileftvalue
@@ -427,7 +435,8 @@ class MainWindow(QtGui.QMainWindow):
         """ Set the starting time and left slide bar
         """
         inps = str(self.ui.lineEdit_4.text())
-        print "Stopping time = %s" % (inps)
+        info_msg = "Stopping time = %s" % (inps)
+        Logger("Filter_Events").information(info_msg)
 
         xlim = self.ui.mainplot.get_xlim()
         if inps == "":
@@ -439,7 +448,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Convert to integer slide value
         irightvalue = int( (newtimef-xlim[0])/(xlim[1] - xlim[0])*100 )
-        print "iRightSlide = %d" % (irightvalue)
+        info_msg = "iRightSlide = %s" % str(irightvalue)
+        Logger("Filter_Events").information(info_msg)
 
         # Return if no change
         if irightvalue == self._rightSlideValue:
@@ -481,7 +491,8 @@ class MainWindow(QtGui.QMainWindow):
         Triggered by a change in Qt Widget.  NO EVENT is required.
         """
         inewy = self.ui.verticalSlider_2.value()
-        print "LowerSlider is set with value %d  vs. class variable %d" % (inewy, self._lowerSlideValue)
+        debug_msg = "LowerSlFider is set with value %s  vs. class variable %s" % (str(inewy), str(self._lowerSlideValue))
+        Logger("Filter_Events").debug(debug_msg)
 
         # Return with no change
         if inewy == self._lowerSlideValue:
@@ -518,7 +529,8 @@ class MainWindow(QtGui.QMainWindow):
     def set_minLogValue(self):
         """ Set the starting time and left slide bar
         """
-        print "Minimum Log Value = %s" %(str(self.ui.lineEdit_5.text()))
+        debug_msg = "Minimum Log Value = %s" %(str(self.ui.lineEdit_5.text()))
+        Logger("Filter_Events").debug(debug_msg)
 
         ylim = self.ui.mainplot.get_ylim()
 
@@ -531,7 +543,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Convert to integer slide value
         iminlogval = int( (newminY-ylim[0])/(ylim[1] - ylim[0])*100 )
-        print "ilowerSlide = %d" % (iminlogval)
+        debug_msg = "ilowerSlide = %s" % str(iminlogval)
+        Logger("Filter_Events").debug(debug_msg)
 
         # Return if no change
         if iminlogval == self._lowerSlideValue:
@@ -556,7 +569,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Move the slide bar (lower)
         self._lowerSlideValue = iminlogval
-        print "LineEdit5 set slide to %d" % (self._lowerSlideValue)
+        debug_msg = "LineEdit5 set slide to %s" % str(self._lowerSlideValue)
+        Logger("Filter_Events").debug(debug_msg)
         self.ui.verticalSlider_2.setValue(self._lowerSlideValue)
 
         # Reset line Edit if using default
@@ -605,7 +619,8 @@ class MainWindow(QtGui.QMainWindow):
         """ Set maximum log value from line-edit
         """
         inps = str(self.ui.lineEdit_6.text())
-        print "Maximum Log Value = %s" %(inps)
+        debug_msg = "Maximum Log Value = %s" %(inps)
+        Logger("Filter_Events").debug(debug_msg)
 
         ylim = self.ui.mainplot.get_ylim()
         if inps == "":
@@ -617,7 +632,8 @@ class MainWindow(QtGui.QMainWindow):
 
         # Convert to integer slide value
         imaxlogval = int( (newmaxY-ylim[0])/(ylim[1] - ylim[0])*100 )
-        print "iUpperSlide = %d" % (imaxlogval)
+        debug_msg = "iUpperSlide = %s" % str(imaxlogval)
+        Logger("Filter_Events").debug(debug_msg)
 
         # Return if no change
         if imaxlogval == self._upperSlideValue:
@@ -661,7 +677,9 @@ class MainWindow(QtGui.QMainWindow):
 
         self.ui.lineEdit.setText(str(filename))
 
-        # print "Selected file: ", filename
+        info_msg = "Selected file: %s." % str(filename)
+        Logger("Filter_Events").information(info_msg)
+
 
         return
 
@@ -679,9 +697,9 @@ class MainWindow(QtGui.QMainWindow):
 
         dataws = self._loadFile(str(filename))
         if dataws is None:
-            errmsg = "Unable to locate run %s in default directory %s." % (filename, self._defaultdir)
-            print errmsg
-            self._setErrorMsg(errmsg)
+            error_msg = "Unable to locate run %s in default directory %s." % (filename, self._defaultdir)
+            Logger("Filter_Events").error(error_msg)
+            self._setErrorMsg(error_msg)
         else:
             self._importDataWorkspace(dataws)
             self._defaultdir = os.path.dirname(str(filename))
@@ -724,9 +742,10 @@ class MainWindow(QtGui.QMainWindow):
 
         # check
         if len(vectimes) == 0:
-            print "Empty log!"
+            error_msg = "Empty log!"
+            Logger("Filter_Events").error(error_msg)
 
-        # Convert absolute time to relative time in seconds
+        #Convert absolute time to relative time in seconds
         t0 = self._dataWS.getRun().getProperty("proton_charge").times[0]
         t0ns = t0.totalNanoseconds()
 
@@ -890,7 +909,8 @@ class MainWindow(QtGui.QMainWindow):
             # Construct a file name from run number
             runnumber = int(filename)
             if runnumber <= 0:
-                print "Run number cannot be less or equal to zero.  User gives %s. " % (filename)
+                error_msg = "Run number cannot be less or equal to zero.  User gives %s. " % (filename)
+                Logger("Filter_Events").error(error_msg)
                 return None
             else:
                 ishort = config.getInstrument(self._instrument).shortName()
@@ -911,19 +931,24 @@ class MainWindow(QtGui.QMainWindow):
                 wsname = "%s_%s_event" % (ishort, str_runnumber)
             else:
                 # Non-supported
-                print "File name / run number in such format %s is not supported. " % (filename)
+                error_msg = "File name / run number in such format %s is not supported. " % (filename)
+                Logger("Filter_Events").error(error_msg)
+
                 return None
 
         else:
             # Unsupported format
-            print "File name / run number in such format %s is not supported. " % (filename)
+            error_msg = "File name / run number in such format %s is not supported. " % (filename)
+            Logger("Filter_Events").error(error_msg)
+
             return None
 
         # Load
         try:
             ws = api.Load(Filename=filename, OutputWorkspace=wsname)
-        except:
+        except RuntimeError as e:
             ws = None
+            return str(e)
 
         return ws
 
@@ -963,7 +988,7 @@ class MainWindow(QtGui.QMainWindow):
                 sumws = api.ConvertToPointData(InputWorkspace=sumws, OutputWorkspace=sumwsname)
             else:
                 sumws = AnalysisDataService.retrieve(sumwsname)
-        except Exception as e:
+        except RuntimeError as e:
             return str(e)
 
         vecx = sumws.readX(0)
@@ -1017,12 +1042,14 @@ class MainWindow(QtGui.QMainWindow):
         splitinfowsname = str(self._dataWS) + "_info"
 
         title = str(self.ui.lineEdit_title.text())
+        fastLog = self.ui.checkBox_fastLog.isChecked()
 
         splitws, infows = api.GenerateEventsFilter(\
                 InputWorkspace      = self._dataWS,\
                 UnitOfTime          = "Seconds",\
                 TitleOfSplitters    = title,\
                 OutputWorkspace     = splitwsname,\
+                FastLog             = fastLog,\
                 InformationWorkspace = splitinfowsname, **kwargs)
 
         self.splitWksp(splitws, infows)
@@ -1036,32 +1063,39 @@ class MainWindow(QtGui.QMainWindow):
         kwargs = {}
         samplelog = str(self.ui.comboBox_2.currentText())
         if len(samplelog) == 0:
-            print "No sample log is selected!"
+            error_msg = "No sample log is selected!"
+            Logger("Filter_Events").error(error_msg)
             return
 
 
         if self.ui.lineEdit_3.text() != "":
             rel_starttime = float(self.ui.lineEdit_3.text())
             kwargs["StartTime"] = str(rel_starttime)
+
         if self.ui.lineEdit_4.text() != "":
             rel_stoptime = float(self.ui.lineEdit_4.text())
             kwargs["StopTime"] = str(rel_stoptime)
+
         if self.ui.lineEdit_5.text() != "":
             minlogvalue = float(self.ui.lineEdit_5.text())
             kwargs["MinimumLogValue"] = minlogvalue
+
         if self.ui.lineEdit_6.text() != "":
             maxlogvalue = float(self.ui.lineEdit_6.text())
             kwargs["MaximumLogValue"] = maxlogvalue
+
         if self.ui.lineEdit_7.text() != "":
             logvalueintv = float(self.ui.lineEdit_7.text())
             kwargs["LogValueInterval"] = logvalueintv
         logvalchangedir = str(self.ui.comboBox_4.currentText())
         kwargs["FilterLogValueByChangingDirection"] = logvalchangedir
+
         if self.ui.lineEdit_9.text() != "":
             logvalueintv = float(self.ui.lineEdit_9.text())
             kwargs["TimeTolerance"] = logvalueintv
         logboundtype = str(self.ui.comboBox_5.currentText())
         kwargs["LogBoundary"] = logboundtype
+
         if self.ui.lineEdit_8.text() != "":
             logvaluetol = float(self.ui.lineEdit_8.text())
             kwargs["LogValueTolerance"] = logvaluetol
@@ -1069,6 +1103,7 @@ class MainWindow(QtGui.QMainWindow):
 
         splitwsname = str(self._dataWS) + "_splitters"
         splitinfowsname = str(self._dataWS) + "_info"
+        fastLog = self.ui.checkBox_fastLog.isChecked()
 
         title = str(self.ui.lineEdit_title.text())
 
@@ -1078,12 +1113,13 @@ class MainWindow(QtGui.QMainWindow):
                 TitleOfSplitters    = title,\
                 OutputWorkspace     = splitwsname,\
                 LogName             = samplelog,\
+                FastLog             = fastLog,\
                 InformationWorkspace = splitinfowsname, **kwargs)
 
         try:
             self.splitWksp(splitws, infows)
-        except Exception as mtderror:
-            self._setErrorMsg("Splitting Failed!\n %s" % (str(mtderror)))
+        except RuntimeError as e:
+            self._setErrorMsg("Splitting Failed!\n %s" % (str(e)))
 
         return
 
@@ -1196,8 +1232,11 @@ class MainWindow(QtGui.QMainWindow):
 
         return
 
+    def helpClicked(self):
+        from pymantidplot.proxies import showCustomInterfaceHelp
+        showCustomInterfaceHelp("FilterEventUI")
 
-    def _resetGUI(self, resetfilerun=False, resetwslist=False):
+    def _resetGUI(self, resetfilerun=False):
         """ Reset GUI including all text edits and etc.
         """
         if resetfilerun is True: