diff --git a/.gitattributes b/.gitattributes
index 451791e52b895d1475efab45389c85cf2e750eeb..2d3edd2f8c6f72c322e47e06d116ceabf10febe8 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2636,10 +2636,8 @@ MAC/Deployment/data/Coordinates/ETRF_FILES/RS208/rs208-antenna-positions-etrs.cs
 MAC/Deployment/data/Coordinates/ETRF_FILES/RS305/rs305-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/RS306/rs306-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/RS307/rs307-antenna-positions-etrs.csv -text
-MAC/Deployment/data/Coordinates/ETRF_FILES/RS310/rs310-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/RS406/rs406-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/RS407/rs407-antenna-positions-etrs.csv -text
-MAC/Deployment/data/Coordinates/ETRF_FILES/RS409/rs409-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/RS503/rs503-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/RS508/rs508-antenna-positions-etrs.csv -text
 MAC/Deployment/data/Coordinates/ETRF_FILES/RS509/rs509-antenna-positions-etrs.csv -text
@@ -2742,14 +2740,10 @@ MAC/Deployment/data/Coordinates/vectors-and-matrices/RS306/rs306-core-solution-h
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS306/rs306-core-solution-lba.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS307/rs307-core-solution-hba.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS307/rs307-core-solution-lba.lisp -text
-MAC/Deployment/data/Coordinates/vectors-and-matrices/RS310/rs310-hba-solution.lisp -text
-MAC/Deployment/data/Coordinates/vectors-and-matrices/RS310/rs310-lba-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS406/rs406-hba-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS406/rs406-lba-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS407/rs407-hba-core-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS407/rs407-lba-core-solution.lisp -text
-MAC/Deployment/data/Coordinates/vectors-and-matrices/RS409/rs409-hba-core-solution.lisp -text
-MAC/Deployment/data/Coordinates/vectors-and-matrices/RS409/rs409-lba-core-solution.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS503/rs503-core-solution-hba.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS503/rs503-core-solution-lba.lisp -text
 MAC/Deployment/data/Coordinates/vectors-and-matrices/RS508/rs508-hba-solution.lisp -text
@@ -2828,7 +2822,6 @@ MAC/Deployment/data/PVSS/License/RS306C_option.txt -text
 MAC/Deployment/data/PVSS/License/RS307C_option.lcu013.txt -text
 MAC/Deployment/data/PVSS/License/RS307C_option.lcu045.txt -text
 MAC/Deployment/data/PVSS/License/RS406C_option.txt -text
-MAC/Deployment/data/PVSS/License/RS407C_option.txt -text
 MAC/Deployment/data/PVSS/License/RS503_option.txt -text
 MAC/Deployment/data/PVSS/License/RS508C_option.txt -text
 MAC/Deployment/data/PVSS/License/RS509C_option.txt -text
@@ -2879,7 +2872,6 @@ MAC/Deployment/data/PVSS/License/shield.RS306C.txt -text
 MAC/Deployment/data/PVSS/License/shield.RS307C.txt -text
 MAC/Deployment/data/PVSS/License/shield.RS307C_lcu045.txt -text
 MAC/Deployment/data/PVSS/License/shield.RS406C.txt -text
-MAC/Deployment/data/PVSS/License/shield.RS407C.txt -text
 MAC/Deployment/data/PVSS/License/shield.RS503C.txt -text
 MAC/Deployment/data/PVSS/License/shield.RS508C.txt -text
 MAC/Deployment/data/PVSS/License/shield.RS509C.txt -text
@@ -2953,9 +2945,7 @@ MAC/Deployment/data/StaticMetaData/AntennaFields/RS208-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/RS305-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/RS306-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/RS307-AntennaField.conf -text
-MAC/Deployment/data/StaticMetaData/AntennaFields/RS310-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/RS407-AntennaField.conf -text
-MAC/Deployment/data/StaticMetaData/AntennaFields/RS409-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/RS503-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/RS508-AntennaField.conf -text
 MAC/Deployment/data/StaticMetaData/AntennaFields/RS509-AntennaField.conf -text
@@ -3021,9 +3011,7 @@ MAC/Deployment/data/StaticMetaData/iHBADeltas/RS208-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/RS305-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/RS306-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/RS307-iHBADeltas.conf -text
-MAC/Deployment/data/StaticMetaData/iHBADeltas/RS310-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/RS407-iHBADeltas.conf -text
-MAC/Deployment/data/StaticMetaData/iHBADeltas/RS409-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/RS503-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/RS508-iHBADeltas.conf -text
 MAC/Deployment/data/StaticMetaData/iHBADeltas/RS509-iHBADeltas.conf -text
@@ -3344,7 +3332,6 @@ MAC/Navigator2/scripts/monitorStateReset.ctl -text
 MAC/Navigator2/scripts/monitorStationAlarms.ctl -text
 MAC/Navigator2/scripts/readStationBGPconnections.ctl -text
 MAC/Navigator2/scripts/readStationConfigs.ctl -text
-MAC/Navigator2/scripts/transferMPs.ctl -text
 MAC/Test/APL/PVSSproject/colorDB/Lofar[!!-~]colors -text svneol=native#application/octet-stream
 MAC/Test/APL/PVSSproject/colorDB/colorDB_de -text svneol=native#application/octet-stream
 MAC/Test/APL/PVSSproject/config/config -text svneol=native#application/octet-stream
@@ -3615,46 +3602,27 @@ RTCP/IONProc/src/StreamMultiplexer.h -text
 RTCP/IONProc/src/generateDelays.cc -text
 RTCP/IONProc/test/CMakeLists.txt -text
 RTCP/IONProc/test/RTCP.parset -text
+RTCP/IONProc/test/newInputSection/CMakeLists.txt -text
+RTCP/IONProc/test/newInputSection/OMPThread.h -text
+RTCP/IONProc/test/newInputSection/Poll.h -text
+RTCP/IONProc/test/newInputSection/Ranges.h -text
+RTCP/IONProc/test/newInputSection/SampleBuffer.h -text
+RTCP/IONProc/test/newInputSection/SharedMemory.h -text
+RTCP/IONProc/test/newInputSection/StationData.h -text
+RTCP/IONProc/test/newInputSection/StationID.h -text
+RTCP/IONProc/test/newInputSection/StationSettings.h -text
+RTCP/IONProc/test/newInputSection/TimeSync.h -text
+RTCP/IONProc/test/newInputSection/foo.cc -text
+RTCP/IONProc/test/newInputSection/newInputSection.cc -text
+RTCP/IONProc/test/newInputSection/newInputSection_old.cc -text
+RTCP/IONProc/test/newInputSection/shmtest.cc -text
+RTCP/IONProc/test/newInputSection/tRSPTimeStamp.cc -text
 RTCP/IONProc/test/tDelayCompensation.cc -text
 RTCP/IONProc/test/tDelayCompensation.parset -text
 RTCP/IONProc/test/tDelayCompensation.sh -text
-RTCP/IONProc/test/tRSP.cc -text
-RTCP/IONProc/test/tRSP.in_16bit -text
-RTCP/IONProc/test/tRSP.in_8bit -text
-RTCP/IONProc/test/tRSP.sh -text
-RTCP/IONProc/test/tRSP.stdout -text
 RTCP/IONProc/test/tSSH.cc -text
 RTCP/IONProc/test/tSSH.sh -text
 RTCP/IONProc/test/tSSH.stdout -text
-RTCP/InputProc/CMakeLists.txt -text
-RTCP/InputProc/src/BufferSettings.cc -text
-RTCP/InputProc/src/BufferSettings.h -text
-RTCP/InputProc/src/CMakeLists.txt -text
-RTCP/InputProc/src/Generator.cc -text
-RTCP/InputProc/src/Generator.h -text
-RTCP/InputProc/src/OMPThread.h -text
-RTCP/InputProc/src/PacketReader.cc -text
-RTCP/InputProc/src/PacketReader.h -text
-RTCP/InputProc/src/PacketsToBuffer.h -text
-RTCP/InputProc/src/RSPBoards.cc -text
-RTCP/InputProc/src/RSPBoards.h -text
-RTCP/InputProc/src/Ranges.cc -text
-RTCP/InputProc/src/Ranges.h -text
-RTCP/InputProc/src/SampleBuffer.h -text
-RTCP/InputProc/src/SampleBufferReader.h -text
-RTCP/InputProc/src/SampleType.h -text
-RTCP/InputProc/src/SharedMemory.cc -text
-RTCP/InputProc/src/SharedMemory.h -text
-RTCP/InputProc/src/StationID.cc -text
-RTCP/InputProc/src/StationID.h -text
-RTCP/InputProc/src/newInputSection.cc -text
-RTCP/InputProc/src/obsolete/Poll.h -text
-RTCP/InputProc/src/obsolete/TimeSync.h -text
-RTCP/InputProc/test/CMakeLists.txt -text
-RTCP/InputProc/test/tGenerator.cc -text
-RTCP/InputProc/test/tRSPTimeStamp2.cc -text
-RTCP/InputProc/test/tRanges.cc -text
-RTCP/InputProc/test/tSharedMemory.cc -text
 RTCP/Interface/include/Interface/BGPAsm.h -text
 RTCP/Interface/include/Interface/BeamCoordinates.h -text
 RTCP/Interface/include/Interface/BeamFormedData.h -text
diff --git a/.subversion/config b/.subversion/config
index 0812a72b3c6ce9fbb316ebb838bc54fee336b3d1..b7f6f49ab1c76afa7d0d352a43ebe45f16763000 100644
--- a/.subversion/config
+++ b/.subversion/config
@@ -5,37 +5,22 @@
 
 ### Section for authentication and authorization customizations.
 [auth]
-### Set password stores used by Subversion. They should be
-### delimited by spaces or commas. The order of values determines
-### the order in which password stores are used.
-### Valid password stores:
-###   gnome-keyring        (Unix-like systems)
-###   kwallet              (Unix-like systems)
-###   keychain             (Mac OS X)
-###   windows-cryptoapi    (Windows)
-password-stores = gnome-keyring,kwallet
-### To disable all password stores, use an empty list:
-# password-stores =
-###
-### Set KWallet wallet used by Subversion. If empty or unset,
-### then the default network wallet will be used.
-# kwallet-wallet =
-###
-### Include PID (Process ID) in Subversion application name when
-### using KWallet. It defaults to 'no'.
-# kwallet-svn-application-name-with-pid = yes
-###
-### The rest of the [auth] section in this file has been deprecated.
-### Both 'store-passwords' and 'store-auth-creds' can now be
-### specified in the 'servers' file in your config directory
-### and are documented there. Anything specified in this section 
-### is overridden by settings specified in the 'servers' file.
+### Set store-passwords to 'no' to avoid storing passwords in the
+### auth/ area of your config directory.  It defaults to 'yes'.
+### Note that this option only prevents saving of *new* passwords;
+### it doesn't invalidate existing passwords.  (To do that, remove
+### the cache files by hand as described in the Subversion book.)
 # store-passwords = no
+### Set store-auth-creds to 'no' to avoid storing any subversion
+### credentials in the auth/ area of your config directory.
+### It defaults to 'yes'.  Note that this option only prevents
+### saving of *new* credentials;  it doesn't invalidate existing
+### caches.  (To do that, remove the cache files by hand.)
 # store-auth-creds = no
 
 ### Section for configuring external helper applications.
 [helpers]
-### Set editor-cmd to the command used to invoke your text editor.
+### Set editor to the command used to invoke your text editor.
 ###   This will override the environment variables that Subversion
 ###   examines by default to find this information ($EDITOR, 
 ###   et al).
@@ -44,21 +29,13 @@ password-stores = gnome-keyring,kwallet
 ###   This will override the compile-time default, which is to use
 ###   Subversion's internal diff implementation.
 # diff-cmd = diff_program (diff, gdiff, etc.)
-### Diff-extensions are arguments passed to an external diff
-### program or to Subversion's internal diff implementation.
-### Set diff-extensions to override the default arguments ('-u').
-# diff-extensions = -u -p
 ### Set diff3-cmd to the absolute path of your 'diff3' program.
 ###   This will override the compile-time default, which is to use
 ###   Subversion's internal diff3 implementation.
 # diff3-cmd = diff3_program (diff3, gdiff3, etc.)
-### Set diff3-has-program-arg to 'yes' if your 'diff3' program
-###   accepts the '--diff-program' option.
-# diff3-has-program-arg = [yes | no]
-### Set merge-tool-cmd to the command used to invoke your external
-### merging tool of choice. Subversion will pass 5 arguments to
-### the specified command: base theirs mine merged wcfile
-# merge-tool-cmd = merge_command
+### Set diff3-has-program-arg to 'true' or 'yes' if your 'diff3'
+###   program accepts the '--diff-program' option.
+# diff3-has-program-arg = [true | false]
 
 ### Section for configuring tunnel agents.
 [tunnels]
@@ -75,7 +52,7 @@ password-stores = gnome-keyring,kwallet
 ### passed to the tunnel agent as <user>@<hostname>.)  If the
 ### built-in ssh scheme were not predefined, it could be defined
 ### as:
-# ssh = $SVN_SSH ssh -q -o ControlMaster=no
+# ssh = $SVN_SSH ssh
 ### If you wanted to define a new 'rsh' scheme, to be used with
 ### 'svn+rsh:' URLs, you could do so as follows:
 # rsh = rsh
@@ -89,11 +66,14 @@ password-stores = gnome-keyring,kwallet
 ### Section for configuring miscelleneous Subversion options.
 [miscellany]
 ### Set global-ignores to a set of whitespace-delimited globs
-### which Subversion will ignore in its 'status' output, and
-### while importing or adding files and directories.
-### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.
-# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo
-#   *.rej *~ #*# .#* .*.swp .DS_Store
+### which Subversion will ignore in its 'status' output.
+global-ignores = *~ *.log *.private *.result *.tmp installed \
+                 aclocal.m4 autom4te.cache boot.md5 boot.md5-check \
+                 build config.guess config.h.in config.sub configure \
+                 depcomp install-sh libtool.m4 ltmain.sh lt~obsolete.m4 \
+                 ltoptions.m4 ltsugar.m4 ltversion.m4 Makefile.in missing \
+                 *.pyc
+
 ### Set log-encoding to the default encoding for log messages
 # log-encoding = latin1
 ### Set use-commit-times to make checkout/update/switch/revert
@@ -102,37 +82,19 @@ password-stores = gnome-keyring,kwallet
 ### Set no-unlock to prevent 'svn commit' from automatically
 ### releasing locks on files.
 # no-unlock = yes
-### Set mime-types-file to a MIME type registry file, used to
-### provide hints to Subversion's MIME type auto-detection
-### algorithm.
-# mime-types-file = /path/to/mime.types
-### Set preserved-conflict-file-exts to a whitespace-delimited
-### list of patterns matching file extensions which should be
-### preserved in generated conflict file names.  By default,
-### conflict files use custom extensions.
-# preserved-conflict-file-exts = doc ppt xls od?
 ### Set enable-auto-props to 'yes' to enable automatic properties
 ### for 'svn add' and 'svn import', it defaults to 'no'.
 ### Automatic properties are defined in the section 'auto-props'.
-# enable-auto-props = yes
-### Set interactive-conflicts to 'no' to disable interactive
-### conflict resolution prompting.  It defaults to 'yes'.
-# interactive-conflicts = no
-### Set memory-cache-size to define the size of the memory cache
-### used by the client when accessing a FSFS repository via
-### ra_local (the file:// scheme). The value represents the number
-### of MB used by the cache.
-# memory-cache-size = 16
+enable-auto-props = yes
 
 ### Section for configuring automatic properties.
 [auto-props]
 ### The format of the entries is:
 ###   file-name-pattern = propname[=value][;propname[=value]...]
 ### The file-name-pattern can contain wildcards (such as '*' and
-### '?').  All entries which match (case-insensitively) will be
-### applied to the file.  Note that auto-props functionality
-### must be enabled, which is typically done by setting the
-### 'enable-auto-props' option.
+### '?').  All entries which match will be applied to the file.
+### Note that auto-props functionality must be enabled, which
+### is typically done by setting the 'enable-auto-props' option.
 *.am = svn:eol-style=native;svn:keywords=Author Date Id Revision
 *.bat = svn:eol-style=CRLF;svn:keywords=Author Date Id Revision
 *.bib = svn:eol-style=native
diff --git a/CEP/DP3/AOFlagger/CMakeLists.txt b/CEP/DP3/AOFlagger/CMakeLists.txt
index 7a1ea970a3e01a2bf5e9e82cfe62707d111746df..f08fb06ebd90eb02a032a404f08e7fc8a4c851a3 100644
--- a/CEP/DP3/AOFlagger/CMakeLists.txt
+++ b/CEP/DP3/AOFlagger/CMakeLists.txt
@@ -12,7 +12,6 @@ lofar_find_package(LibXml2 REQUIRED)
 lofar_find_package(PNG REQUIRED)
 lofar_find_package(Casacore REQUIRED COMPONENTS ms tables)
 lofar_find_package(Boost REQUIRED COMPONENTS date_time thread filesystem system)
-lofar_find_package(FFTW3 REQUIRED)
 lofar_find_package(CFITSIO REQUIRED)
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
   find_library(RT_LIBRARY rt)
diff --git a/CEP/DP3/DPPP/include/DPPP/AORFlagger.h b/CEP/DP3/DPPP/include/DPPP/AORFlagger.h
index 93a29d66ee89c8b482580331b5c6c3e174dbf48a..1d9a71928fafb144afabf975c62e98179a41c149 100644
--- a/CEP/DP3/DPPP/include/DPPP/AORFlagger.h
+++ b/CEP/DP3/DPPP/include/DPPP/AORFlagger.h
@@ -38,9 +38,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep class flagging data points based on the
@@ -70,7 +70,7 @@ namespace LOFAR {
     public:
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
-      AORFlagger (DPInput*, const ParameterSet&, const string& prefix);
+      AORFlagger (DPInput*, const ParSet&, const string& prefix);
 
       virtual ~AORFlagger();
 
diff --git a/CEP/DP3/DPPP/include/DPPP/Averager.h b/CEP/DP3/DPPP/include/DPPP/Averager.h
index f137ef49baebfe023b63d3ae0a0a511b57dceb2f..06b11b4c5b17c77682cec057ce96d36ea8fc76f5 100644
--- a/CEP/DP3/DPPP/include/DPPP/Averager.h
+++ b/CEP/DP3/DPPP/include/DPPP/Averager.h
@@ -33,9 +33,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep class calculating the weighted average of
@@ -55,7 +55,7 @@ namespace LOFAR {
     public:
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
-      Averager (DPInput*, const ParameterSet&, const string& prefix);
+      Averager (DPInput*, const ParSet&, const string& prefix);
 
       // Construct the object using the given parameters.
       Averager (DPInput*, const string& stepname,
diff --git a/CEP/DP3/DPPP/include/DPPP/BaselineSelection.h b/CEP/DP3/DPPP/include/DPPP/BaselineSelection.h
index 7fa3c694f3477d1b045d2ade325b4fdf7d2dc1c4..7f83ace2753098399f3f912ccfaf8c97aa3d1b0a 100644
--- a/CEP/DP3/DPPP/include/DPPP/BaselineSelection.h
+++ b/CEP/DP3/DPPP/include/DPPP/BaselineSelection.h
@@ -27,14 +27,13 @@
 // @file
 // @brief Class to handle the baseline selection
 
+#include <DPPP/ParSet.h>
 #include <DPPP/DPInfo.h>
+#include <Common/ParameterValue.h>
 #include <casa/Arrays/Vector.h>
 #include <casa/Arrays/Matrix.h>
 
 namespace LOFAR {
-  class ParameterSet;
-  class ParameterValue;
-
   namespace DPPP {
 
     // Class containing a few static functions to parse a baseline selection
@@ -54,7 +53,7 @@ namespace LOFAR {
       //  <li> minbl:    minimum baseline length (in m); only if minmax=true
       //  <li> maxbl:    maximum baseline length (in m); only if minmax=true
       // </ul>
-      BaselineSelection (const ParameterSet&, const string& prefix,
+      BaselineSelection (const ParSet&, const string& prefix,
                          bool minmax=false,
 			 const string& defaultCorrType=string());
 
diff --git a/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt b/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
index 82df68d72afc7088885970b97b954e1494100068..5ecc418523b596b7bec6eba3bb425d377163c75a 100644
--- a/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
+++ b/CEP/DP3/DPPP/include/DPPP/CMakeLists.txt
@@ -3,7 +3,7 @@
 # List of header files that will be installed.
 set(inst_HEADERS
   DPRun.h DPStep.h DPInput.h DPBuffer.h DPInfo.h
-  DPLogger.h ProgressMeter.h FlagCounter.h
+  ParSet.h DPLogger.h ProgressMeter.h FlagCounter.h
   UVWCalculator.h BaselineSelection.h
   MSReader.h MSWriter.h MSUpdater.h Counter.h
   Averager.h MedFlagger.h PreFlagger.h UVWFlagger.h AORFlagger.h
diff --git a/CEP/DP3/DPPP/include/DPPP/Counter.h b/CEP/DP3/DPPP/include/DPPP/Counter.h
index 8215f2383e12162f511a6bd992366e01ada4f2a6..0d8cbbca992faa983e07fa6147bc1203a11b46cb 100644
--- a/CEP/DP3/DPPP/include/DPPP/Counter.h
+++ b/CEP/DP3/DPPP/include/DPPP/Counter.h
@@ -33,9 +33,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep class counting the number of flags per
@@ -48,7 +48,7 @@ namespace LOFAR {
     public:
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
-      Counter (DPInput*, const ParameterSet&, const string& prefix);
+      Counter (DPInput*, const ParSet&, const string& prefix);
 
       virtual ~Counter();
 
diff --git a/CEP/DP3/DPPP/include/DPPP/DPRun.h b/CEP/DP3/DPPP/include/DPPP/DPRun.h
index d00f0a8771f54493534187e7a42355a4a9aeec85..3ba728f3d46e3ae23aab96c0d883dfaf7d1abd06 100644
--- a/CEP/DP3/DPPP/include/DPPP/DPRun.h
+++ b/CEP/DP3/DPPP/include/DPPP/DPRun.h
@@ -29,7 +29,7 @@
 
 #include <lofar_config.h>
 #include <DPPP/DPStep.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 
 namespace LOFAR {
   namespace DPPP {
@@ -49,7 +49,7 @@ namespace LOFAR {
     private:
       // Create the step objects.
       // It fills DPInfo object and the name of the MS being written.
-      static DPStep::ShPtr makeSteps (const ParameterSet& parset,
+      static DPStep::ShPtr makeSteps (const ParSet& parset,
                                       std::string& msName);
     };
 
diff --git a/CEP/DP3/DPPP/include/DPPP/Demixer.h b/CEP/DP3/DPPP/include/DPPP/Demixer.h
index ffe995a871730abd92f78adb376acabc7e578668..25b8258a8d695b16cbd46553d4fd2de653c07650 100644
--- a/CEP/DP3/DPPP/include/DPPP/Demixer.h
+++ b/CEP/DP3/DPPP/include/DPPP/Demixer.h
@@ -46,9 +46,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     typedef vector<Patch::ConstPtr> PatchList;
@@ -68,7 +68,7 @@ namespace LOFAR {
     public:
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
-      Demixer (DPInput*, const ParameterSet&, const string& prefix);
+      Demixer (DPInput*, const ParSet&, const string& prefix);
 
       // Process the data.
       // It keeps the data.
diff --git a/CEP/DP3/DPPP/include/DPPP/Filter.h b/CEP/DP3/DPPP/include/DPPP/Filter.h
index 2ebe3e237017226bd1254d9b2670139eed01daf2..ee63f38274933208b913bcfcabb5ad47766a4634 100644
--- a/CEP/DP3/DPPP/include/DPPP/Filter.h
+++ b/CEP/DP3/DPPP/include/DPPP/Filter.h
@@ -33,9 +33,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPInput step reading the data from a MeasurementSet.
@@ -128,7 +128,7 @@ namespace LOFAR {
 
       // Construct the object for the given MS.
       // Parameters are obtained from the parset using the given prefix.
-      Filter (DPInput* input, const ParameterSet&, const string& prefix);
+      Filter (DPInput* input, const ParSet&, const string& prefix);
 
       // Construct the object for the given MS and baseline selection.
       Filter (DPInput* input, const BaselineSelection&);
diff --git a/CEP/DP3/DPPP/include/DPPP/FlagCounter.h b/CEP/DP3/DPPP/include/DPPP/FlagCounter.h
index 92d7a596d2a0c185cf7b6f0660268097ab77ebb8..7a8fee17554082d031caae536d2d21083d24e2f8 100644
--- a/CEP/DP3/DPPP/include/DPPP/FlagCounter.h
+++ b/CEP/DP3/DPPP/include/DPPP/FlagCounter.h
@@ -33,11 +33,11 @@
 #include <casa/Arrays/Vector.h>
 
 namespace LOFAR {
-  class ParameterSet;
-
   namespace DPPP {
+
     //# Forward Declarations.
     class DPInfo;
+    class ParSet;
 
     // @ingroup NDPPP
 
@@ -57,8 +57,7 @@ namespace LOFAR {
 
       // This constructor creates an empty object.
       // It reads info from the parset to see if percentages have to be saved.
-      FlagCounter (const string& msName, const ParameterSet&,
-                   const string& prefix);
+      FlagCounter (const string& msName, const ParSet&, const string& prefix);
 
       // Size all counters and initialize them to zero using the sizes
       // from the DPInfo object.
diff --git a/CEP/DP3/DPPP/include/DPPP/MSReader.h b/CEP/DP3/DPPP/include/DPPP/MSReader.h
index 5d86df4ca81355e3650402d16df6d071611698be..62ba12d5494b726e9871a30e6f068ed07aa6bc81 100644
--- a/CEP/DP3/DPPP/include/DPPP/MSReader.h
+++ b/CEP/DP3/DPPP/include/DPPP/MSReader.h
@@ -38,9 +38,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPInput step reading the data from a MeasurementSet.
@@ -135,7 +135,7 @@ namespace LOFAR {
       // Parameters are obtained from the parset using the given prefix.
       // The missingData argument is for MultiMSReader.
       MSReader (const std::string& msName,
-                const ParameterSet&, const string& prefix,
+                const ParSet&, const string& prefix,
                 bool missingData = false);
 
       virtual ~MSReader();
@@ -172,8 +172,8 @@ namespace LOFAR {
       virtual casa::Cube<bool> getFullResFlags (const casa::RefRows& rowNrs);
 
       // Read the given data column at the given row numbers.
-      ///      virtual casa::Cube<casa::Complex> getData (const casa::String& columnName,
-      ///                                                 const casa::RefRows& rowNrs);
+      virtual casa::Cube<casa::Complex> getData (const casa::String& columnName,
+                                                 const casa::RefRows& rowNrs);
 
       // Write the flags at the given row numbers.
       // It is used by MSUpdater.
diff --git a/CEP/DP3/DPPP/include/DPPP/MSUpdater.h b/CEP/DP3/DPPP/include/DPPP/MSUpdater.h
index acb87da13ef10645b0d76b9cf8fb575968f87e9d..49f84e208aebb277a1bae8e0535d579ab9420c5e 100644
--- a/CEP/DP3/DPPP/include/DPPP/MSUpdater.h
+++ b/CEP/DP3/DPPP/include/DPPP/MSUpdater.h
@@ -32,9 +32,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     //# Forward Declarations.
     class MSReader;
 
@@ -50,7 +50,7 @@ namespace LOFAR {
     class MSUpdater: public DPStep
     {
     public:
-      MSUpdater (MSReader*, const ParameterSet& parset,
+      MSUpdater (MSReader*, const ParSet& parset,
                  const std::string& prefix);
 
       virtual ~MSUpdater();
diff --git a/CEP/DP3/DPPP/include/DPPP/MSWriter.h b/CEP/DP3/DPPP/include/DPPP/MSWriter.h
index fad5c9432cdebac548b5a15d83e87276174fbdea..7d32aa282d0471c735b5dd5d26f8ba8b75f6473f 100644
--- a/CEP/DP3/DPPP/include/DPPP/MSWriter.h
+++ b/CEP/DP3/DPPP/include/DPPP/MSWriter.h
@@ -39,6 +39,8 @@ namespace LOFAR {
   class ParameterSet;
 
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep creating a new MeasurementSet and writing
@@ -62,7 +64,7 @@ namespace LOFAR {
     public:
       explicit MSWriter (MSReader* reader, const std::string& outName,
                          const DPInfo&,
-                         const ParameterSet&, const string& prefix);
+                         const ParSet&, const string& prefix);
 
       virtual ~MSWriter();
 
diff --git a/CEP/DP3/DPPP/include/DPPP/MedFlagger.h b/CEP/DP3/DPPP/include/DPPP/MedFlagger.h
index 3410d28bab401f92f322098fab2efcde1891dc9c..4e3e17434c7b373d9daad5ca64802c571feccb5a 100644
--- a/CEP/DP3/DPPP/include/DPPP/MedFlagger.h
+++ b/CEP/DP3/DPPP/include/DPPP/MedFlagger.h
@@ -33,9 +33,10 @@
 #include <Common/lofar_vector.h>
 
 namespace LOFAR {
-  class ParameterSet;
 
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep class flagging data points based on the median
@@ -77,7 +78,7 @@ namespace LOFAR {
     public:
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
-      MedFlagger (DPInput*, const ParameterSet&, const string& prefix);
+      MedFlagger (DPInput*, const ParSet&, const string& prefix);
 
       virtual ~MedFlagger();
 
diff --git a/CEP/DP3/DPPP/include/DPPP/MultiMSReader.h b/CEP/DP3/DPPP/include/DPPP/MultiMSReader.h
index 6a9c2255fee485420725afca95a178414b254dc5..35623820d6486b0a3c4a912853753a41acd8471b 100644
--- a/CEP/DP3/DPPP/include/DPPP/MultiMSReader.h
+++ b/CEP/DP3/DPPP/include/DPPP/MultiMSReader.h
@@ -38,9 +38,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPInput step reading the data from a MeasurementSet.
@@ -131,7 +131,7 @@ namespace LOFAR {
       // Construct the object for the given MS.
       // Parameters are obtained from the parset using the given prefix.
       MultiMSReader (const vector<string>& msNames,
-                     const ParameterSet&, const string& prefix);
+                     const ParSet&, const string& prefix);
 
       virtual ~MultiMSReader();
 
@@ -167,8 +167,8 @@ namespace LOFAR {
       virtual casa::Cube<bool> getFullResFlags (const casa::RefRows& rowNrs);
 
       // Read the given data column at the given row numbers.
-      ///      virtual casa::Cube<casa::Complex> getData (const casa::String& columnName,
-      ///                                                 const casa::RefRows& rowNrs);
+      virtual casa::Cube<casa::Complex> getData (const casa::String& columnName,
+                                                 const casa::RefRows& rowNrs);
 
       // Tell if the visibility data are to be read.
       virtual void setReadVisData (bool readVisData);
diff --git a/CEP/DP3/DPPP/include/DPPP/ParSet.h b/CEP/DP3/DPPP/include/DPPP/ParSet.h
new file mode 100644
index 0000000000000000000000000000000000000000..69f5baa1ecb6f2c8d671962c1962acf7a61f1fed
--- /dev/null
+++ b/CEP/DP3/DPPP/include/DPPP/ParSet.h
@@ -0,0 +1,112 @@
+//# ParSet.h: Wrapper around ParaMeterSet to keep track of parameters asked for
+//# Copyright (C) 2010
+//# ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+//#
+//# @author Ger van Diepen
+
+#ifndef DPPP_PARSET_H
+#define DPPP_PARSET_H
+
+// @file
+// @brief Wrapper around ParaMeterSet to keep track of parameters asked for
+
+#include <Common/ParameterSet.h>
+#include <Common/lofar_string.h>
+#include <Common/lofar_vector.h>
+#include <Common/lofar_set.h>
+
+namespace LOFAR {
+
+  namespace DPPP {
+
+    // @ingroup NDPPP
+
+    // This class keeps track of the parameters asked for.
+    // In this way it is possible to give a warning or error that the
+    // ParameterSet has more parameters than asked for. It is an aid in
+    // detecting misspelled parameters names.
+
+    class ParSet
+    {
+    public:
+      ParSet (const ParameterSet&);
+
+      // Ask a parameter with a possible default value.
+      // @{
+      bool   getBool  (const string& aKey) const;
+      bool   getBool  (const string& aKey, bool aValue) const;
+      int    getInt   (const string& aKey) const;
+      int    getInt   (const string& aKey, int aValue) const;
+      uint   getUint  (const string& aKey) const;
+      uint   getUint  (const string& aKey, uint aValue) const;
+      float  getFloat (const string& aKey) const;
+      float  getFloat (const string& aKey, float aValue) const;
+      double getDouble(const string& aKey) const;
+      double getDouble(const string& aKey, double aValue) const;
+      string getString(const string& aKey) const;
+      string getString(const string& aKey, const string& aValue) const;
+      vector<bool>   getBoolVector  (const string& aKey,
+                                     bool expandable = false) const;
+      vector<bool>   getBoolVector  (const string& aKey,
+                                     const vector<bool>& aValue,
+                                     bool expandable = false) const;
+      vector<int>    getIntVector   (const string& aKey,
+                                     bool expandable = false) const;
+      vector<int>    getIntVector   (const string& aKey,
+                                     const vector<int>& aValue,
+                                     bool expandable = false) const;
+      vector<uint>   getUintVector  (const string& aKey,
+                                     bool expandable = false) const;
+      vector<uint>   getUintVector  (const string& aKey,
+                                     const vector<uint>& aValue,
+                                     bool expandable = false) const;
+      vector<float>  getFloatVector (const string& aKey,
+                                     bool expandable = false) const;
+      vector<float>  getFloatVector (const string& aKey,
+                                     const vector<float>& aValue,
+                                     bool expandable = false) const;
+      vector<double> getDoubleVector(const string& aKey,
+                                     bool expandable = false) const;
+      vector<double> getDoubleVector(const string& aKey,
+                                     const vector<double>& aValue,
+                                     bool expandable = false) const;
+      vector<string> getStringVector(const string& aKey,
+                                     bool expandable = false) const;
+      vector<string> getStringVector(const string& aKey,
+                                     const vector<string>& aValue,
+                                     bool expandable = false) const;
+      ParameterRecord getRecord (const string& aKey) const;
+
+      // Get all unused parameters.
+      vector<string> unusedKeys() const;
+
+      // Get the underlying ParameterSet.
+      const ParameterSet& parameterSet() const
+        { return itsParSet; }
+
+    private:
+      ParameterSet        itsParSet;
+      mutable set<string> itsAskedParms;
+    };
+
+  } //# end namespace
+}
+
+#endif
diff --git a/CEP/DP3/DPPP/include/DPPP/PhaseShift.h b/CEP/DP3/DPPP/include/DPPP/PhaseShift.h
index 4018a9b06b5e5671e933495b2c5564697661f5a5..13421919feba2ef8bbb92bccafd38440d4d5dda5 100644
--- a/CEP/DP3/DPPP/include/DPPP/PhaseShift.h
+++ b/CEP/DP3/DPPP/include/DPPP/PhaseShift.h
@@ -33,9 +33,9 @@
 
 namespace LOFAR {
 
-  class ParameterSet;
-
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep class to shift the data and UVW coordinates
@@ -50,13 +50,13 @@ namespace LOFAR {
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
       // This is the standard constructor where the phasecenter must be given.
-      PhaseShift (DPInput*, const ParameterSet&, const string& prefix);
+      PhaseShift (DPInput*, const ParSet&, const string& prefix);
 
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
       // This is a constructor for Demixer where the phasecenter has the
       // given default value.
-      PhaseShift (DPInput*, const ParameterSet&, const string& prefix,
+      PhaseShift (DPInput*, const ParSet&, const string& prefix,
                   const vector<string>& defVal);
 
       virtual ~PhaseShift();
@@ -87,10 +87,6 @@ namespace LOFAR {
       const casa::Matrix<casa::DComplex>& getPhasors() const
         { return itsPhasors; }
 
-      // Get the phase center.
-      const vector<string>& getPhaseCenter() const
-        { return itsCenter; }
-
     private:
       // Interpret the phase center specification.
       // Currently only J2000 RA and DEC can be given.
diff --git a/CEP/DP3/DPPP/include/DPPP/PreFlagger.h b/CEP/DP3/DPPP/include/DPPP/PreFlagger.h
index b335bc8c0714a354f5fa8f16d2c0e004dc21f7ee..baa8c937b6acfb204930eff4a48cfcf1b5c17788 100644
--- a/CEP/DP3/DPPP/include/DPPP/PreFlagger.h
+++ b/CEP/DP3/DPPP/include/DPPP/PreFlagger.h
@@ -34,10 +34,11 @@
 #include <measures/Measures/MDirection.h>
 
 namespace LOFAR {
-  class ParameterSet;
   class ParameterValue;
 
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep class flagging data points based on data
@@ -74,7 +75,7 @@ namespace LOFAR {
 
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
-      PreFlagger (DPInput*, const ParameterSet&, const string& prefix);
+      PreFlagger (DPInput*, const ParSet&, const string& prefix);
 
       virtual ~PreFlagger();
 
@@ -124,7 +125,7 @@ namespace LOFAR {
         {}
 
         // Construct from the parset parameters.
-        PSet (DPInput*, const ParameterSet& parset, const string& prefix);
+        PSet (DPInput*, const ParSet& parset, const string& prefix);
 
         // Set and return the flags.
         casa::Cube<bool>* process (DPBuffer&, uint timeSlot,
diff --git a/CEP/DP3/DPPP/include/DPPP/StationAdder.h b/CEP/DP3/DPPP/include/DPPP/StationAdder.h
index 3cd95859eae663f27a826436276abb2a855a58b0..755962612147f65330480876c0bf6d996084ad7d 100644
--- a/CEP/DP3/DPPP/include/DPPP/StationAdder.h
+++ b/CEP/DP3/DPPP/include/DPPP/StationAdder.h
@@ -34,9 +34,10 @@
 #include <measures/Measures/MPosition.h>
 
 namespace LOFAR {
-  class ParameterSet;
 
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep class summing stations to a superstation.
@@ -62,7 +63,7 @@ namespace LOFAR {
     public:
       // Construct the object.
       // Parameters are obtained from the parset using the given prefix.
-      StationAdder (DPInput*, const ParameterSet&, const string& prefix);
+      StationAdder (DPInput*, const ParSet&, const string& prefix);
 
       virtual ~StationAdder();
 
diff --git a/CEP/DP3/DPPP/include/DPPP/UVWFlagger.h b/CEP/DP3/DPPP/include/DPPP/UVWFlagger.h
index 3642f190ea3c8535812656baff027ee5cd241220..f3a6b32adcfc5ccc38439cfa2d41fca814c231ed 100644
--- a/CEP/DP3/DPPP/include/DPPP/UVWFlagger.h
+++ b/CEP/DP3/DPPP/include/DPPP/UVWFlagger.h
@@ -33,10 +33,11 @@
 #include <Common/lofar_vector.h>
 
 namespace LOFAR {
-  class ParameterSet;
   class ParameterValue;
 
   namespace DPPP {
+    class ParSet;
+
     // @ingroup NDPPP
 
     // This class is a DPStep class flagging data points based on data
@@ -58,7 +59,7 @@ namespace LOFAR {
       // The antenna names are used to find antenna numbers.
       // The channel frequencies as they are in the input step must be given
       // starting at the start-channel.
-      UVWFlagger (DPInput*, const ParameterSet&, const string& prefix);
+      UVWFlagger (DPInput*, const ParSet&, const string& prefix);
 
       virtual ~UVWFlagger();
 
@@ -96,7 +97,7 @@ namespace LOFAR {
       // (min and max are also turned into a range).
       // Optionally the values are squared to avoid having to take a sqrt
       // of the data's UVW coordinates.
-      vector<double> fillUVW (const ParameterSet& parset,
+      vector<double> fillUVW (const ParSet& parset,
                               const string& prefix,
                               const string& name,
                               bool square);
diff --git a/CEP/DP3/DPPP/src/AORFlagger.cc b/CEP/DP3/DPPP/src/AORFlagger.cc
index d74578eb729c90d670764e53429279c4e0c00eb7..81eda1d4a83f92dc36c9dab33487ba162e241817 100644
--- a/CEP/DP3/DPPP/src/AORFlagger.cc
+++ b/CEP/DP3/DPPP/src/AORFlagger.cc
@@ -25,7 +25,7 @@
 #include <DPPP/AORFlagger.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/LofarLogger.h>
 
 #include <casa/OS/HostInfo.h>
@@ -68,8 +68,7 @@ namespace LOFAR {
   namespace DPPP {
 
     AORFlagger::AORFlagger (DPInput* input,
-                            const ParameterSet& parset,
-                            const string& prefix)
+                            const ParSet& parset, const string& prefix)
       : itsInput       (input),
         itsName        (prefix),
         itsBufIndex    (0),
diff --git a/CEP/DP3/DPPP/src/Averager.cc b/CEP/DP3/DPPP/src/Averager.cc
index 028148c1a8d645c3f85f346de77bb241c14a6180..24bf4720fdf494913ad9fd99267049891304ff28 100644
--- a/CEP/DP3/DPPP/src/Averager.cc
+++ b/CEP/DP3/DPPP/src/Averager.cc
@@ -25,7 +25,7 @@
 #include <DPPP/Averager.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/LofarLogger.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <iostream>
@@ -37,8 +37,7 @@ namespace LOFAR {
   namespace DPPP {
 
     Averager::Averager (DPInput* input,
-                        const ParameterSet& parset,
-                        const string& prefix)
+                        const ParSet& parset, const string& prefix)
       : itsInput     (input),
         itsName      (prefix),
         itsNChanAvg  (parset.getUint  (prefix+"freqstep", 1)),
diff --git a/CEP/DP3/DPPP/src/BaselineSelection.cc b/CEP/DP3/DPPP/src/BaselineSelection.cc
index b01f42050979337999def471bb6bf87d69c3ceaf..d5d3f45f5c15a820b04775f493d6f066c8cff951 100644
--- a/CEP/DP3/DPPP/src/BaselineSelection.cc
+++ b/CEP/DP3/DPPP/src/BaselineSelection.cc
@@ -25,8 +25,6 @@
 #include <DPPP/BaselineSelection.h>
 #include <DPPP/DPLogger.h>
 #include <MS/BaselineSelect.h>
-#include <Common/ParameterSet.h>
-#include <Common/ParameterValue.h>
 #include <Common/LofarLogger.h>
 #include <Common/StreamUtil.h>
 
@@ -39,7 +37,7 @@ namespace LOFAR {
     BaselineSelection::BaselineSelection()
     {}
 
-    BaselineSelection::BaselineSelection (const ParameterSet& parset,
+    BaselineSelection::BaselineSelection (const ParSet& parset,
                                           const string& prefix,
                                           bool minmax,
 					  const string& defaultCorrType)
diff --git a/CEP/DP3/DPPP/src/CMakeLists.txt b/CEP/DP3/DPPP/src/CMakeLists.txt
index 708486fdc2d2f54c9b9f8808bf3a83f68c938fc9..9c3b4f87d6d703f136684d223fa25ebc4e234bd2 100644
--- a/CEP/DP3/DPPP/src/CMakeLists.txt
+++ b/CEP/DP3/DPPP/src/CMakeLists.txt
@@ -6,7 +6,7 @@ include(PythonInstall)
 lofar_add_library(dppp
   Package__Version.cc
   DPRun.cc DPStep.cc DPInput.cc DPBuffer.cc DPInfo.cc
-  DPLogger.cc ProgressMeter.cc FlagCounter.cc
+  ParSet.cc DPLogger.cc ProgressMeter.cc FlagCounter.cc
   UVWCalculator.cc  BaselineSelection.cc
   MSReader.cc MultiMSReader.cc MSWriter.cc MSUpdater.cc Counter.cc
   Averager.cc MedFlagger.cc AORFlagger.cc PreFlagger.cc UVWFlagger.cc
diff --git a/CEP/DP3/DPPP/src/Counter.cc b/CEP/DP3/DPPP/src/Counter.cc
index 771580217e1a948f350e8a2138a89160c8f2dcfe..832f074d5028f8e1cb453b1109a525f2d24d7500 100644
--- a/CEP/DP3/DPPP/src/Counter.cc
+++ b/CEP/DP3/DPPP/src/Counter.cc
@@ -24,7 +24,7 @@
 #include <lofar_config.h>
 #include <DPPP/Counter.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <iostream>
 
 using namespace casa;
@@ -33,8 +33,7 @@ namespace LOFAR {
   namespace DPPP {
 
     Counter::Counter (DPInput* input,
-                      const ParameterSet& parset,
-                      const string& prefix)
+                      const ParSet& parset, const string& prefix)
       : itsName        (prefix),
         itsCount       (0),
         itsFlagCounter (input->msName(), parset, prefix)
diff --git a/CEP/DP3/DPPP/src/DPRun.cc b/CEP/DP3/DPPP/src/DPRun.cc
index 9bab26e89100cd29fece130ec5fcacc055583144..3e3ec6b7925b5889d9d0d18dfb4d7d3ad8c86889 100644
--- a/CEP/DP3/DPPP/src/DPRun.cc
+++ b/CEP/DP3/DPPP/src/DPRun.cc
@@ -39,7 +39,7 @@
 #include <DPPP/StationAdder.h>
 #include <DPPP/Filter.h>
 #include <DPPP/Counter.h>
-#include <DPPP/ApplyCal.h>
+#include <DPPP/ParSet.h>
 #include <DPPP/ProgressMeter.h>
 #include <DPPP/DPLogger.h>
 #include <Common/Timer.h>
@@ -57,9 +57,9 @@ namespace LOFAR {
       casa::Timer timer;
       NSTimer nstimer;
       nstimer.start();
-      ParameterSet parset (parsetName);
+      ParSet parset ((ParameterSet(parsetName)));
       DPLogger::useLogger = parset.getBool ("uselogger", false);
-      int  checkparset    = parset.getInt  ("checkparset", 0);
+      bool checkparset    = parset.getBool ("checkparset", false);
       bool showProgress   = parset.getBool ("showprogress", true);
       bool showTimings    = parset.getBool ("showtimings", true);
       string msName;
@@ -73,19 +73,17 @@ namespace LOFAR {
         DPLOG_INFO (os.str(), true);
         step = step->getNextStep();
       }
-      if (checkparset >= 0) {
-        // Show unused parameters (might be misspelled).
-        vector<string> unused = parset.unusedKeys();
-        if (! unused.empty()) {
-          DPLOG_WARN_STR
-            (endl
-             << "*** WARNING: the following parset keywords were not used ***"
-             << endl
-             << "             maybe they are misspelled"
-             << endl
-             << "    " << unused << endl);
-          ASSERTSTR (checkparset==0, "Unused parset keywords found");
-        }
+      // Show unused parameters (might be misspelled).
+      vector<string> unused = parset.unusedKeys();
+      if (! unused.empty()) {
+        DPLOG_WARN_STR
+          (endl
+           << "*** WARNING: the following parset keywords were not used ***"
+           << endl
+           << "             maybe they are misspelled"
+           << endl
+           << "    " << unused << endl);
+        ASSERTSTR (!checkparset, "Unused parset keywords found");
       }
       // Process until the end.
       uint ntodo = firstStep->getInfo().ntime();
@@ -159,7 +157,7 @@ namespace LOFAR {
       // The destructors are called automatically at this point.
     }
 
-    DPStep::ShPtr DPRun::makeSteps (const ParameterSet& parset, string& msName)
+    DPStep::ShPtr DPRun::makeSteps (const ParSet& parset, string& msName)
     {
       DPStep::ShPtr firstStep;
       DPStep::ShPtr lastStep;
@@ -254,8 +252,6 @@ namespace LOFAR {
           step = DPStep::ShPtr(new StationAdder (reader, parset, prefix));
         } else if (type == "filter") {
           step = DPStep::ShPtr(new Filter (reader, parset, prefix));
-          ///        } else if (type == "applycal"  ||  type == "correct") {
-          ///          step = DPStep::ShPtr(new ApplyCal (reader, parset, prefix));
         } else {
           THROW (LOFAR::Exception, "DPPP step type " << type << " is unknown");
         }
diff --git a/CEP/DP3/DPPP/src/Demixer.cc b/CEP/DP3/DPPP/src/Demixer.cc
index a74d159cf27710d586fe5cb6d218c86bb2bec029..34a33b0e0c22d9d79085a8fe58115ca898ac8487 100644
--- a/CEP/DP3/DPPP/src/Demixer.cc
+++ b/CEP/DP3/DPPP/src/Demixer.cc
@@ -30,6 +30,7 @@
 #include <DPPP/DPInfo.h>
 #include <DPPP/EstimateMixed.h>
 #include <DPPP/PhaseShift.h>
+#include <DPPP/ParSet.h>
 #include <DPPP/Simulate.h>
 #include <DPPP/SourceDBUtil.h>
 #include <DPPP/SubtractMixed.h>
@@ -41,7 +42,6 @@
 #include <ParmDB/ParmCache.h>
 #include <ParmDB/Parm.h>
 
-#include <Common/ParameterSet.h>
 #include <Common/LofarLogger.h>
 #include <Common/OpenMP.h>
 #include <Common/StreamUtil.h>
@@ -70,8 +70,7 @@ namespace LOFAR {
     } //# end unnamed namespace
 
     Demixer::Demixer (DPInput* input,
-                      const ParameterSet& parset,
-                      const string& prefix)
+                      const ParSet& parset, const string& prefix)
       : itsInput          (input),
         itsName           (prefix),
         itsSkyName        (parset.getString(prefix+"skymodel", "sky")),
@@ -361,21 +360,8 @@ namespace LOFAR {
       }
       os << "  targetsource:       " << itsTargetSource << std::endl;
       os << "  subtractsources:    " << itsSubtrSources << std::endl;
-      uint inx=0;
-      for (uint i=0; i<itsSubtrSources.size(); ++i ) {
-        os << "                        "
-           << itsPhaseShifts[inx++]->getPhaseCenter() << std::endl;
-      }
       os << "  modelsources:       " << itsModelSources << std::endl;
-      for (uint i=0; i<itsModelSources.size(); ++i ) {
-        os << "                        "
-           << itsPhaseShifts[inx++]->getPhaseCenter() << std::endl;
-      }
       os << "  extrasources:       " << itsExtraSources << std::endl;
-      for (uint i=0; i<itsExtraSources.size(); ++i ) {
-        os << "                        "
-           << itsPhaseShifts[inx++]->getPhaseCenter() << std::endl;
-      }
 //      os << "  elevationcutoffs: " << itsCutOffs << std::endl;
 //      os << "  jointsolve:     " << itsJointSolve << std::endl;
       os << "  propagatesolutions: " << std::boolalpha << itsPropagateSolutions
diff --git a/CEP/DP3/DPPP/src/Filter.cc b/CEP/DP3/DPPP/src/Filter.cc
index e6f77493247038839e59c1927047d760ef4a2da0..9b4bb455897a5cd11f483f02ef27d8ac38481ae4 100644
--- a/CEP/DP3/DPPP/src/Filter.cc
+++ b/CEP/DP3/DPPP/src/Filter.cc
@@ -25,8 +25,8 @@
 #include <DPPP/Filter.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
+#include <DPPP/ParSet.h>
 #include <DPPP/DPLogger.h>
-#include <Common/ParameterSet.h>
 
 #include <tables/Tables/ExprNode.h>
 #include <tables/Tables/RecordGram.h>
@@ -38,8 +38,7 @@ namespace LOFAR {
   namespace DPPP {
 
     Filter::Filter (DPInput* input,
-                    const ParameterSet& parset,
-                    const string& prefix)
+                    const ParSet& parset, const string& prefix)
       : itsInput        (input),
         itsName         (prefix),
         itsStartChanStr (parset.getString(prefix+"startchan", "0")),
diff --git a/CEP/DP3/DPPP/src/FlagCounter.cc b/CEP/DP3/DPPP/src/FlagCounter.cc
index edd1e3661870b965025b5e31290a1acc231fcaa7..aa2ad7b48e888584689259441cf81484a745471b 100644
--- a/CEP/DP3/DPPP/src/FlagCounter.cc
+++ b/CEP/DP3/DPPP/src/FlagCounter.cc
@@ -24,7 +24,7 @@
 #include <lofar_config.h>
 #include <DPPP/FlagCounter.h>
 #include <DPPP/DPInput.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StreamUtil.h>
 #include <Common/LofarLogger.h>
 #include <tables/Tables/Table.h>
@@ -50,8 +50,7 @@ namespace LOFAR {
     {}
 
     FlagCounter::FlagCounter (const string& msName,
-                              const ParameterSet& parset,
-                              const string& prefix)
+                              const ParSet& parset, const string& prefix)
     {
       itsWarnPerc = parset.getDouble (prefix+"warnperc", 0);
       itsShowFF   = parset.getBool   (prefix+"showfullyflagged", false);
diff --git a/CEP/DP3/DPPP/src/MSReader.cc b/CEP/DP3/DPPP/src/MSReader.cc
index 61326aef40eb534546eec3e6f4c5e7a4f021bcf8..979828123b87948bc96904fce49b5e3827e36902 100644
--- a/CEP/DP3/DPPP/src/MSReader.cc
+++ b/CEP/DP3/DPPP/src/MSReader.cc
@@ -26,9 +26,8 @@
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
 #include <DPPP/DPLogger.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/LofarLogger.h>
-
 #include <tables/Tables/TableRecord.h>
 #include <tables/Tables/ScalarColumn.h>
 #include <tables/Tables/ArrayColumn.h>
@@ -58,8 +57,7 @@ namespace LOFAR {
     {}
 
     MSReader::MSReader (const string& msName,
-                        const ParameterSet& parset,
-                        const string& prefix,
+                        const ParSet& parset, const string& prefix,
                         bool missingData)
       : itsReadVisData (False),
         itsMissingData (missingData),
@@ -91,7 +89,6 @@ namespace LOFAR {
       // See if a selection on band needs to be done.
       // We assume that DATA_DESC_ID and SPW_ID map 1-1.
       if (itsSpw >= 0) {
-	DPLOG_INFO_STR (" MSReader selecting spectral window " << itsSpw << " ...");
         Table subset = itsMS (itsMS.col("DATA_DESC_ID") == itsSpw);
         // If not all is selected, use the selection.
         if (subset.nrow() < itsMS.nrow()) {
@@ -104,7 +101,6 @@ namespace LOFAR {
       }
       // See if a selection on baseline needs to be done.
       if (! itsSelBL.empty()) {
-	DPLOG_INFO_STR (" MSReader selecting baselines ...");
         MSSelection select;
         // Set given selection strings.
         select.setAntennaExpr (itsSelBL);
@@ -214,8 +210,8 @@ namespace LOFAR {
           // Skip time slot and give warning if MS data is not in time order.
           if (mstime < itsLastMSTime) {
             LOG_WARN_STR ("Time at rownr "
-                          << itsIter.table().rowNumbers()[0]
-                          << " of MS " << itsMSName
+                          << itsIter.table().rowNumbers(itsMS)[0]
+                          << " of MS " << itsMS.tableName()
                           << " is less than previous time slot");
           } else {
             // Use the time slot if near or < nexttime, but > starttime.
@@ -255,7 +251,7 @@ namespace LOFAR {
           calcUVW();
           itsNrInserted++;
         } else {
-          itsBuffer.setRowNrs (itsIter.table().rowNumbers(itsMS, True));
+          itsBuffer.setRowNrs (itsIter.table().rowNumbers(itsMS));
           if (itsMissingData) {
             // Data column not present, so fill a fully flagged time slot.
             itsBuffer.setExposure (itsTimeInterval);
@@ -471,7 +467,7 @@ namespace LOFAR {
       ROScalarColumn<Int> ant2col(itsIter.table(), "ANTENNA2");
       // Keep the row numbers of the first part to be used for the meta info
       // of possibly missing time slots.
-      itsBaseRowNrs = itsIter.table().rowNumbers(itsMS, True);
+      itsBaseRowNrs = itsIter.table().rowNumbers(itsMS);
       // Get the antenna names and positions.
       Table anttab(itsMS.keywordSet().asTable("ANTENNA"));
       ROScalarColumn<String> nameCol (anttab, "NAME");
@@ -557,8 +553,8 @@ namespace LOFAR {
         // Skip time slot and give warning if MS data is not in time order.
         if (mstime < itsLastMSTime) {
           LOG_WARN_STR ("Time at rownr "
-                        << itsIter.table().rowNumbers()[0]
-                        << " of MS " << itsMSName
+                        << itsIter.table().rowNumbers(itsMS)[0]
+                        << " of MS " << itsMS.tableName()
                         << " is less than previous time slot");
         } else {
           // Stop skipping if time equal to itsFirstTime.
@@ -745,7 +741,6 @@ namespace LOFAR {
       return flags;
     }
 
-    /*
     Cube<Complex> MSReader::getData (const String& columnName,
                                      const RefRows& rowNrs)
     {
@@ -758,7 +753,6 @@ namespace LOFAR {
       Cube<Complex> data = dataCol.getColumnCells (rowNrs);
       return (itsUseAllChan ? data : data(itsArrSlicer));
     }
-    */
 
     void MSReader::putFlags (const RefRows& rowNrs,
                              const Cube<bool>& flags)
diff --git a/CEP/DP3/DPPP/src/MSUpdater.cc b/CEP/DP3/DPPP/src/MSUpdater.cc
index 89baabe4db45b1c91683eb6db74fdeeec57dd2ad..2825aed88f70e5a15fce7879d7d80946e4277855 100644
--- a/CEP/DP3/DPPP/src/MSUpdater.cc
+++ b/CEP/DP3/DPPP/src/MSUpdater.cc
@@ -26,7 +26,7 @@
 #include <DPPP/MSReader.h>
 #include <DPPP/MSWriter.h>
 #include <DPPP/DPBuffer.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <iostream>
 
 using namespace casa;
@@ -34,7 +34,7 @@ using namespace casa;
 namespace LOFAR {
   namespace DPPP {
 
-    MSUpdater::MSUpdater (MSReader* reader, const ParameterSet& parset,
+    MSUpdater::MSUpdater (MSReader* reader, const ParSet& parset,
                           const string&)
       : itsReader      (reader),
         itsNrCorr      (reader->getInfo().ncorr()),
@@ -43,7 +43,7 @@ namespace LOFAR {
         itsNrTimes     (0)
     {
       NSTimer::StartStop sstime(itsTimer);
-      MSWriter::writeHistory (reader->table(), parset);
+      MSWriter::writeHistory (reader->table(), parset.parameterSet());
     }
 
     MSUpdater::~MSUpdater()
diff --git a/CEP/DP3/DPPP/src/MSWriter.cc b/CEP/DP3/DPPP/src/MSWriter.cc
index a075a61cac358b13c7ce5b014738d16551be77c2..5a3f6b5cf9f382d80d02cfec564a4acbb1fd3284 100644
--- a/CEP/DP3/DPPP/src/MSWriter.cc
+++ b/CEP/DP3/DPPP/src/MSWriter.cc
@@ -27,9 +27,9 @@
 #include <DPPP/MSUpdater.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
+#include <DPPP/ParSet.h>
 #include <DPPP/DPLogger.h>
 #include <MS/VdsMaker.h>
-#include <Common/ParameterSet.h>
 #include <tables/Tables/TableCopy.h>
 #include <tables/Tables/DataManInfo.h>
 #include <tables/Tables/SetupNewTab.h>
@@ -50,7 +50,7 @@ namespace LOFAR {
 
     MSWriter::MSWriter (MSReader* reader, const std::string& outName,
                         const DPInfo& info,
-                        const ParameterSet& parset, const string& prefix)
+                        const ParSet& parset, const string& prefix)
       : itsReader       (reader),
         itsInterval     (info.timeInterval()),
         itsNrCorr       (info.ncorr()),
@@ -80,7 +80,7 @@ namespace LOFAR {
       }
       createMS (outName, info, tileSize, tileNChan);
       // Write the parset info into the history.
-      writeHistory (itsMS, parset);
+      writeHistory (itsMS, parset.parameterSet());
       itsMS.flush (true, true);
       DPLOG_INFO ("Finished preparing output MS", false);
     }
diff --git a/CEP/DP3/DPPP/src/MedFlagger.cc b/CEP/DP3/DPPP/src/MedFlagger.cc
index 32ec6e6b8ab8590f9e4e9114ecba6b3ab51deaf5..a42a67ab49b1fb9bee81021b71b9d7ef3c0d429b 100644
--- a/CEP/DP3/DPPP/src/MedFlagger.cc
+++ b/CEP/DP3/DPPP/src/MedFlagger.cc
@@ -25,7 +25,7 @@
 #include <DPPP/MedFlagger.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StreamUtil.h>
 #include <Common/LofarLogger.h>
 #include <casa/Arrays/ArrayMath.h>
@@ -42,8 +42,7 @@ namespace LOFAR {
   namespace DPPP {
 
     MedFlagger::MedFlagger (DPInput* input,
-                            const ParameterSet& parset,
-                            const string& prefix)
+                            const ParSet& parset, const string& prefix)
       : itsInput         (input),
         itsName          (prefix),
         itsThresholdStr  (parset.getString (prefix+"threshold", "1")),
diff --git a/CEP/DP3/DPPP/src/MultiMSReader.cc b/CEP/DP3/DPPP/src/MultiMSReader.cc
index d127fd3e2eaf9a84ebf2ca7a8e77a8e4144f9b22..a7b24b40d4e35f8d93fcbdd667bbd129dd1ee78e 100644
--- a/CEP/DP3/DPPP/src/MultiMSReader.cc
+++ b/CEP/DP3/DPPP/src/MultiMSReader.cc
@@ -25,7 +25,7 @@
 #include <DPPP/MultiMSReader.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StreamUtil.h>
 #include <Common/LofarLogger.h>
 #include <tables/Tables/TableRecord.h>
@@ -48,8 +48,7 @@ namespace LOFAR {
   namespace DPPP {
 
     MultiMSReader::MultiMSReader (const vector<string>& msNames,
-                                  const ParameterSet& parset,
-                                  const string& prefix)
+                                  const ParSet& parset, const string& prefix)
       : itsFirst    (-1),
         itsNMissing (0),
         itsMSNames  (msNames)
@@ -163,14 +162,12 @@ namespace LOFAR {
       for (uint i=0; i<itsReaders.size(); ++i) {
         if (itsReaders[i]) {
           ASSERTSTR (itsReaders[i]->getInfo().nchan() == itsFillNChan,
-                     "An MS is missing; the others should have equal nchan");
+                     "An MS is missing; the others should have equal size");
           // Check if all channels have the same width and are consecutive.
           const Vector<double>& freqs = itsReaders[i]->getInfo().chanFreqs();
           const Vector<double>& width = itsReaders[i]->getInfo().chanWidths();
-          ASSERTSTR (freqs[0] > freq  ||  near(freqs[0], freq, 1e-5),
-                     "Subbands should be in increasing order of frequency; found "
-		     << freqs[0] << ", expected " << freq << " (diff="
-		     << freqs[0]-freq << ')');
+          ASSERTSTR (freqs[0] > freq  ||  near(freqs[0], freq),
+                     "Subbands should be in increasing order of frequency");
           freq = freqs[itsFillNChan-1] + width[itsFillNChan-1];
           objcopy (chanFreqs.data()  + inx, freqs.data(), itsFillNChan);
           objcopy (chanWidths.data() + inx, width.data(), itsFillNChan);
@@ -404,7 +401,6 @@ namespace LOFAR {
       return flags;
     }
 
-    /*
     Cube<Complex> MultiMSReader::getData (const String& columnName,
                                           const RefRows& rowNrs)
     {
@@ -424,7 +420,6 @@ namespace LOFAR {
       }
       return data;
     }
-    */
 
     void MultiMSReader::combineFullResFlags (const vector<Cube<bool> >& vec,
                                              Cube<bool>& flags) const
diff --git a/CEP/DP3/DPPP/src/ParSet.cc b/CEP/DP3/DPPP/src/ParSet.cc
new file mode 100644
index 0000000000000000000000000000000000000000..61e1430f2f2d1a35813f4f26a080f7c4033174f3
--- /dev/null
+++ b/CEP/DP3/DPPP/src/ParSet.cc
@@ -0,0 +1,217 @@
+//# ParSet.cc: Wrapper around ParaMeterSet to keep track of parameters asked for
+//# Copyright (C) 2010
+//# ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+//#
+//# @author Ger van Diepen
+
+#include <DPPP/ParSet.h>
+#include <Common/ParameterRecord.h>
+#include <set>
+
+namespace LOFAR {
+  namespace DPPP {
+
+    ParSet::ParSet (const ParameterSet& parset )
+      : itsParSet (parset)
+    {}
+
+    bool   ParSet::getBool  (const string& aKey) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getBool (aKey);
+    }
+
+    bool   ParSet::getBool  (const string& aKey, bool aValue) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getBool (aKey, aValue);
+    }
+
+    int    ParSet::getInt   (const string& aKey) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getInt (aKey);
+    }
+
+    int    ParSet::getInt   (const string& aKey, int aValue) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getInt (aKey, aValue);
+    }
+
+    uint   ParSet::getUint  (const string& aKey) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getUint (aKey);
+    }
+
+    uint   ParSet::getUint  (const string& aKey, uint aValue) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getUint (aKey, aValue);
+    }
+
+    float  ParSet::getFloat (const string& aKey) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getFloat (aKey);
+    }
+
+    float  ParSet::getFloat (const string& aKey, float aValue) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getFloat (aKey, aValue);
+    }
+
+    double ParSet::getDouble(const string& aKey) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getDouble (aKey);
+    }
+
+    double ParSet::getDouble(const string& aKey, double aValue) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getDouble (aKey, aValue);
+    }
+
+    string ParSet::getString(const string& aKey) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getString (aKey);
+    }
+
+    string ParSet::getString(const string& aKey, const string& aValue) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getString (aKey, aValue);
+    }
+
+    vector<bool>   ParSet::getBoolVector  (const string& aKey,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getBoolVector (aKey, expandable);
+    }
+
+    vector<bool>   ParSet::getBoolVector  (const string& aKey,
+                                           const vector<bool>& aValue,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getBoolVector (aKey, aValue, expandable);
+    }
+
+    vector<int>    ParSet::getIntVector   (const string& aKey,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getIntVector (aKey, expandable);
+    }
+
+    vector<int>    ParSet::getIntVector   (const string& aKey,
+                                           const vector<int>& aValue,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getIntVector (aKey, aValue, expandable);
+    }
+
+    vector<uint>   ParSet::getUintVector  (const string& aKey,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getUintVector (aKey, expandable);
+    }
+
+    vector<uint>   ParSet::getUintVector  (const string& aKey,
+                                           const vector<uint>& aValue,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getUintVector (aKey, aValue, expandable);
+    }
+
+    vector<float>  ParSet::getFloatVector (const string& aKey,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getFloatVector (aKey, expandable);
+    }
+
+    vector<float>  ParSet::getFloatVector (const string& aKey,
+                                           const vector<float>& aValue,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getFloatVector (aKey, aValue, expandable);
+    }
+
+    vector<double> ParSet::getDoubleVector(const string& aKey,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getDoubleVector (aKey, expandable);
+    }
+
+    vector<double> ParSet::getDoubleVector(const string& aKey,
+                                           const vector<double>& aValue,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getDoubleVector (aKey, aValue, expandable);
+    }
+
+    vector<string> ParSet::getStringVector(const string& aKey,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getStringVector (aKey, expandable);
+    }
+
+    vector<string> ParSet::getStringVector(const string& aKey,
+                                           const vector<string>& aValue,
+                                           bool expandable) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getStringVector (aKey, aValue, expandable);
+    }
+
+    ParameterRecord ParSet::getRecord(const string& aKey) const
+    {
+      itsAskedParms.insert (aKey);
+      return itsParSet.getRecord (aKey);
+    }
+
+    vector<string> ParSet::unusedKeys() const
+    {
+      vector<string> vec;
+      for (ParameterSet::const_iterator iter = itsParSet.begin();
+           iter != itsParSet.end(); ++iter) {
+        if (itsAskedParms.find (iter->first) == itsAskedParms.end()) {
+          vec.push_back (iter->first);
+        }
+      }
+      return vec;
+    }
+
+
+  } //# end namespace
+}
diff --git a/CEP/DP3/DPPP/src/PhaseShift.cc b/CEP/DP3/DPPP/src/PhaseShift.cc
index 4501069dcd8190ae3b017486a06be79e94b218a9..c24752220567c8641b180230feb544fb755f1942 100644
--- a/CEP/DP3/DPPP/src/PhaseShift.cc
+++ b/CEP/DP3/DPPP/src/PhaseShift.cc
@@ -25,7 +25,7 @@
 #include <DPPP/PhaseShift.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/LofarLogger.h>
 #include <Common/StreamUtil.h>
 #include <casa/Arrays/ArrayMath.h>
@@ -43,16 +43,14 @@ namespace LOFAR {
   namespace DPPP {
 
     PhaseShift::PhaseShift (DPInput* input,
-                            const ParameterSet& parset,
-                            const string& prefix)
+                            const ParSet& parset, const string& prefix)
       : itsInput   (input),
         itsName    (prefix),
         itsCenter  (parset.getStringVector(prefix+"phasecenter"))
     {}
 
     PhaseShift::PhaseShift (DPInput* input,
-                            const ParameterSet& parset,
-                            const string& prefix,
+                            const ParSet& parset, const string& prefix,
                             const vector<string>& defVal)
       : itsInput   (input),
         itsName    (prefix),
diff --git a/CEP/DP3/DPPP/src/PreFlagger.cc b/CEP/DP3/DPPP/src/PreFlagger.cc
index f9c6715efc9adb7bfebc7c24491ceaa4df5de5b2..2e24393113dba9a21f85ac3c83ec3e153969b5f5 100644
--- a/CEP/DP3/DPPP/src/PreFlagger.cc
+++ b/CEP/DP3/DPPP/src/PreFlagger.cc
@@ -25,8 +25,8 @@
 #include <DPPP/PreFlagger.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
+#include <DPPP/ParSet.h>
 #include <DPPP/DPLogger.h>
-#include <Common/ParameterSet.h>
 #include <Common/StreamUtil.h>
 #include <Common/LofarLogger.h>
 
@@ -51,8 +51,7 @@ namespace LOFAR {
   namespace DPPP {
 
     PreFlagger::PreFlagger (DPInput* input,
-                            const ParameterSet& parset,
-                            const string& prefix)
+                            const ParSet& parset, const string& prefix)
       : itsName        (prefix),
         itsInput       (input),
         itsMode        (SetFlag),
@@ -226,8 +225,7 @@ namespace LOFAR {
 
 
     PreFlagger::PSet::PSet (DPInput* input,
-                            const ParameterSet& parset,
-                            const string& prefix)
+                            const ParSet& parset, const string& prefix)
       : itsInput (input),
         itsName  (prefix),
         itsFlagOnUV    (false),
diff --git a/CEP/DP3/DPPP/src/StationAdder.cc b/CEP/DP3/DPPP/src/StationAdder.cc
index 1f6768bd5ac613488315620e3d7865763887c473..76356ad5669a275280464be413c126310cc1da23 100644
--- a/CEP/DP3/DPPP/src/StationAdder.cc
+++ b/CEP/DP3/DPPP/src/StationAdder.cc
@@ -25,8 +25,8 @@
 #include <DPPP/StationAdder.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
+#include <DPPP/ParSet.h>
 #include <DPPP/DPLogger.h>
-#include <Common/ParameterSet.h>
 #include <Common/ParameterRecord.h>
 
 #include <measures/Measures/MPosition.h>
@@ -48,8 +48,7 @@ namespace LOFAR {
   namespace DPPP {
 
     StationAdder::StationAdder (DPInput* input,
-                                const ParameterSet& parset,
-                                const string& prefix)
+                                const ParSet& parset, const string& prefix)
       : itsInput        (input),
         itsName         (prefix),
         itsStatRec      (parset.getRecord(prefix+"stations")),
diff --git a/CEP/DP3/DPPP/src/UVWFlagger.cc b/CEP/DP3/DPPP/src/UVWFlagger.cc
index c5a0a5fea741c030d12320dc53b16dcaf26a56dd..dd70fc6ad2dd0d2db5c416654312e456fd21c15d 100644
--- a/CEP/DP3/DPPP/src/UVWFlagger.cc
+++ b/CEP/DP3/DPPP/src/UVWFlagger.cc
@@ -25,7 +25,7 @@
 #include <DPPP/UVWFlagger.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StreamUtil.h>
 #include <Common/LofarLogger.h>
 #include <casa/Arrays/ArrayMath.h>
@@ -42,8 +42,7 @@ namespace LOFAR {
   namespace DPPP {
 
     UVWFlagger::UVWFlagger (DPInput* input,
-                            const ParameterSet& parset,
-                            const string& prefix)
+                            const ParSet& parset, const string& prefix)
       : itsInput       (input),
         itsName        (prefix),
         itsNTimes      (0),
@@ -243,7 +242,7 @@ namespace LOFAR {
       }
     }
 
-    vector<double> UVWFlagger::fillUVW (const ParameterSet& parset,
+    vector<double> UVWFlagger::fillUVW (const ParSet& parset,
                                         const string& prefix,
                                         const string& name,
                                         bool square)
diff --git a/CEP/DP3/DPPP/test/CMakeLists.txt b/CEP/DP3/DPPP/test/CMakeLists.txt
index 64f5d62d6a46acb026dc1fd8937272a8adb69fa9..b6bf34bbbfd74dbeeacefe887becddd05e649862 100644
--- a/CEP/DP3/DPPP/test/CMakeLists.txt
+++ b/CEP/DP3/DPPP/test/CMakeLists.txt
@@ -16,6 +16,7 @@ lofar_add_test(tFilter tFilter.cc)
 #lofar_add_test(tDemixer tDemixer.cc)
 lofar_add_test(tNDPPP tNDPPP.cc)
 lofar_add_test(tparse tparse.cc)
+lofar_add_test(tParSet tParSet.cc)
 lofar_add_test(tBaselineSelection tBaselineSelection.cc)
 # lofar_add_test(tExpr tExpr.cc)
 # lofar_add_test(tmeqarray tmeqarray.cc)
diff --git a/CEP/DP3/DPPP/test/tAORFlagger.cc b/CEP/DP3/DPPP/test/tAORFlagger.cc
index 386a7f482f0c44462123565a24fadc936afd18cf..ae2c060ad83c42eb052dc9751169cc6f409a9620 100644
--- a/CEP/DP3/DPPP/test/tAORFlagger.cc
+++ b/CEP/DP3/DPPP/test/tAORFlagger.cc
@@ -26,7 +26,7 @@
 #include <DPPP/DPInput.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/DP3/DPPP/test/tAverager.cc b/CEP/DP3/DPPP/test/tAverager.cc
index 80f7b2cee5d2fdd8d1a7d0eb9162ec4e6cb9d5cd..d6c4b9b4af5e25a7af10dfd00a0a2e161a11fc9c 100644
--- a/CEP/DP3/DPPP/test/tAverager.cc
+++ b/CEP/DP3/DPPP/test/tAverager.cc
@@ -25,7 +25,7 @@
 #include <DPPP/Averager.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/DP3/DPPP/test/tBaselineSelection.cc b/CEP/DP3/DPPP/test/tBaselineSelection.cc
index af1ba2f32b9668fed4852fc9f95fe8f10d07f69f..fc125a99b6046db3d4073fcc517cb04341cf012f 100644
--- a/CEP/DP3/DPPP/test/tBaselineSelection.cc
+++ b/CEP/DP3/DPPP/test/tBaselineSelection.cc
@@ -24,7 +24,7 @@
 #include <lofar_config.h>
 #include <DPPP/BaselineSelection.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/LofarLogger.h>
 #include <Common/StreamUtil.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/DP3/DPPP/test/tDemixer.cc b/CEP/DP3/DPPP/test/tDemixer.cc
index 97540f1524cb3aa9a15cbd2b45e2e34aec5e487d..fec79fc9913705b1cefd410b2206718fc87f5d60 100644
--- a/CEP/DP3/DPPP/test/tDemixer.cc
+++ b/CEP/DP3/DPPP/test/tDemixer.cc
@@ -25,7 +25,7 @@
 #include <DPPP/Demixer.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/DP3/DPPP/test/tFilter.cc b/CEP/DP3/DPPP/test/tFilter.cc
index 9559d6b355fc9ba9c73098cc37dc0bb1c83d8116..758eb6633fb84583d32ef0231ce536503587ca88 100644
--- a/CEP/DP3/DPPP/test/tFilter.cc
+++ b/CEP/DP3/DPPP/test/tFilter.cc
@@ -25,7 +25,7 @@
 #include <DPPP/Filter.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/DP3/DPPP/test/tMedFlagger.cc b/CEP/DP3/DPPP/test/tMedFlagger.cc
index fc3f883ad7fb458f4a249669d9ea5442d87c105d..767c478e564767cbe8b213c3efd694e6e1dae4e7 100644
--- a/CEP/DP3/DPPP/test/tMedFlagger.cc
+++ b/CEP/DP3/DPPP/test/tMedFlagger.cc
@@ -26,7 +26,7 @@
 #include <DPPP/DPInput.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/DP3/DPPP/test/tPSet.cc b/CEP/DP3/DPPP/test/tPSet.cc
index 6ac6264d9db38b9c006d944e5ed7c292ddcbeff4..f1b6a8204b4e8ccd85c3fcff12dcd5098caae539 100644
--- a/CEP/DP3/DPPP/test/tPSet.cc
+++ b/CEP/DP3/DPPP/test/tPSet.cc
@@ -24,7 +24,7 @@
 #include <lofar_config.h>
 #include <DPPP/PreFlagger.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/LofarLogger.h>
 #include <casa/Arrays/ArrayIO.h>
 #include <casa/Quanta/MVTime.h>
diff --git a/CEP/DP3/DPPP/test/tParSet.cc b/CEP/DP3/DPPP/test/tParSet.cc
new file mode 100644
index 0000000000000000000000000000000000000000..37ea477cfc72fec6013461f64293596cc86af38d
--- /dev/null
+++ b/CEP/DP3/DPPP/test/tParSet.cc
@@ -0,0 +1,57 @@
+//# tParSet.cc: Test for class ParSet
+//# Copyright (C) 2010
+//# ASTRON (Netherlands Institute for Radio Astronomy)
+//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+//#
+//# This file is part of the LOFAR software suite.
+//# The LOFAR software suite 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.
+//#
+//# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+//#
+//# $Id$
+//#
+//# @author Ger van Diepen
+
+#include <lofar_config.h>
+#include <DPPP/ParSet.h>
+#include <Common/LofarLogger.h>
+
+using namespace LOFAR;
+using namespace LOFAR::DPPP;
+
+void doTest()
+{
+  ParameterSet parset;
+  parset.add ("key1", "abc");
+  parset.add ("key2", "def");
+  parset.add ("key3", "g");
+  ParSet pset(parset);
+  ASSERT (pset.unusedKeys().size() == 3);
+  ASSERT (pset.getString("key1") == "abc");
+  ASSERT (pset.getString("key1", "") == "abc");
+  ASSERT (pset.getString("key1a", "12") == "12");
+  ASSERT (pset.getString("key3") == "g");
+  vector<string> unused = pset.unusedKeys();
+  ASSERT (unused.size() == 1);
+  ASSERT (unused[0] == "key2");
+}
+
+int main()
+{
+  try {
+    doTest();
+  } catch (std::exception& x) {
+    cout << "Unexpected exception: " << x.what() << endl;
+    return 1;
+  }
+  return 0;
+}
diff --git a/CEP/DP3/DPPP/test/tPhaseShift.cc b/CEP/DP3/DPPP/test/tPhaseShift.cc
index 24a6d6440a5ebd70a75ab1c852414af8fc06a274..8ce174dc4d7b38283a7437b93a148028a5dcb435 100644
--- a/CEP/DP3/DPPP/test/tPhaseShift.cc
+++ b/CEP/DP3/DPPP/test/tPhaseShift.cc
@@ -25,7 +25,7 @@
 #include <DPPP/PhaseShift.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/DP3/DPPP/test/tPreFlagger.cc b/CEP/DP3/DPPP/test/tPreFlagger.cc
index e3ebcddf3e91dc6b73d61aada1ca573a5cfea0c5..af24d6dd9c0fc2e44351d925acf2581472c139aa 100644
--- a/CEP/DP3/DPPP/test/tPreFlagger.cc
+++ b/CEP/DP3/DPPP/test/tPreFlagger.cc
@@ -27,7 +27,7 @@
 #include <DPPP/DPInput.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/DP3/DPPP/test/tStationAdder.cc b/CEP/DP3/DPPP/test/tStationAdder.cc
index 5b21004c8541b6ef0d3fb5b999cb2971d8481bc2..a666a8d6fd0977a7846e94ec45a8ff9ab7d5f060 100644
--- a/CEP/DP3/DPPP/test/tStationAdder.cc
+++ b/CEP/DP3/DPPP/test/tStationAdder.cc
@@ -26,7 +26,7 @@
 #include <DPPP/DPInput.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <Common/StreamUtil.h>
 #include <casa/Arrays/ArrayMath.h>
diff --git a/CEP/DP3/DPPP/test/tUVWFlagger.cc b/CEP/DP3/DPPP/test/tUVWFlagger.cc
index 76dd46ba7ef073e68bf28efa5a227e76b659b58a..a91b59753368a57971173158cbb6cd9b4427cce2 100644
--- a/CEP/DP3/DPPP/test/tUVWFlagger.cc
+++ b/CEP/DP3/DPPP/test/tUVWFlagger.cc
@@ -26,7 +26,7 @@
 #include <DPPP/DPInput.h>
 #include <DPPP/DPBuffer.h>
 #include <DPPP/DPInfo.h>
-#include <Common/ParameterSet.h>
+#include <DPPP/ParSet.h>
 #include <Common/StringUtil.h>
 #include <casa/Arrays/ArrayMath.h>
 #include <casa/Arrays/ArrayLogical.h>
diff --git a/CEP/GSM/src/gsmutils.py b/CEP/GSM/src/gsmutils.py
index 27ed54b449ef168acaad5cbf9de505f9614896a0..7137711fc51e205b0dd74e174a0a6a46d918de71 100644
--- a/CEP/GSM/src/gsmutils.py
+++ b/CEP/GSM/src/gsmutils.py
@@ -43,22 +43,27 @@ def expected_fluxes_in_fov(conn, ra_central, decl_central, fov_radius, assoc_the
     
     #TODO: Check what happens at high decl when alpha goes to 180 degrees
     if ra_central - alpha(fov_radius, decl_central) < 0:
+        #"This will be implemented soon"
         ra_min1 = np.float(ra_central - alpha(fov_radius, decl_central) + 360.0)
         ra_max1 = np.float(360.0)
         ra_min2 = np.float(0.0)
         ra_max2 = np.float(ra_central + alpha(fov_radius, decl_central))
+        #print ra_min1, ra_max1, ra_min2, ra_max2
         q = "q_across_ra0"
     elif ra_central + alpha(fov_radius, decl_central) > 360:
+        #"This will be implemented soon"
         ra_min1 = np.float(ra_central - alpha(fov_radius, decl_central))
         ra_max1 = np.float(360.0)
         ra_min2 = np.float(0.0)
         ra_max2 = np.float(ra_central + alpha(fov_radius, decl_central) - 360)
+        #print ra_min1, ra_max1, ra_min2, ra_max2
         q = "q_across_ra0"
     elif ra_central - alpha(fov_radius, decl_central) < 0 and ra_central + alpha(fov_radius, decl_central) > 360:
         raise BaseException("ra = %s > 360 degrees, not implemented yet" % str(ra_central + alpha(fov_radius, decl_central))) 
     else:
         ra_min = np.float(ra_central - alpha(fov_radius, decl_central))
         ra_max = np.float(ra_central + alpha(fov_radius, decl_central))
+        #print ra_min, ra_max
         q = "q0"
     
     if vlss_flux_cutoff is None:
@@ -350,7 +355,6 @@ def expected_fluxes_in_fov(conn, ra_central, decl_central, fov_radius, assoc_the
            ) t3
         ON t0.v_catsrcid = t3.v_catsrcid
      WHERE t0.v_flux >= %s
-    ORDER BY t0.v_catsrcid
     """
     q0 = """\
     SELECT t0.v_catsrcid
@@ -609,7 +613,6 @@ def expected_fluxes_in_fov(conn, ra_central, decl_central, fov_radius, assoc_the
            ) t3
         ON t0.v_catsrcid = t3.v_catsrcid
      WHERE t0.v_flux >= %s
-    ORDER BY t0.v_catsrcid
     """
     try:
         cursor = conn.cursor()
@@ -703,31 +706,14 @@ def expected_fluxes_in_fov(conn, ra_central, decl_central, fov_radius, assoc_the
         else:
             status = False
         spectrumfiles = []
-        # Check for duplicate vlss_names. This may arise when a VLSS source 
-        # is associated with one or more (genuine) counterparts.
-        # Eg., if two NVSS sources are seen as counterparts
-        # VLSS - WENSS - NVSS_1
-        # VLSS - WENSS - NVSS_2
-        # two rows will be added to the sky model, where the VLSS name 
-        # is postfixed with _0 and _1, resp.
-        import collections
-        items = collections.defaultdict(list)
-        src_name = list(vlss_name)
-        for i, item in enumerate(src_name):
-            items[item].append(i)
-        for item, locs in items.iteritems():
-            if len(locs) > 1:
-                #print "duplicates of", item, "at", locs
-                for j in range(len(locs)):
-                    src_name[locs[j]] = src_name[locs[j]] + "_" + str(j)
         if len(results) != 0:
             for i in range(len(vlss_catsrcid)):
                 ##print "\ni = ", i
                 bbsrow = ""
                 # Here we check the cases for the degree of the polynomial spectral index fit
                 #print i, vlss_name[i],vlss_catsrcid[i], wenssm_catsrcid[i], wenssp_catsrcid[i], nvss_catsrcid[i]
-                # Write the vlss name of the source (either postfixed or not)
-                bbsrow += src_name[i] + ", "
+                #print "VLSS",vlss_name[i]
+                bbsrow += vlss_name[i] + ", "
                 # According to Jess, only sources that have values for all
                 # three are considered as GAUSSIAN
                 if pa[i] is not None and major[i] is not None and minor[i] is not None:
diff --git a/CEP/MS/src/BaselineSelect.cc b/CEP/MS/src/BaselineSelect.cc
index e5785247ae3461f51a494bb466a6217c8390516a..786e49fc095adc3ad3d20406cbad49e9d9a15c6e 100644
--- a/CEP/MS/src/BaselineSelect.cc
+++ b/CEP/MS/src/BaselineSelect.cc
@@ -36,27 +36,10 @@ namespace LOFAR {
   Matrix<bool> BaselineSelect::convert (const string& msName,
                                         const string& baselineSelection)
   {
-    // Find the unique baselines in the MS.
-    // Do not use unique sort, because that is slow for a large MS.
-    // Simply go through all baselines.
-    Table bltab;
-    {
-      Table tab(msName);
-      Vector<Int> a1 = ROScalarColumn<Int>(tab, "ANTENNA1").getColumn();
-      Vector<Int> a2 = ROScalarColumn<Int>(tab, "ANTENNA2").getColumn();
-      int nant = 1 + std::max(max(a1), max(a2));
-      Matrix<bool> bl(nant, nant, false);
-      vector<uInt> rows;
-      rows.reserve (nant*nant);
-      for (uint i=0; i<a1.size(); ++i) {
-        if (! bl(a1[i], a2[i])) {
-          rows.push_back (i);
-          bl(a1[i], a2[i]) = true;
-        }
-      }
-      bltab = tab(Vector<uInt>(rows));
-    }
-    MeasurementSet ms(bltab);
+    // Get the unique baselines.
+    Table sortab (tableCommand("select from " + msName +
+                               " order by unique ANTENNA1, ANTENNA2"));
+    MeasurementSet ms(sortab);
     MSSelection select;
     // Set given selection strings.
     select.setAntennaExpr (baselineSelection);
@@ -67,7 +50,8 @@ namespace LOFAR {
     Vector<Int> a1 = ROScalarColumn<Int>(seltab, "ANTENNA1").getColumn();
     Vector<Int> a2 = ROScalarColumn<Int>(seltab, "ANTENNA2").getColumn();
     int nant = ms.antenna().nrow();
-    Matrix<bool> bl(nant, nant, false);
+    Matrix<bool> bl(nant, nant);
+    bl = false;
     for (uint i=0; i<a1.size(); ++i) {
       bl(a1[i], a2[i]) = true;
       bl(a2[i], a1[i]) = true;
diff --git a/CEP/Pipeline/framework/lofarpipe/support/control.py b/CEP/Pipeline/framework/lofarpipe/support/control.py
index 7d1d6da00b272786f4a22eaf131241dd5b89af43..c4d3a9fe9ac1a5461b3b7ae1195de4d6a878daa5 100644
--- a/CEP/Pipeline/framework/lofarpipe/support/control.py
+++ b/CEP/Pipeline/framework/lofarpipe/support/control.py
@@ -6,9 +6,8 @@
 #                                                             Marcel Loose, 2012
 #                                                                loose@astron.nl
 # ------------------------------------------------------------------------------
-import sys
+
 import re
-import traceback
 
 from lofarpipe.support.stateful import StatefulRecipe
 from lofarpipe.support.lofarexceptions import PipelineException
@@ -87,12 +86,6 @@ class control(StatefulRecipe):
             self.logger.error("Failed pipeline run: {0}".format(
                         self.inputs['job_name']))
             self.logger.error(message)
-            # Get detailed information of the caught exception
-            (type, value, traceback_object) = sys.exc_info()
-            self.logger.error("Detailed exception information:")
-            self.logger.error(str(type))
-            self.logger.error(str(value))
-            self.logger.error(str(traceback.extract_tb(traceback_object)))
             #message does not contain the original exception thrown in recipe
             if get_active_stack(self) != None:
                 self.logger.error("\n" +
diff --git a/CEP/Pipeline/framework/lofarpipe/support/jobserver.py b/CEP/Pipeline/framework/lofarpipe/support/jobserver.py
index 9aebe02869e630e13c7e20c2cbf6ffa07405c826..138bfd61d61f84f388c2d54f14474ad5639214cb 100644
--- a/CEP/Pipeline/framework/lofarpipe/support/jobserver.py
+++ b/CEP/Pipeline/framework/lofarpipe/support/jobserver.py
@@ -82,12 +82,7 @@ class JobStreamHandler(SocketServer.StreamRequestHandler):
             (job_id, self.request.getpeername())
         )
         results = pickle.loads(pickled_results)
-        self.server.logger.debug("Results for job {0} : {1}".format(
-                job_id, results))
-        # Use update to insert the result value from the node. (do not replace)
-        self.server.jobpool[job_id].results.update(results)
-        self.server.logger.debug("Joined results for job {0} : {1}".format(
-                job_id, self.server.jobpool[job_id].results))
+        self.server.jobpool[job_id].results = results
 
     def handle_log_record(self, chunk):
         record = logging.makeLogRecord(pickle.loads(chunk))
diff --git a/CEP/Pipeline/framework/lofarpipe/support/lofarnode.py b/CEP/Pipeline/framework/lofarpipe/support/lofarnode.py
index 9451d330c93567c43f2c24e4fe1e3508bb23927c..4d74f4d278a420d2406a8a1cd1d23e8acb5e911a 100644
--- a/CEP/Pipeline/framework/lofarpipe/support/lofarnode.py
+++ b/CEP/Pipeline/framework/lofarpipe/support/lofarnode.py
@@ -104,7 +104,7 @@ class LOFARnodeTCP(LOFARnode):
                 if tries > 0:
                     timeout = random.uniform(min_timeout, max_timeout)
                     print("Retrying in %f seconds (%d more %s)." %
-                          (timeout, tries, "try" if tries == 1 else "tries"))
+                          (timeout, tries, "try" if tries==1 else "tries"))
                     time.sleep(timeout)
                 else:
                     raise
@@ -133,10 +133,7 @@ class LOFARnodeTCP(LOFARnode):
         Send the contents of self.outputs to the originating job dispatch
         server.
         """
-        print ("preparing to send pickle result/outputs: {0}".format(
-                                                                self.outputs))
         message = "PUT %d %s" % (self.job_id, pickle.dumps(self.outputs))
-
         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self.__try_connect(s)
         s.send(struct.pack(">L", len(message)) + message)
diff --git a/CEP/Pipeline/framework/lofarpipe/support/loggingdecorators.py b/CEP/Pipeline/framework/lofarpipe/support/loggingdecorators.py
index b59acc85994d48561a1b6bde9a478fa8c54513db..29ff5bab554c8921e26052ccfb79c633015b0147 100644
--- a/CEP/Pipeline/framework/lofarpipe/support/loggingdecorators.py
+++ b/CEP/Pipeline/framework/lofarpipe/support/loggingdecorators.py
@@ -5,7 +5,6 @@ functionality based on xml
 import smtplib
 from email.mime.text import MIMEText
 import time
-import os
 
 from lofarpipe.support.xmllogging import enter_active_stack, \
         exit_active_stack, get_active_stack
@@ -51,53 +50,6 @@ def xml_node(target):
 
     return wrapper
 
-class duration:
-    """
-    context manager for logging duration of a code block:
-    1. Add an xml active stack member on the object if not present
-    2. Add a new active stack entry for current context
-    3. On exit add the duration of the code block to the now deactivate stack
-       member
-    """
-    def __init__(self, containing_object, name):
-        """
-        On creation of the contect manager provide the object instance to add
-        the xml stack to and the name for in the loggin tree.
-        """
-        self._containing_object = containing_object
-        self._name = name
-        self._xml_current_node = None
-        self._time_info_start = None
-
-    def __enter__(self):
-        """
-        The duration context should be initialized with the calling object self
-        pointer. This allows adding the duration xml to the object
-        """
-        # Get or create an active stack (default name)
-        self._xml_current_node = enter_active_stack(
-            self._containing_object, self._name)
-        # Get and save the current time
-        self._time_info_start = time.time()
-
-        return self # return self, the context manager
-
-    def __exit__(self, exc_type, exc_value, exc_tb):
-        """
-        upon leaving the context log the duration and leave the current
-        Xml node
-        """
-        time_info_end = time.time()
-        self._xml_current_node.setAttribute(
-                    "duration", str(time_info_end - self._time_info_start))
-        if exc_type == None:
-
-            exit_active_stack(self._containing_object)
-        else:
-            # Exception thrown in the context: Return False here reraises it
-            # automatically.
-            False
-
 
 def mail_log_on_exception(target):
     """
@@ -113,34 +65,24 @@ def mail_log_on_exception(target):
 
         try:
             # call the actual function
-            time_info_start = time.time()
             return_value = target(*args, **argsw)
-            time_info_end = time.time()
             # Force exception on non zero output
             if return_value != 0:
                 raise Exception("Non zero pipeline output")
             # Mail main dev on succesfull run
             stack = get_active_stack(calling_object)
-            duration_recipe = str(time_info_end - time_info_start)
             if stack != None:
-                stack.setAttribute(
-                    "duration", duration_recipe)
                 msg_string = stack.toprettyxml(encoding='ascii')
             else:
-                msg_string = "duration: {0} \n "\
-                 "No additional pipeline data available".format(duration_recipe
-                        )
+                msg_string = "No additional pipeline data available"
 
             _mail_msg_to("pipeline_finished", "klijn@astron.nl",
-                         "pipeline finished: {0}: {1}".format(
-                                os.path.basename(calling_object.__file__),
-                                calling_object.inputs['job_name']),
-                         msg_string)
+                         "pipeline finished", msg_string)
 
         except Exception, message:
             # Static list of mail to be send (could be made configurable,
             # but yeah temp mail functionality so...)
-            mail_list = ["klijn@astron.nl", "frieswijk@astron.nl"
+            mail_list = ["klijn@astron.nl",
                          "pizzo@astron.nl", "orru@astron.nl"
                          ]
 
@@ -149,9 +91,8 @@ def mail_log_on_exception(target):
             active_stack_data = ""
             if stack != None:
                 active_stack_data = stack.toprettyxml(encoding='ascii')
-            # get the Obsid and pipeline name add to subjecy title
-            subject = "Failed pipeline run {0}: {1}".format(
-                        os.path.basename(calling_object.__file__),
+            # get the Obsid etc for subject
+            subject = "Failed pipeline run: {0}".format(
                         calling_object.inputs['job_name'])
 
             # construct the message
@@ -166,7 +107,7 @@ def mail_log_on_exception(target):
             raise
 
         calling_object.logger.info("pipeline_finished" + " xml summary:")
-        calling_object.logger.info("\n" + msg_string)
+        calling_object.logger.info(msg_string)
 
         # return the actual value of the function
         return return_value
@@ -188,12 +129,6 @@ def _mail_msg_to(adr_from, adr_to, subject, msg):
 
     # Send the message via our own SMTP server, but don't include the
     # envelope header.
-    try:
-        s = smtplib.SMTP('smtp.lofar.eu')
-        s.sendmail(adr_from, [adr_to], msg.as_string())
-        s.quit()
-    except:
-        # Nothing: This is additional functionality.
-        # If the smtp server is down we kan nothing else here
-        print "Could not establish a connection with smtp.lofar.eu"
-
+    s = smtplib.SMTP('smtp.lofar.eu')
+    s.sendmail(adr_from, [adr_to], msg.as_string())
+    s.quit()
diff --git a/CEP/Pipeline/framework/lofarpipe/support/remotecommand.py b/CEP/Pipeline/framework/lofarpipe/support/remotecommand.py
index edb04c4cd1b07fdf49eebdbd3aa2ed0add8f6264..2f4442ef2ff4c2b5a821cc51d466692c760327ca 100644
--- a/CEP/Pipeline/framework/lofarpipe/support/remotecommand.py
+++ b/CEP/Pipeline/framework/lofarpipe/support/remotecommand.py
@@ -57,7 +57,7 @@ class ParamikoWrapper(object):
     def kill(self):
         self.chan.close()
 
-def run_remote_command(config, logger, host, command, env, arguments=None):
+def run_remote_command(config, logger, host, command, env, arguments = None):
     """
     Run command on host, passing it arguments from the arguments list and
     exporting key/value pairs from env(a dictionary).
@@ -101,7 +101,7 @@ def run_via_mpirun(logger, host, command, environment, arguments):
     mpi_cmd.extend(str(arg) for arg in arguments)
     env = os.environ
     env.update(environment)
-    process = spawn_process(mpi_cmd, logger, env=env)
+    process = spawn_process(mpi_cmd, logger, env = env)
     # mpirun should be killed with a SIGTERM to enable it to shut down the
     # remote command.
     process.kill = lambda : os.kill(process.pid, signal.SIGTERM)
@@ -135,7 +135,7 @@ def run_via_paramiko(logger, host, command, environment, arguments, key_filename
     import paramiko
     client = paramiko.SSHClient()
     client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
-    client.connect(host, key_filename=key_filename)
+    client.connect(host, key_filename = key_filename)
     commandstring = ["%s=%s" % (key, value) for key, value in environment.items()]
     commandstring.append(command)
     commandstring.extend(re.escape(str(arg)) for arg in arguments)
@@ -152,7 +152,7 @@ class ProcessLimiter(defaultdict):
     :param nproc: Bound value for semaphore (ie, maximum number of jobs)
     :type nproc: integer or none
     """
-    def __init__(self, nproc=None):
+    def __init__(self, nproc = None):
         if nproc:
             super(ProcessLimiter, self).__init__(
                 lambda: BoundedSemaphore(int(nproc))
@@ -177,13 +177,11 @@ class ComputeJob(object):
     :param command: Full path to command to be run on target host
     :param arguments: List of arguments which will be passed to command
     """
-    def __init__(self, host, command, arguments=[]):
+    def __init__(self, host, command, arguments = []):
         self.host = host
         self.command = command
         self.arguments = arguments
         self.results = {}
-        self.results['returncode'] = 123456 # Default to obscure code to allow
-        # test of failing ssh connections
 
     def dispatch(self, logger, config, limiter, id, jobhost, jobport, error, killswitch):
 
@@ -210,7 +208,7 @@ class ComputeJob(object):
                     "PYTHONPATH": os.environ.get('PYTHONPATH'),
                     "LD_LIBRARY_PATH": os.environ.get('LD_LIBRARY_PATH')
                 },
-                arguments=[id, jobhost, jobport]
+                arguments = [id, jobhost, jobport]
             )
             # Wait for process to finish. In the meantime, if the killswitch
             # is set (by an exception in the main thread), forcibly kill our
@@ -238,8 +236,6 @@ class ComputeJob(object):
             )
             error.set()
         self.results['returncode'] = process.returncode
-        logger.debug("compute.dispatch results job {0}: {1}".format(
-                    self.id, self.results))
         return process.returncode
 
 def threadwatcher(threadpool, logger, killswitch):
@@ -281,7 +277,7 @@ class RemoteCommandRecipeMixIn(object):
     """
     Mix-in for recipes to dispatch jobs using the remote command mechanism.
     """
-    def _schedule_jobs(self, jobs, max_per_node=None):
+    def _schedule_jobs(self, jobs, max_per_node = None):
         """
         Schedule a series of compute jobs. Blocks until completion.
 
@@ -304,8 +300,8 @@ class RemoteCommandRecipeMixIn(object):
                 jobpool[job_id] = job
                 threadpool.append(
                     threading.Thread(
-                        target=job.dispatch,
-                        args=(
+                        target = job.dispatch,
+                        args = (
                             self.logger, self.config, limiter, job_id,
                             jobhost, jobport, self.error, killswitch
                         )
diff --git a/CEP/Pipeline/framework/lofarpipe/support/utilities.py b/CEP/Pipeline/framework/lofarpipe/support/utilities.py
index 931cb014932f5d69c0a0fdb7958adeb2ef68cb79..32a827d0baa3bb2a9a6f0eed0419a7755ba3fd93 100644
--- a/CEP/Pipeline/framework/lofarpipe/support/utilities.py
+++ b/CEP/Pipeline/framework/lofarpipe/support/utilities.py
@@ -9,6 +9,7 @@
 
 from __future__ import with_statement
 
+from subprocess import Popen, CalledProcessError, PIPE
 from itertools import islice, repeat, chain, izip
 from contextlib import closing, contextmanager
 from time import sleep
@@ -18,14 +19,7 @@ import warnings
 import os
 import errno
 import shutil
-import sys
-
-try:
-    import subprocess27 as subprocess
-    print >> sys.stderr, __file__, ": Using Python 2.7 subprocess module!"
-except ImportError:
-    import subprocess
-    print >> sys.stderr, __file__, ": Using default subprocess module!"
+import subprocess
 
 from lofarpipe.support.pipelinelogging import log_process_output
 
@@ -92,7 +86,7 @@ def disk_usage(*paths):
     Return the disk usage in bytes by the file(s) in ``paths``.
     """
     cmd = ['du', '-s', '-b']
-    proc = subprocess.Popen(cmd + list(paths), stdout = subprocess.PIPE)
+    proc = Popen(cmd + list(paths), stdout = PIPE)
     sout = proc.communicate()[0]
     if sout:
         return sum([int(s.split('\t')[0]) for s in sout.strip().split('\n')])
@@ -230,8 +224,8 @@ def spawn_process(cmd, logger, cwd = None, env = None, max_tries = 2, max_timeou
         logger.debug(
             "Spawning subprocess: cmd=%s, cwd=%s, env=%s" % (cmd, cwd, env))
         try:
-            process = subprocess.Popen(
-                cmd, cwd = cwd, env = env, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE
+            process = Popen(
+                cmd, cwd = cwd, env = env, stdin = PIPE, stdout = PIPE, stderr = PIPE
             )
         except OSError, e:
             logger.warn(
@@ -273,10 +267,10 @@ def catch_segfaults(cmd, cwd, env, logger, max = 1, cleanup = lambda: None):
             tries += 1
             continue
         else:
-            raise subprocess.CalledProcessError(
+            raise CalledProcessError(
                 process.returncode, cmd[0]
             )
     if tries > max:
         logger.error("Too many segfaults from %s; aborted" % (cmd[0]))
-        raise subprocess.CalledProcessError(process.returncode, cmd[0])
+        raise CalledProcessError(process.returncode, cmd[0])
     return process
diff --git a/CEP/Pipeline/framework/lofarpipe/support/xmllogging.py b/CEP/Pipeline/framework/lofarpipe/support/xmllogging.py
index 787fcccc22004d3cba2f7f4484da9e912ee6f743..fe6c7efbe150454115353042e59edc18ef4d5f03 100644
--- a/CEP/Pipeline/framework/lofarpipe/support/xmllogging.py
+++ b/CEP/Pipeline/framework/lofarpipe/support/xmllogging.py
@@ -51,7 +51,7 @@ def enter_active_stack(calling_object, child,
     functionality.
     If the function is called on a class with an active_stack already present
     a nested node is added.
-    The current nesting is book kept in the active stack. Past calls are
+    The current nesting is bookkeeped in the active stack. Past calls are
     saved for logging purposes.
     The comment argument allows adding extra info to a node
     """
diff --git a/CEP/Pipeline/recipes/sip/bin/calibration_pipeline.py b/CEP/Pipeline/recipes/sip/bin/calibration_pipeline.py
index 46a64a916dd5ef3a6ee7c57bc493ed51462783fa..a469008c490315e3d56ea8982428fc11aa22b3b3 100644
--- a/CEP/Pipeline/recipes/sip/bin/calibration_pipeline.py
+++ b/CEP/Pipeline/recipes/sip/bin/calibration_pipeline.py
@@ -14,7 +14,6 @@ from lofarpipe.support.group_data import validate_data_maps, tally_data_map
 from lofarpipe.support.lofarexceptions import PipelineException
 from lofarpipe.support.utilities import create_directory
 from lofar.parameterset import parameterset
-from lofarpipe.support.loggingdecorators import mail_log_on_exception, duration
 
 class calibration_pipeline(control):
     """
@@ -30,7 +29,7 @@ class calibration_pipeline(control):
     4. Create a sourcedb from the user-supplied sky model, and an empty parmdb.
     5. Run BBS to calibrate the data.
     """
-
+    
     def __init__(self):
         super(calibration_pipeline, self).__init__()
         self.parset = parameterset()
@@ -137,7 +136,7 @@ class calibration_pipeline(control):
         # Call the base-class's `go()` method.
         return super(calibration_pipeline, self).go()
 
-    @mail_log_on_exception
+
     def pipeline_logic(self):
         """
         Define the individual tasks that comprise the current pipeline.
@@ -174,12 +173,10 @@ class calibration_pipeline(control):
 
         # *********************************************************************
         # 2. Create VDS-file; it will contain important input-data for NDPPP
-        with duration(self, "vdsmaker"):
-            gvds_file = self.run_task("vdsmaker", input_data_mapfile)['gvds']
+        gvds_file = self.run_task("vdsmaker", input_data_mapfile)['gvds']
 
         # Read metadata (start, end times, pointing direction) from GVDS.
-        with duration(self, "vdsreader"):
-            vdsinfo = self.run_task("vdsreader", gvds=gvds_file)
+        vdsinfo = self.run_task("vdsreader", gvds=gvds_file)
 
         # *********************************************************************
         # 3. Average and flag data, using NDPPP.
@@ -187,12 +184,11 @@ class calibration_pipeline(control):
         py_parset.makeSubset('DPPP.').writeFile(ndppp_parset)
 
         # Run the Default Pre-Processing Pipeline (DPPP);
-        with duration(self, "ndppp"):
-            dppp_mapfile = self.run_task("ndppp",
-                input_data_mapfile,
-                data_start_time=vdsinfo['start_time'],
-                data_end_time=vdsinfo['end_time'],
-                parset=ndppp_parset)['mapfile']
+        dppp_mapfile = self.run_task("ndppp",
+            input_data_mapfile,
+            data_start_time=vdsinfo['start_time'],
+            data_end_time=vdsinfo['end_time'],
+            parset=ndppp_parset)['mapfile']
 
         # *********************************************************************
         # 4. Create a sourcedb from the user-supplied sky model, 
@@ -211,16 +207,15 @@ class calibration_pipeline(control):
             )
         if not os.path.isfile(skymodel):
             raise PipelineException("Skymodel %s does not exist" % skymodel)
-        with duration(self, "setupsourcedb"):
-            sourcedb_mapfile = self.run_task(
-                "setupsourcedb", dppp_mapfile,
-                skymodel=skymodel
-            )['mapfile']
 
-        with duration(self, "setupparmdb"):
-            parmdb_mapfile = self.run_task(
-                "setupparmdb", dppp_mapfile
-            )['mapfile']
+        sourcedb_mapfile = self.run_task(
+            "setupsourcedb", dppp_mapfile, 
+            skymodel=skymodel
+        )['mapfile']
+
+        parmdb_mapfile = self.run_task(
+            "setupparmdb", dppp_mapfile
+        )['mapfile']
 
         # *********************************************************************
         # 5. Run BBS to calibrate the data.
@@ -228,15 +223,13 @@ class calibration_pipeline(control):
         # Create a parameter subset for BBS
         bbs_parset = os.path.join(parset_dir, "BBS.parset")
         py_parset.makeSubset('BBS.').writeFile(bbs_parset)
-        with duration(self, "bbs_reducer"):
-            self.run_task("bbs_reducer",
-                (dppp_mapfile, output_data_mapfile),
-                parset=bbs_parset,
-                instrument_mapfile=parmdb_mapfile,
-                sky_mapfile=sourcedb_mapfile
-            )
 
-        return 0
+        self.run_task("bbs_reducer",
+            (dppp_mapfile, output_data_mapfile),
+            parset=bbs_parset,
+            instrument_mapfile=parmdb_mapfile,
+            sky_mapfile=sourcedb_mapfile
+        )
 
 
 if __name__ == '__main__':
diff --git a/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py
index 1a30f32d1974b467e9cb002d1064e0f63d1a5507..364237d89377cf6936db96e564b1e4beea3ce779 100755
--- a/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py
+++ b/CEP/Pipeline/recipes/sip/bin/msss_calibrator_pipeline.py
@@ -15,7 +15,6 @@ from lofarpipe.support.data_map import DataMap
 from lofarpipe.support.data_map import validate_data_maps#, tally_data_map
 from lofarpipe.support.utilities import create_directory
 from lofar.parameterset import parameterset
-from lofarpipe.support.loggingdecorators import mail_log_on_exception, duration
 
 
 class msss_calibrator_pipeline(control):
@@ -150,7 +149,7 @@ class msss_calibrator_pipeline(control):
         # Call the base-class's `go()` method.
         return super(msss_calibrator_pipeline, self).go()
 
-    @mail_log_on_exception
+
     def pipeline_logic(self):
         """
         Define the individual tasks that comprise the current pipeline.
@@ -178,7 +177,9 @@ class msss_calibrator_pipeline(control):
         # Write input- and output data map-files
         data_mapfile = os.path.join(mapfile_dir, "data.mapfile")
         self.input_data.save(data_mapfile)
+#        self._store_data_map(data_mapfile, self.input_data, "inputs")
         instrument_mapfile = os.path.join(mapfile_dir, "instrument.mapfile")
+#        self._store_data_map(instrument_mapfile, self.output_data, "output")
         self.output_data.save(instrument_mapfile)
 
         if len(self.input_data) == 0:
@@ -193,34 +194,30 @@ class msss_calibrator_pipeline(control):
         #    sourcedb, For skymodel (A-team)
         #    parmdb for outputtting solutions
         # Produce a GVDS file describing the data on the compute nodes.
-        with duration(self, "vdsmaker"):
-            gvds_file = self.run_task("vdsmaker", data_mapfile)['gvds']
+        gvds_file = self.run_task("vdsmaker", data_mapfile)['gvds']
 
         # Read metadata (start, end times, pointing direction) from GVDS.
-        with duration(self, "vdsreader"):
-            vdsinfo = self.run_task("vdsreader", gvds=gvds_file)
+        vdsinfo = self.run_task("vdsreader", gvds=gvds_file)
 
         # Create an empty parmdb for DPPP
-        with duration(self, "setupparmdb"):
-            parmdb_mapfile = self.run_task(
-                "setupparmdb", data_mapfile,
-                mapfile=os.path.join(mapfile_dir, 'dppp.parmdb.mapfile'),
-                suffix='.dppp.parmdb')['mapfile']
+        parmdb_mapfile = self.run_task(
+            "setupparmdb", data_mapfile,
+            mapfile=os.path.join(mapfile_dir, 'dppp.parmdb.mapfile'),
+            suffix='.dppp.parmdb')['mapfile']
 
         # Create a sourcedb to be used by the demixing phase of DPPP
         # The path to the A-team sky model is currently hard-coded.
         # Run makesourcedb on skymodel files for calibrator source(s) and the
         # Ateam, which are to be stored in a standard place ($LOFARROOT/share)
-        with duration(self, "setupsourcedb"):
-            sourcedb_mapfile = self.run_task(
-                "setupsourcedb", data_mapfile,
-                skymodel=os.path.join(
-                    self.config.get('DEFAULT', 'lofarroot'),
-                    'share', 'pipeline', 'skymodels', 'Ateam_LBA_CC.skymodel'),
-                                             # TODO: LBA skymodel!! 
-                mapfile=os.path.join(mapfile_dir, 'dppp.sourcedb.mapfile'),
-                suffix='.dppp.sourcedb',
-                type='blob')['mapfile']
+        sourcedb_mapfile = self.run_task(
+            "setupsourcedb", data_mapfile,
+            skymodel=os.path.join(
+                self.config.get('DEFAULT', 'lofarroot'),
+                'share', 'pipeline', 'skymodels', 'Ateam_LBA_CC.skymodel'),
+                                         # TODO: LBA skymodel!! 
+            mapfile=os.path.join(mapfile_dir, 'dppp.sourcedb.mapfile'),
+            suffix='.dppp.sourcedb',
+            type='blob')['mapfile']
 
         # *********************************************************************
         # 3. Run NDPPP to demix the A-Team sources
@@ -230,14 +227,13 @@ class msss_calibrator_pipeline(control):
         py_parset.makeSubset('DPPP.').writeFile(ndppp_parset)
 
         # Run the Default Pre-Processing Pipeline (DPPP);
-        with duration(self, "ndppp"):
-            dppp_mapfile = self.run_task("ndppp",
-                data_mapfile,
-                data_start_time=vdsinfo['start_time'],
-                data_end_time=vdsinfo['end_time'],
-                parset=ndppp_parset,
-                parmdb_mapfile=parmdb_mapfile,
-                sourcedb_mapfile=sourcedb_mapfile)['mapfile']
+        dppp_mapfile = self.run_task("ndppp",
+            data_mapfile,
+            data_start_time=vdsinfo['start_time'],
+            data_end_time=vdsinfo['end_time'],
+            parset=ndppp_parset,
+            parmdb_mapfile=parmdb_mapfile,
+            sourcedb_mapfile=sourcedb_mapfile)['mapfile']
 
         demix_mapfile = dppp_mapfile
 
@@ -254,63 +250,54 @@ class msss_calibrator_pipeline(control):
         #    Create sourcedb with known calibration solutions
         #    Run bbs with both
         # Create an empty parmdb for BBS
-        with duration(self, "setupparmdb"):
-            parmdb_mapfile = self.run_task(
-                "setupparmdb", data_mapfile,
-                mapfile=os.path.join(mapfile_dir, 'bbs.parmdb.mapfile'),
-                suffix='.bbs.parmdb')['mapfile']
+        parmdb_mapfile = self.run_task(
+            "setupparmdb", data_mapfile,
+            mapfile=os.path.join(mapfile_dir, 'bbs.parmdb.mapfile'),
+            suffix='.bbs.parmdb')['mapfile']
+
 
         # Create a sourcedb based on sourcedb's input argument "skymodel"
-        with duration(self, "setupsourcedb"):
-            sourcedb_mapfile = self.run_task(
-                "setupsourcedb", data_mapfile,
-                skymodel=os.path.join(
-                    self.config.get('DEFAULT', 'lofarroot'),
-                    'share', 'pipeline', 'skymodels',
-                    py_parset.getString('Calibration.CalibratorSource') +
-                        '.skymodel'),
-                mapfile=os.path.join(mapfile_dir, 'bbs.sourcedb.mapfile'),
-                suffix='.bbs.sourcedb')['mapfile']
+        sourcedb_mapfile = self.run_task(
+            "setupsourcedb", data_mapfile,
+            skymodel=os.path.join(
+                self.config.get('DEFAULT', 'lofarroot'),
+                'share', 'pipeline', 'skymodels',
+                py_parset.getString('Calibration.CalibratorSource') +
+                    '.skymodel'),
+            mapfile=os.path.join(mapfile_dir, 'bbs.sourcedb.mapfile'),
+            suffix='.bbs.sourcedb')['mapfile']
 
         # Create a parameter-subset for BBS and write it to file.
         bbs_parset = os.path.join(parset_dir, "BBS.parset")
         py_parset.makeSubset('BBS.').writeFile(bbs_parset)
 
         # Run BBS to calibrate the calibrator source(s).
-        with duration(self, "bbs_reducer"):
-            self.run_task("bbs_reducer",
-                dppp_mapfile,
-                parset=bbs_parset,
-                instrument_mapfile=parmdb_mapfile,
-                sky_mapfile=sourcedb_mapfile)
+        self.run_task("bbs_reducer",
+            dppp_mapfile,
+            parset=bbs_parset,
+            instrument_mapfile=parmdb_mapfile,
+            sky_mapfile=sourcedb_mapfile)
 
         # *********************************************************************
         # 5. Perform gain outlier correction on the found calibration solutions
         #    Swapping outliers in the gains with the median 
         # Export the calibration solutions using gainoutliercorrection and store
         # the results in the files specified in the instrument mapfile.
-        export_instrument_model = py_parset.getBool(
-            'Calibration.exportCalibrationParameters', False)
-
-        with duration(self, "gainoutliercorrection"):
-            self.run_task("gainoutliercorrection",
+        self.run_task("gainoutliercorrection",
                       (parmdb_mapfile, instrument_mapfile),
-                      sigma=1.0,
-                      export_instrument_model=export_instrument_model) # TODO: Parset parameter
+                      sigma=1.0) # TODO: Parset parameter
 
         # *********************************************************************
         # 6. Create feedback file for further processing by the LOFAR framework
         # (MAC)
         # Create a parset-file containing the metadata for MAC/SAS
-        with duration(self, "get_metadata"):
-            self.run_task("get_metadata", instrument_mapfile,
-                parset_file=self.parset_feedback_file,
-                parset_prefix=(
-                    self.parset.getString('prefix') +
-                    self.parset.fullModuleName('DataProducts')),
-                product_type="InstrumentModel")
-
-        return 0
+        self.run_task("get_metadata", instrument_mapfile,
+            parset_file=self.parset_feedback_file,
+            parset_prefix=(
+                self.parset.getString('prefix') +
+                self.parset.fullModuleName('DataProducts')),
+            product_type="InstrumentModel")
+
 
 if __name__ == '__main__':
     sys.exit(msss_calibrator_pipeline().main())
diff --git a/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py b/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py
index e3674e949a7e833fb5dbb21ff5273773b13be22b..b3ebbaebbc36c3d6f42e023e22b6c79d2b01d042 100755
--- a/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py
+++ b/CEP/Pipeline/recipes/sip/bin/msss_target_pipeline.py
@@ -16,8 +16,6 @@ from lofarpipe.support.data_map import DataMap, validate_data_maps
 #from lofarpipe.support.group_data import tally_data_map
 from lofarpipe.support.utilities import create_directory
 from lofar.parameterset import parameterset
-from lofarpipe.support.loggingdecorators import mail_log_on_exception, duration
-
 
 class msss_target_pipeline(control):
     """
@@ -209,8 +207,8 @@ class msss_target_pipeline(control):
         # need to be updated these to reflect this.
         self.input_data['instrument'] = DataMap.load(copied_instruments_mapfile)
         for data, inst, outp in zip(
-            self.input_data['data'],
-            self.input_data['instrument'],
+            self.input_data['data'], 
+            self.input_data['instrument'], 
             self.output_data['data']
         ):
             data.skip = inst.skip = outp.skip = (
@@ -238,7 +236,6 @@ class msss_target_pipeline(control):
         return super(msss_target_pipeline, self).go()
 
 
-    @mail_log_on_exception
     def pipeline_logic(self):
         """
         Define the individual tasks that comprise the current pipeline.
@@ -301,27 +298,23 @@ class msss_target_pipeline(control):
         #    sourcedb, For skymodel (A-team)
         #    parmdb for outputtting solutions
         # Produce a GVDS file describing the data on the compute nodes.
-        with duration(self, "vdsmaker"):
-            gvds_file = self.run_task("vdsmaker", data_mapfile)['gvds']
+        gvds_file = self.run_task("vdsmaker", data_mapfile)['gvds']
 
         # Read metadata (e.g., start- and end-time) from the GVDS file.
-        with duration(self, "vdsreader"):
-            vdsinfo = self.run_task("vdsreader", gvds=gvds_file)
+        vdsinfo = self.run_task("vdsreader", gvds=gvds_file)
 
         # Create an empty parmdb for DPPP
-        with duration(self, "setupparmdb"):
-            parmdb_mapfile = self.run_task("setupparmdb", data_mapfile)['mapfile']
+        parmdb_mapfile = self.run_task("setupparmdb", data_mapfile)['mapfile']
 
         # Create a sourcedb to be used by the demixing phase of DPPP
         # The path to the A-team sky model is currently hard-coded.
-        with duration(self, "setupsourcedb"):
-            sourcedb_mapfile = self.run_task(
-                "setupsourcedb", data_mapfile,
-                skymodel=os.path.join(
-                    self.config.get('DEFAULT', 'lofarroot'),
-                    'share', 'pipeline', 'skymodels', 'Ateam_LBA_CC.skymodel'
-                )
-            )['mapfile']
+        sourcedb_mapfile = self.run_task(
+            "setupsourcedb", data_mapfile,
+            skymodel=os.path.join(
+                self.config.get('DEFAULT', 'lofarroot'),
+                'share', 'pipeline', 'skymodels', 'Ateam_LBA_CC.skymodel'
+            )
+        )['mapfile']
 
         # *********************************************************************
         # 4. Run NDPPP to demix the A-Team sources
@@ -330,16 +323,15 @@ class msss_target_pipeline(control):
         py_parset.makeSubset('DPPP[0].').writeFile(ndppp_parset)
 
         # Run the Default Pre-Processing Pipeline (DPPP);
-        with duration(self, "ndppp"):
-            dppp_mapfile = self.run_task("ndppp",
-                data_mapfile,
-                data_start_time=vdsinfo['start_time'],
-                data_end_time=vdsinfo['end_time'],
-                parset=ndppp_parset,
-                parmdb_mapfile=parmdb_mapfile,
-                sourcedb_mapfile=sourcedb_mapfile,
-                mapfile=os.path.join(mapfile_dir, 'dppp[0].mapfile')
-            )['mapfile']
+        dppp_mapfile = self.run_task("ndppp",
+            data_mapfile,
+            data_start_time=vdsinfo['start_time'],
+            data_end_time=vdsinfo['end_time'],
+            parset=ndppp_parset,
+            parmdb_mapfile=parmdb_mapfile,
+            sourcedb_mapfile=sourcedb_mapfile,
+            mapfile=os.path.join(mapfile_dir, 'dppp[0].mapfile')
+        )['mapfile']
 
 #        demix_mapfile = dppp_mapfile
 #        # Demix the relevant A-team sources
@@ -348,23 +340,21 @@ class msss_target_pipeline(control):
         # ********************************************************************
         # 5. Run bss using the instrument file from the target observation
         # Create an empty sourcedb for BBS
-        with duration(self, "setupsourcedb"):
-            sourcedb_mapfile = self.run_task(
-                "setupsourcedb", data_mapfile
-            )['mapfile']
+        sourcedb_mapfile = self.run_task(
+            "setupsourcedb", data_mapfile
+        )['mapfile']
 
         # Create a parameter-subset for BBS and write it to file.
         bbs_parset = os.path.join(parset_dir, "BBS.parset")
         py_parset.makeSubset('BBS.').writeFile(bbs_parset)
 
         # Run BBS to calibrate the target source(s).
-        with duration(self, "bbs_reducer"):
-            bbs_mapfile = self.run_task("bbs_reducer",
-                dppp_mapfile,
-                parset=bbs_parset,
-                instrument_mapfile=copied_instrument_mapfile,
-                sky_mapfile=sourcedb_mapfile
-            )['data_mapfile']
+        bbs_mapfile = self.run_task("bbs_reducer",
+            dppp_mapfile,
+            parset=bbs_parset,
+            instrument_mapfile=copied_instrument_mapfile,
+            sky_mapfile=sourcedb_mapfile
+        )['data_mapfile']
 
         # *********************************************************************
         # 6. Second dppp run for  flaging NaN's in the MS.  
@@ -376,28 +366,24 @@ class msss_target_pipeline(control):
         # results in the files specified in the corrected data map-file
         # WARNING: This will create a new MS with a DATA column containing the
         # CORRECTED_DATA column of the original MS.
-        with duration(self, "ndppp"):
-            self.run_task("ndppp",
-                (bbs_mapfile, corrected_mapfile),
-                clobber=False,
-                suffix='',
-                parset=ndppp_parset,
-                mapfile=os.path.join(mapfile_dir, 'dppp[1].mapfile')
-            )
+        self.run_task("ndppp",
+            (bbs_mapfile, corrected_mapfile),
+            clobber=False,
+            suffix='',
+            parset=ndppp_parset,
+            mapfile=os.path.join(mapfile_dir, 'dppp[1].mapfile')
+        )
 
         # 7. Create feedback file for further processing by the LOFAR framework
         # (MAC)
         # Create a parset-file containing the metadata for MAC/SAS
-        with duration(self, "get_metadata"):
-            self.run_task("get_metadata", corrected_mapfile,
-                parset_file=self.parset_feedback_file,
-                parset_prefix=(
-                    self.parset.getString('prefix') +
-                    self.parset.fullModuleName('DataProducts')
-                ),
-                product_type="Correlated")
-
-        return 0
+        self.run_task("get_metadata", corrected_mapfile,
+            parset_file=self.parset_feedback_file,
+            parset_prefix=(
+                self.parset.getString('prefix') +
+                self.parset.fullModuleName('DataProducts')
+            ),
+            product_type="Correlated")
 
 
 if __name__ == '__main__':
diff --git a/CEP/Pipeline/recipes/sip/bin/preprocessing_pipeline.py b/CEP/Pipeline/recipes/sip/bin/preprocessing_pipeline.py
index 4cadbf9dd0e9d15b3be8169285067e5b4c600065..4f0a1f15335f0a0478abf2695db7c95ee42e853d 100644
--- a/CEP/Pipeline/recipes/sip/bin/preprocessing_pipeline.py
+++ b/CEP/Pipeline/recipes/sip/bin/preprocessing_pipeline.py
@@ -14,7 +14,6 @@ from lofarpipe.support.group_data import validate_data_maps, tally_data_map
 from lofarpipe.support.lofarexceptions import PipelineException
 from lofarpipe.support.utilities import create_directory
 from lofar.parameterset import parameterset
-from lofarpipe.support.loggingdecorators import mail_log_on_exception, duration
 
 class preprocessing_pipeline(control):
     """
@@ -27,7 +26,7 @@ class preprocessing_pipeline(control):
     2. Create VDS-file; it will contain important input-data for NDPPP
     3. Average and flag data, and demix A-team sources using NDPPP.
     """
-
+    
     def __init__(self):
         super(preprocessing_pipeline, self).__init__()
         self.parset = parameterset()
@@ -111,7 +110,7 @@ class preprocessing_pipeline(control):
                 )
             )
 
-    @mail_log_on_exception
+
     def go(self):
         """
         Read the parset-file that was given as input argument;
@@ -171,28 +170,22 @@ class preprocessing_pipeline(control):
 
         # *********************************************************************
         # 2. Create VDS-file; it will contain important input-data for NDPPP
-        with duration(self, "vdsmaker"):
-            gvds_file = self.run_task("vdsmaker", input_data_mapfile)['gvds']
+        gvds_file = self.run_task("vdsmaker", input_data_mapfile)['gvds']
 
         # Read metadata (start, end times, pointing direction) from GVDS.
-        with duration(self, "vdsreader"):
-            vdsinfo = self.run_task("vdsreader", gvds=gvds_file)
+        vdsinfo = self.run_task("vdsreader", gvds=gvds_file)
 
         # *********************************************************************
         # 3. Average and flag data, using NDPPP.
-
         ndppp_parset = os.path.join(parset_dir, "NDPPP.parset")
         py_parset.makeSubset('DPPP.').writeFile(ndppp_parset)
 
         # Run the Default Pre-Processing Pipeline (DPPP);
-        with duration(self, "ndppp"):
-            self.run_task("ndppp",
-                (input_data_mapfile, output_data_mapfile),
-                data_start_time=vdsinfo['start_time'],
-                data_end_time=vdsinfo['end_time'],
-                parset=ndppp_parset)
-
-        return 0
+        self.run_task("ndppp",
+            (input_data_mapfile, output_data_mapfile),
+            data_start_time=vdsinfo['start_time'],
+            data_end_time=vdsinfo['end_time'],
+            parset=ndppp_parset)
 
 
 if __name__ == '__main__':
diff --git a/CEP/Pipeline/recipes/sip/master/gainoutliercorrection.py b/CEP/Pipeline/recipes/sip/master/gainoutliercorrection.py
index 8fb0d4d0415aa3448ad46d264ab1235782617d74..fdf431ead01e0ec4fc1bd094afcfa8b9440b57c0 100644
--- a/CEP/Pipeline/recipes/sip/master/gainoutliercorrection.py
+++ b/CEP/Pipeline/recipes/sip/master/gainoutliercorrection.py
@@ -7,7 +7,7 @@
 from __future__ import with_statement
 import os
 import sys
-import copy
+
 import lofarpipe.support.lofaringredient as ingredient
 
 from lofarpipe.support.baserecipe import BaseRecipe
@@ -62,12 +62,7 @@ class gainoutliercorrection(BaseRecipe, RemoteCommandRecipeMixIn):
         'sigma': ingredient.FloatField(
             '--sigma',
             default=1.0,
-            help="Clip at sigma * median: (not used by parmexportcal"
-        ),
-        'export_instrument_model': ingredient.FloatField(
-            '--use-parmexportcal',
-            default=False,
-            help="Select between parmexportcal and edit parmdb"
+            help="Clip at sigma * median: activates 'edit_parmdb' functionality"
         )
     }
 
@@ -111,7 +106,7 @@ class gainoutliercorrection(BaseRecipe, RemoteCommandRecipeMixIn):
                 item.file = os.path.join(
                     self.inputs['working_directory'],
                     self.inputs['job_name'],
-                    (os.path.splitext(os.path.basename(item.file))[0] +
+                    (os.path.splitext(os.path.basename(infile))[0] +
                      self.inputs['suffix'])
                 )
 
@@ -119,7 +114,7 @@ class gainoutliercorrection(BaseRecipe, RemoteCommandRecipeMixIn):
         # these maps, then 'skip' must be set to True in all maps.
         for x, y in zip(indata, outdata):
             x.skip = y.skip = (x.skip or y.skip)
-
+            
         # ********************************************************************
         # 3. Call node side of the recipe
         command = "python %s" % (self.__file__.replace('master', 'nodes'))
@@ -135,8 +130,7 @@ class gainoutliercorrection(BaseRecipe, RemoteCommandRecipeMixIn):
                         outp.file,
                         self.inputs['executable'],
                         self.environment,
-                        self.inputs['sigma'],
-                        self.inputs['export_instrument_model']
+                        self.inputs['sigma']
                      ]
                 )
             )
diff --git a/CEP/Pipeline/recipes/sip/master/imager_finalize.py b/CEP/Pipeline/recipes/sip/master/imager_finalize.py
index d551a7745e3ffc516a1b89d6b14f7eacc47d3226..a2409902505dada9138427a19b1f20ebd55cd196 100644
--- a/CEP/Pipeline/recipes/sip/master/imager_finalize.py
+++ b/CEP/Pipeline/recipes/sip/master/imager_finalize.py
@@ -181,12 +181,11 @@ class imager_finalize(BaseRecipe, RemoteCommandRecipeMixIn):
         # *********************************************************************
         # 3. Validate the performance of the node script and assign output
         placed_images = []
-        for (job, output_image_item) in  zip(jobs, output_image_map_new):
+        for job in  jobs:
             if job.results.has_key("hdf5"):
                 placed_images.append(tuple([job.host, job.results["image"], False]))
             else:
-                # On failure on the node the file should be gotten from the input
-                placed_images.append(tuple([job.host, output_image_item.file, True]))
+                placed_images.append(tuple([job.host, job.results["image"], True]))
 
         if len(placed_images) == 0:
             self.logger.warn("Failed finalizer node run detected")
diff --git a/CEP/Pipeline/recipes/sip/master/setupparmdb.py b/CEP/Pipeline/recipes/sip/master/setupparmdb.py
index e887d33b1ddcdd3db8a9e5a7c51c0a5d1361a4cd..0931ec90e35776e10dece8d66690790fe92cbf6c 100644
--- a/CEP/Pipeline/recipes/sip/master/setupparmdb.py
+++ b/CEP/Pipeline/recipes/sip/master/setupparmdb.py
@@ -152,13 +152,7 @@ class setupparmdb(BaseRecipe, RemoteCommandRecipeMixIn):
                 )
             self._schedule_jobs(jobs, max_per_node=self.inputs['nproc'])
             for job, outp in zip(jobs, outdata):
-                # If the returncode is 123456, failing ssh
-                if job.results['returncode'] == 123456:
-                    self.logger.warning("ssh connection with {0} failed."
-                        "Skipping further work on this task".format(outp.host))
-                    self.logger.warning("Error code 123456.")
-                    outp.skip = True
-                elif job.results['returncode'] != 0:
+                if job.results['returncode'] != 0:
                     outp.skip = True
 
         # *********************************************************************
@@ -168,7 +162,7 @@ class setupparmdb(BaseRecipe, RemoteCommandRecipeMixIn):
             shutil.rmtree(pdbdir, ignore_errors=True)
 
         if self.error.isSet():
-            # Abort if all jobs failed
+             # Abort if all jobs failed
             if all(job.results['returncode'] != 0 for job in jobs):
                 self.logger.error("All jobs failed. Bailing out!")
                 return 1
diff --git a/CEP/Pipeline/recipes/sip/master/vdsmaker.py b/CEP/Pipeline/recipes/sip/master/vdsmaker.py
index 95af2e33541150cf34edfca5565f7997fab76fd5..6d000ba0f915871174867358b0f6a4799a8f521e 100644
--- a/CEP/Pipeline/recipes/sip/master/vdsmaker.py
+++ b/CEP/Pipeline/recipes/sip/master/vdsmaker.py
@@ -103,13 +103,9 @@ class vdsmaker(BaseRecipe, RemoteCommandRecipeMixIn):
                 )
             )
         self._schedule_jobs(jobs, max_per_node=self.inputs['nproc'])
-        vdsnames = [
-            vds for vds, job in zip(vdsnames, jobs) 
-            if job.results['returncode'] == 0
-        ]
-        if not vdsnames:
-            self.logger.error("All makevds processes failed. Bailing out!")
-            return 1
+        for idx, job in enumerate(jobs):
+            if job.results['returncode'] != 0:
+                del vdsnames[idx]
 
         # *********************************************************************
         # 3. Combine VDS files to produce GDS
diff --git a/CEP/Pipeline/recipes/sip/nodes/gainoutliercorrection.py b/CEP/Pipeline/recipes/sip/nodes/gainoutliercorrection.py
index 03ee5128f5900c996aa9e8756d7a13d8b08793f3..d5c0d0efaf88858ed6c8c0fa0697d5bef03f4dd5 100644
--- a/CEP/Pipeline/recipes/sip/nodes/gainoutliercorrection.py
+++ b/CEP/Pipeline/recipes/sip/nodes/gainoutliercorrection.py
@@ -11,6 +11,7 @@ import shutil
 import sys
 import tempfile
 import numpy
+import errno
 
 from lofarpipe.support.lofarnode import LOFARnodeTCP
 from lofarpipe.support.pipelinelogging import CatchLog4CPlus
@@ -30,52 +31,48 @@ class gainoutliercorrection(LOFARnodeTCP):
     Outliers in the gain are swapped with the median. resulting gains 
     are written back to the supplied ms:
     
-    1. Select correction correction method:
+    1. Select correction correction method
     2. Call parmexportcal for gain correction
     3. use gainoutliercorrect from Swinbank
        Step are summarized in the functions of this recipe
 
     """
-    def run(self, infile, outfile, executable, environment, sigma,
-            use_parmexportcal):
+    def run(self, infile, outfile, executable, environment, sigma):
         self.environment.update(environment)
-        if os.path.exists(infile):
-            self.logger.info("Processing {0}".format(infile))
-        else:
-            self.logger.error(
-                "Instrument model file %s does not exist" % infile
+        # Time execution of this job
+        with log_time(self.logger):
+            if os.path.exists(infile):
+                self.logger.info("Processing %s" % infile)
+            else:
+                self.logger.error(
+                    "Instrument model file %s does not exist" % infile
                 )
-            return 1
-
+                return 1
         # Create output directory (if it doesn't already exist)
         create_directory(os.path.dirname(outfile))
-
-        # Remove the target outfile if there: parexportcall fail otherwise
-        if os.path.exists(outfile):
-            shutil.rmtree(outfile)
-
         # ********************************************************************
         # 1. Select correction method
-        if not use_parmexportcal:
-            # ****************************************************************
-            # 3. use gainoutliercorrect from Swinbank
+        if not os.access(executable, os.X_OK) and sigma != None:
+            # If the executable is not accesable and we have a sigma:
+            # use the 'local' functionality (edit parmdb)
             self.logger.info(
-                "Using the gainoutlier correction based on editparmdb")
+                    "Using the gainoutlier correction based on edit_parmdb")
+
+        # *********************************************************************
+        # 3. use gainoutliercorrect from Swinbank
             self._filter_stations_parmdb(infile, outfile, sigma)
             return 0
 
-        # else:
+        # else we need an executable
+        # Check if exists and is executable.
         if not os.access(executable, os.X_OK):
-            self.logger.error(
-                "Could not find parmexport call executable at: {0}".format(
-                                    executable))
-            self.logger.error("bailing out!")
+            self.logger.error("Executable %s not found" % executable)
             return 1
 
         # ********************************************************************
         # 2. Call parmexportcal for gain correction
         self.logger.info(
-            "Using the gainoutlier correction based on parmexportcal")
+                    "Using the gainoutlier correction based on parmexportcal")
         try:
             temp_dir = tempfile.mkdtemp()
             with CatchLog4CPlus(
@@ -83,11 +80,8 @@ class gainoutliercorrection(LOFARnodeTCP):
                 self.logger.name + '.' + os.path.basename(infile),
                 os.path.basename(executable)
             ) as logger:
-                cmd = [executable, '-in', infile, '-out', outfile]
-                self.logger.debug(
-                    "Parmexportcal call: {0} ".format(" ".join(cmd)))
                 catch_segfaults(
-                    cmd,
+                    [executable, '-in', infile, '-out', outfile],
                     temp_dir,
                     self.environment,
                     logger
diff --git a/CEP/Pipeline/recipes/sip/nodes/vdsmaker.py b/CEP/Pipeline/recipes/sip/nodes/vdsmaker.py
index 63d827f73343d6121d3ac9f473b4e90d51a114ba..6a5e3e7c0b87a0cfe83e69f13795f416be28132e 100644
--- a/CEP/Pipeline/recipes/sip/nodes/vdsmaker.py
+++ b/CEP/Pipeline/recipes/sip/nodes/vdsmaker.py
@@ -42,8 +42,6 @@ class vdsmaker(LOFARnodeTCP):
                 # For CalledProcessError isn't properly propagated by IPython
                 # Temporary workaround...
                 self.logger.error(str(e))
-                self.logger.info("A common cause for this failure is the usage"
-                       "of an incorrect cluster.desc file in the pipeline.cfg")
                 return 1
 
 
diff --git a/CEP/Pipeline/recipes/sip/tasks.cfg.in b/CEP/Pipeline/recipes/sip/tasks.cfg.in
index f0022552dcfc1177f4bcbd3a4ea68dc822bb1ab8..bb8d2472f7c0c8342f5c3ee6c7a0910e7144ce84 100644
--- a/CEP/Pipeline/recipes/sip/tasks.cfg.in
+++ b/CEP/Pipeline/recipes/sip/tasks.cfg.in
@@ -47,7 +47,7 @@ data_mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/bbs.mapfile
 
 [gainoutliercorrection]
 recipe = gainoutliercorrection
-executable = %(lofarroot)s/bin/parmexportcal
+executable = '' # Comment out the executable, for now use the  editparmdb behaviour. #%(lofarroot)s/bin/parmexportcal
 mapfile = %(runtime_directory)s/%(job_name)s/mapfiles/instrument.mapfile
 
 [rficonsole]
diff --git a/CEP/Pipeline/test/support/loggingdecorators_test.py b/CEP/Pipeline/test/support/loggingdecorators_test.py
index 54e29c9bbdbee380f2ecb2f54c65f16cd33e7748..51adf0436044fc8dd5b978dfba82088271fb752f 100644
--- a/CEP/Pipeline/test/support/loggingdecorators_test.py
+++ b/CEP/Pipeline/test/support/loggingdecorators_test.py
@@ -7,8 +7,8 @@ import numpy
 import tempfile
 import xml.dom.minidom as xml
 
-from lofarpipe.support.loggingdecorators import xml_node, duration
-from lofarpipe.support.xmllogging import get_child, get_active_stack
+from lofarpipe.support.loggingdecorators import xml_node
+from lofarpipe.support.xmllogging import get_child
 #imports from fixture:
 
 
@@ -43,6 +43,7 @@ class loggingdecoratorsTest(unittest.TestCase):
             an_object.active_stack, "test").getAttribute("duration")) <= 0.1,
             "The created active stack did not add the duration information")
 
+
     def test_xml_node_nested_timing_logging(self):
         """
         Test nested logging. The duration is variable. Test existance of 
@@ -70,6 +71,7 @@ class loggingdecoratorsTest(unittest.TestCase):
         self.assertTrue(float(child2.getAttribute("duration")) < 0.1,
                         "The duration was to large for the size of the test function")
 
+
     def test_xml_node_return_value(self):
         """
         assure that the return value of the decorated function is still correct
@@ -85,43 +87,4 @@ class loggingdecoratorsTest(unittest.TestCase):
         self.assertTrue(return_value == "a value" ,
                         "The decorated function did not return the actual function return value ")
 
-    def test_duration_context_manager(self):
-        """
-        Test that on entering the context with self the containing object
-        pointer is added. It should also continue to exist after leaving the
-        context
-        
-        """
-        class tester(object):
-            def __init__(self):
-                pass
-
-            def test(self):
-                if get_active_stack(tester) is not None:
-                    print "An active stack should only exist when added explicitly"
-                    return False
-
-                with duration(self, "a name") as context_object:
-                    active_stack = get_active_stack(self)
-                    # We should have an active stack in the context
-                    if active_stack is None:
-                        print "In duration context the active stack should be added."
-                        return False
-
-                    if not get_child(
-                        active_stack, "active_stack").hasChildNodes():
-                        print "in the context the active_stack should at least contain one entry"
-                        return False
-                    # Now leave the  context
-
-                if get_child(
-                        active_stack, "active_stack").hasChildNodes():
-                        print "After the context the active stack should be left"
-                        # There is stil an entry in the active stack
-                        return False
-
-                return True
-
-        test_object = tester()
-        self.assertTrue(test_object.test(), "The duration context returned with False")
 
diff --git a/CEP/Pipeline/test/test_framework/unittest_runner.py b/CEP/Pipeline/test/test_framework/unittest_runner.py
index ae60665e7bce5d84de9f512bb6b85c2f437e7f79..55a6aa8faf8a6bd81c96efc699ff7ff71f651814 100644
--- a/CEP/Pipeline/test/test_framework/unittest_runner.py
+++ b/CEP/Pipeline/test/test_framework/unittest_runner.py
@@ -103,6 +103,16 @@ class UnitTesterTest(unittest.TestCase):
         """
         self.assertTrue(self.tester == "A test string")
 
+    #@unittest.expectedFailure # decorator can be used from python 2.7
+    def test_daily_build_exists(self):
+        """
+        Performs a simple import to check if the daily is created
+        This sanity check only works on the CEP systems lhn001,2 and lce072. comment out on other systems
+        """
+        path = "/opt/cep/LofIm/daily/lofar/lofarinit.sh"
+        self.assertTrue(os.path.exists(path), "Daily build has failed:"
+                        " lofarinit.sh is missing!")
+
 
 def usage():
     """
diff --git a/CEP/PyBDSM/src/python/__init__.py b/CEP/PyBDSM/src/python/__init__.py
index 9552ee2bb0a4be381fee936dd71c08b5b7d156d4..e6b53202ead8503361be2061917064de8bd8f0ac 100644
--- a/CEP/PyBDSM/src/python/__init__.py
+++ b/CEP/PyBDSM/src/python/__init__.py
@@ -9,10 +9,20 @@ required by 'execute').
 """
 try:
     import matplotlib.pyplot as pl
-    has_pl = True
-except (RuntimeError, ImportError):
-    has_pl = False
-    print "\033[33;1mWARNING\033[0m: Matplotlib not found. Plotting is disabled."
+except RuntimeError:
+    # Set use of AGG backend to avoid problems when there
+    # is no DISPLAY variable set
+    import sys
+    modules = []
+    for module in sys.modules:
+        if module.startswith('matplotlib'):
+            modules.append(module)
+    for module in modules:
+        sys.modules.pop(module)
+    import matplotlib as mpl
+    mpl.use('Agg')
+except ImportError:
+    print "\033[31;1mWARNING\033[0m: Matplotlib not found. Plotting is disabled."
 
 from readimage import Op_readimage
 from collapse import Op_collapse
diff --git a/CEP/PyBDSM/src/python/_version.py b/CEP/PyBDSM/src/python/_version.py
index e097d58f7a56fe75ba12eb1e5f138d9de7b3eaad..7660c6dd0c8e4ed3f6364e0efb7338a1f9a28deb 100644
--- a/CEP/PyBDSM/src/python/_version.py
+++ b/CEP/PyBDSM/src/python/_version.py
@@ -27,12 +27,6 @@ def changelog():
     PyBDSM Changelog.
     -----------------------------------------------------------------------
 
-    2012/12/02 - Changes to reduce memory usage, particularly in the
-        wavelet module.
-
-    2012/11/30 - Fix to bypass bug in matplotlib when display variable
-        is not set.
-
     2012/11/21 - Fixed bug that caused a crash when a detection image
         was used. Fixed a bug with incorrect save directory when
         "plot_allgaus" is True.
diff --git a/CEP/PyBDSM/src/python/cleanup.py b/CEP/PyBDSM/src/python/cleanup.py
index 4c4ba636ce92080f5751e18fb8860511260cb0a8..5042a9940fda93667b599a368b0bd2a2c89cf3cf 100644
--- a/CEP/PyBDSM/src/python/cleanup.py
+++ b/CEP/PyBDSM/src/python/cleanup.py
@@ -6,10 +6,12 @@ import numpy as N
 import os
 from image import *
 import mylogger, os
-from . import has_pl
-if has_pl:
+try:
     import matplotlib.pyplot as pl
     import matplotlib.cm as cm
+    has_pl = True
+except ImportError:
+    has_pl = False
 import functions as func
 
 class Op_cleanup(Op):
diff --git a/CEP/PyBDSM/src/python/gausfit.py b/CEP/PyBDSM/src/python/gausfit.py
index 715bf578783eb23dd34db24558485314eb9d8ad7..0b27e19dd01b5c1e8a83aebfc96c3ccb2a2c0c34 100644
--- a/CEP/PyBDSM/src/python/gausfit.py
+++ b/CEP/PyBDSM/src/python/gausfit.py
@@ -19,9 +19,11 @@ import sys
 import time
 import statusbar
 import _cbdsm
-from . import has_pl
-if has_pl:
+try:
     import matplotlib.pyplot as pl
+    has_pl = True
+except ImportError:
+    has_pl = False
 import scipy.ndimage as nd
 import multi_proc as mp
 
diff --git a/CEP/PyBDSM/src/python/islands.py b/CEP/PyBDSM/src/python/islands.py
index b3e4c94b08d20d438552438e575fe80b32d35cca..ba0072f18f18c64bc8027c301bbc53ad508b0bf5 100644
--- a/CEP/PyBDSM/src/python/islands.py
+++ b/CEP/PyBDSM/src/python/islands.py
@@ -91,9 +91,9 @@ class Op_islands(Op):
             for i, isl in enumerate(img.islands):
                 isl.island_id = i
                 if i == 0:
-                    pyrank[isl.bbox] = N.invert(isl.mask_active) - 1
+                    pyrank[isl.bbox] = N.invert(isl.mask_active)-1
                 else:
-                    pyrank[isl.bbox] = N.invert(isl.mask_active) * i - isl.mask_active
+                    pyrank[isl.bbox] = N.invert(isl.mask_active)*i
 
             if opts.output_all: write_islands(img)
             if opts.savefits_rankim:
diff --git a/CEP/PyBDSM/src/python/multi_proc.py b/CEP/PyBDSM/src/python/multi_proc.py
index f4c348d6cd715ea060ce6ed6844ab76f65358b80..27364e2ef7da3a87bad9abdd29a466855f433f08 100644
--- a/CEP/PyBDSM/src/python/multi_proc.py
+++ b/CEP/PyBDSM/src/python/multi_proc.py
@@ -18,8 +18,7 @@ try:
     _multi=True
 
     # May raise NotImplementedError
-    _ncpus = min(multiprocessing.cpu_count(), 8)
-
+    _ncpus = multiprocessing.cpu_count()
 except:
     pass
 
diff --git a/CEP/PyBDSM/src/python/plotresults.py b/CEP/PyBDSM/src/python/plotresults.py
index 8a93f4a243de46dbbae42f3cdcfb9c5d2a0b70a9..f2956b98f759086a8624ae0bd1e4f6bdc3c55db7 100644
--- a/CEP/PyBDSM/src/python/plotresults.py
+++ b/CEP/PyBDSM/src/python/plotresults.py
@@ -3,8 +3,7 @@
 This module is used to display fits results.
 """
 from image import *
-from . import has_pl
-if has_pl:
+try:
     import matplotlib.pyplot as pl
     import matplotlib.cm as cm
     import matplotlib.patches as mpatches
@@ -12,6 +11,9 @@ if has_pl:
     from matplotlib.patches import Ellipse
     from matplotlib.lines import Line2D
     from matplotlib import collections
+    has_pl = True
+except ImportError:
+    has_pl = False
 from math import log10
 import functions as func
 from const import fwsig
diff --git a/CEP/PyBDSM/src/python/psf_vary.py b/CEP/PyBDSM/src/python/psf_vary.py
index 50052b809f8e2eb87cbbd37960c03164f9a48dd6..252e09f3d027fce62a4b88a52eb105602354c9a5 100644
--- a/CEP/PyBDSM/src/python/psf_vary.py
+++ b/CEP/PyBDSM/src/python/psf_vary.py
@@ -3,9 +3,11 @@ import numpy as N
 from image import *
 import mylogger
 from copy import deepcopy as cp
-from . import has_pl
-if has_pl:
+try:
     import matplotlib.pyplot as pl
+    has_pl = True
+except ImportError:
+    has_pl = False
 import scipy
 import scipy.signal as S
 import _cbdsm
diff --git a/CEP/PyBDSM/src/python/wavelet_atrous.py b/CEP/PyBDSM/src/python/wavelet_atrous.py
index 635fb65a7d871345e13c1f0c9f46f9a37497e490..3902ef21b6cd6b29cbabef168e3199a91704fc02 100644
--- a/CEP/PyBDSM/src/python/wavelet_atrous.py
+++ b/CEP/PyBDSM/src/python/wavelet_atrous.py
@@ -8,9 +8,11 @@ import numpy as N
 from image import *
 import mylogger
 import os
-from . import has_pl
-if has_pl:
+try:
     import matplotlib.pyplot as pl
+    has_pl = True
+except ImportError:
+    has_pl = False
 import _cbdsm
 from math import log, floor, sqrt
 import scipy.signal as S
@@ -189,8 +191,6 @@ class Op_wavelet_atrous(Op):
                         # Renumber islands:
                         for wvindx, wvisl in enumerate(wimg.islands):
                             wvisl.island_id = wvindx
-                        del orig_rankim_bool
-                        del valid_islands
 
                 if isinstance(op, Op_gaul2srl):
                   # Restrict Gaussians to original ch0 islands.
@@ -200,46 +200,36 @@ class Op_wavelet_atrous(Op):
                   if img.ngaus == 0:
                     gaus_id = -1
                   else:
-                      gaus_id = img.gaussians[-1].gaus_num
-#                   for isl in img.islands:
+                    gaus_id = img.gaussians[-1].gaus_num
+                  for isl in img.islands:
                       wvgaul = []
                       for g in gaul:
                           if not hasattr(g, 'valid'):
                               g.valid = False
                           if not g.valid:
-                              isl_id = img.pyrank[int(g.centre_pix[0] + 1), int(g.centre_pix[1] + 1)]
-                              if isl_id >= 0:
-                                  isl = img.islands[isl_id]
-                                  gcenter = (g.centre_pix[0] - isl.origin[0],
-                                             g.centre_pix[1] - isl.origin[1])
-#                               if gcenter[0] >= 0 and gcenter[0] < isl.shape[0] and gcenter[1] >= 0 and gcenter[1] < isl.shape[1]:
-#                                   if not isl.mask_active[gcenter]:
-#                                       gaus_id += 1
+                              gcenter = (g.centre_pix[0] - isl.origin[0],
+                                         g.centre_pix[1] - isl.origin[1])
+                              if gcenter[0] >= 0 and gcenter[0] < isl.shape[0] and gcenter[1] >= 0 and gcenter[1] < isl.shape[1]:
                                   if not isl.mask_active[gcenter]:
+                                      gaus_id += 1
                                       g.gaus_num = gaus_id
                                       g.wisland_id = g.island_id
                                       g.island_id = isl.island_id
                                       g.jlevel = j
                                       g.valid = True
-                                      isl.gaul.append(g)
-                                      isl.ngaus += 1
-                                      img.gaussians.append(g)
-                                      nwvgaus += 1
-                                      tot_flux += g.total_flux
-
-#                                  wvgaul.append(g)
+                                      wvgaul.append(g)
                                   else:
                                       g.valid = False
                                       g.jlevel = 0
                               else:
                                   g.valid = False
                                   g.jlevel = 0
-#                       isl.gaul += wvgaul
-#                       img.gaussians += wvgaul
-#                       nwvgaus += len(wvgaul)
-#                       isl.ngaus += nwvgaus
-#                       for g in wvgaul:
-#                           tot_flux += g.total_flux
+                      isl.gaul += wvgaul
+                      img.gaussians += wvgaul
+                      nwvgaus += len(wvgaul)
+                      isl.ngaus += nwvgaus
+                      for g in wvgaul:
+                          tot_flux += g.total_flux
 
                   vg = []
                   for g in wimg.gaussians:
@@ -270,10 +260,6 @@ class Op_wavelet_atrous(Op):
                       answ = raw_input_no_history(prompt)
               if len(wimg.gaussians) > 0:
                 img.resid_wavelets = self.subtract_wvgaus(img.opts, img.resid_wavelets, wimg.gaussians, wimg.islands)
-              wimg.gaussians = []
-              wimg.islands = []
-              wimg.sources = []
-              wimg.ch0 = None
               del wimg
               if stop_wav == True:
                   break
diff --git a/CMake/FindPVSS.cmake b/CMake/FindPVSS.cmake
index da4b64c8fb7251813e65c65f3db11aff2a9f6b44..d85eee3719f1addeb6c214f616888f9f53f7fdf3 100644
--- a/CMake/FindPVSS.cmake
+++ b/CMake/FindPVSS.cmake
@@ -72,20 +72,24 @@ if(NOT PVSS_FOUND)
   # Use hard-coded value if version information file cannot be found.
   find_file(PVSS_VERSINFO_MK
     NAMES VersInfo.mk
-    HINTS ${PVSS_ROOT_DIR}
-    PATH_SUFFIXES api)
+    HINTS ${PVSS_PROJ_DIR})
   mark_as_advanced(PVSS_VERSINFO_MK)
   if(NOT PVSS_VERSINFO_MK)
     set(pvss_version "V37_304")
+    set(PVSS_ROOT_DIR "/opt/pvss/pvss2_v3.7")
   else()
     file(STRINGS ${PVSS_VERSINFO_MK} match REGEX "^PVSS_VERSION_MAIN")
     string(REGEX REPLACE "^.*= *([^ ]+)$" "\\1" pvss_version_main ${match})
     file(STRINGS ${PVSS_VERSINFO_MK} match REGEX "^PVSS_VERSION_BUILD")
     string(REGEX REPLACE "^.*= *([^ ]+)$" "\\1" pvss_version_build ${match})
+    file(STRINGS ${PVSS_VERSINFO_MK} match REGEX "^PVSS_ROOT_DIR")
+    string(REGEX REPLACE "^.*= *([^ ]+)$" "\\1" pvss_root_dir ${match})
     set(pvss_version "V${pvss_version_main}_${pvss_version_build}")
-  endif(NOT PVSS_VERSINFO_MK)
 
-  message(STATUS "Searching for PVSS ${pvss_version}")
+    file(STRINGS ${PVSS_VERSINFO_MK} match REGEX "^PVSS_ROOT_DIR")
+    string(REGEX REPLACE "^.*= *([^ ]+)$" "\\1" pvss_root ${match})
+    set(PVSS_ROOT_DIR "${pvss_root}")
+  endif(NOT PVSS_VERSINFO_MK)
 
   # Search for the PVSS include directory
   find_path(PVSS_INCLUDE_DIR
@@ -101,7 +105,7 @@ if(NOT PVSS_FOUND)
     find_library(PVSS_${lib}_LIBRARY
       NAMES ${lib}${pvss_version}
       HINTS ${PVSS_ROOT_DIR}
-      PATH_SUFFIXES api/lib.${osname} bin)
+      PATH_SUFFIXES api/lib.${osname})
     list(APPEND pvss_check_list PVSS_${lib}_LIBRARY)
   endforeach(lib Manager Messages Datapoint Basics bcm)
 
diff --git a/CMake/LofarGeneral.cmake b/CMake/LofarGeneral.cmake
index 8b3d76537acbfd9eee7277da09d7409bb386e6a5..b72c4c4e76ce66a28b3526673926b4186671b401 100644
--- a/CMake/LofarGeneral.cmake
+++ b/CMake/LofarGeneral.cmake
@@ -126,18 +126,6 @@ if(NOT DEFINED LOFAR_GENERAL_INCLUDED)
       }" HAVE_GETPROTOBYNAME_R)
   endif(HAVE_NETDB_H)
 
-  ## --------------------------------------------------------------------------
-  ## Define `STRNLEN', if the strnlen() function exists.
-  ## --------------------------------------------------------------------------
-  check_c_source_compiles("
-    #include <string.h>
-    #include <stdio.h>
-    int main() {
-      char *s = \"test\";
-      int i = 3;
-      unsigned l = strnlen(s,i);
-    }" HAVE_STRNLEN)
-
   ## --------------------------------------------------------------------------
   ## Define custom target 'check', so that we can do 'make check', like we did
   ## with the GNU Autotools. Tests should be added with lofar_add_test().
diff --git a/CMake/LofarPackageList.cmake b/CMake/LofarPackageList.cmake
index 4fed0b79ac6ffc518e469a61dc46ad0b76bece57..14ba595ab797bd5cad9780eabcd9b16ffa31e193 100644
--- a/CMake/LofarPackageList.cmake
+++ b/CMake/LofarPackageList.cmake
@@ -104,7 +104,6 @@ if(NOT DEFINED LOFAR_PACKAGE_LIST_INCLUDED)
   set(Interface_SOURCE_DIR ${CMAKE_SOURCE_DIR}/RTCP/Interface)
   set(FCNP_SOURCE_DIR ${CMAKE_SOURCE_DIR}/RTCP/FCNP)
   set(CNProc_SOURCE_DIR ${CMAKE_SOURCE_DIR}/RTCP/CNProc)
-  set(InputProc_SOURCE_DIR ${CMAKE_SOURCE_DIR}/RTCP/InputProc)
   set(IONProc_SOURCE_DIR ${CMAKE_SOURCE_DIR}/RTCP/IONProc)
   set(Storage_SOURCE_DIR ${CMAKE_SOURCE_DIR}/RTCP/Storage)
   set(Run_SOURCE_DIR ${CMAKE_SOURCE_DIR}/RTCP/Run)
diff --git a/CMake/TODO b/CMake/TODO
index b6019b07c7304971e63bd297fa73cec3823adb45..c1966dd2b442a31b139d021f4374bee9a4b962fe 100644
--- a/CMake/TODO
+++ b/CMake/TODO
@@ -3,12 +3,6 @@
 =                       TODO - List of things to do                          =
 ==============================================================================
 
-* When not configuring explicitly for PyBDSM, a warning is printed that the
-  Fortran compiler could not be determined, which may cause trouble later on.
-  PyBDSM builds without problems, though. Probable cause: the Fortran
-  language is added too late to the CMake project, i.e. only after F2Py
-  searches for a suitable Fortran compiler.
-
 * Python byte-code compilation fails during install when using DESTDIR option
   to specify a different install directory.
 
@@ -32,6 +26,14 @@
   2) For every target, the library prefix must be cleared and an (additional)
      install directory -- python/site-packages -- must be added.
 
+* Use something like set_if_not_set() in the variants files for non-cached
+  CMake variables. Contrary to options, which are just cached variables of
+  type bool, non-cached variables will be overwritten. So, in fact, for
+  non-cached variables the include-order of variants file should be exactly 
+  the opposite of the order for cached variables. The proper way to solve
+  this, IMO, is to use something like set_if_not_set(), which will only set a
+  non-cached variable when it has not already been set.
+
 * Switch from FindPthread to FindThreads, which is the "standard" CMake
   module to use (and it also used by FindBLAS and FindLAPACK). Unfortunately,
   the variables that FindThreads sets are completely non-standard, so we may
diff --git a/CMake/variants/BGPCN.cmake b/CMake/variants/BGPCN.cmake
index 1a007a642db493e5bda460ec83519587c856ef1d..62330b11285c1e999a96bcb293a6be8ae9106ab8 100644
--- a/CMake/variants/BGPCN.cmake
+++ b/CMake/variants/BGPCN.cmake
@@ -10,7 +10,6 @@ set(LOFAR_BUILD_VARIANTS DEBUG OPT)
 
 # Options
 option(BUILD_STATIC_EXECUTABLES "Build static executables" ON)
-option(BUILD_SHARED_LIBS        "Build shared libraries"   OFF)
 option(USE_BACKTRACE            "Use backtrace"            ON)
 option(USE_LOG4CPLUS            "Use log4cplus"            OFF)
 option(USE_SHMEM                "Use shmem"                OFF)
diff --git a/CMake/variants/variants b/CMake/variants/variants
index 818a6a35ab83ba6df329ac7eac236f9bd816b69d..6910205634b051f9c1e44a482642bd8f90926980 100644
--- a/CMake/variants/variants
+++ b/CMake/variants/variants
@@ -22,7 +22,7 @@ set_if_not_set(LOFAR_SEARCH_PATH
 # NOT IMPLEMENTED YET: These options may be overridden for a given compiler
 # suite. For example: option(USE_BOOST_GNU "Use Boost for GNU" OFF)
 option(BUILD_DOCUMENTATION      "Build code documentation"    OFF)
-option(BUILD_SHARED_LIBS        "Build shared libraries"      ON)
+option(BUILD_SHARED_LIBS        "Build shared libraries"      OFF)
 option(BUILD_STATIC_EXECUTABLES "Build static executables"    OFF)
 option(BUILD_TESTING            "Build the testing tree"      ON)
 option(LOFAR_VERBOSE_CONFIGURE  "Be verbose when configuring" ON)
diff --git a/CMake/variants/variants.RS005C b/CMake/variants/variants.RS005C
index 07b2fa35cef162b44bb0ef5b20a6c48c1dbc9fa1..2fb3ca3b231ba6d8a6861d380307be03647505e1 100644
--- a/CMake/variants/variants.RS005C
+++ b/CMake/variants/variants.RS005C
@@ -11,7 +11,7 @@ set(CPPLAPACK_ROOT_DIR /usr)
 set(LOG4CPLUS_ROOT_DIR /usr/local/log4cplus)
 
 # Path to PVSS
-set(PVSS_ROOT_DIR /opt/WinCC_OA/3.10)
+set(PVSS_PROJ_DIR /opt/pvss/pvssproj)
 set(PVSS_DEFINITIONS "-Wno-deprecated")
 
 # Path to Matlab
diff --git a/CMake/variants/variants.dop131 b/CMake/variants/variants.dop131
index 4a466bc69b697581e3ce49fb9d0480ddea36873a..c62db6ec07951e328fd392c6bc0b6b9c8232d35d 100644
--- a/CMake/variants/variants.dop131
+++ b/CMake/variants/variants.dop131
@@ -1,2 +1,3 @@
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
 #set(CASACORE_ROOT_DIR /opt/lofar/external/casacore)
 set(ENV{JAVA_HOME} /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0)
diff --git a/CMake/variants/variants.kis001 b/CMake/variants/variants.kis001
index 3f7a9b03ae3a30ba62e836a9c7ac4b201bfedf40..bb3f6b1974c6aa945c17b7f3cb2ed4dba4b8b7d6 100644
--- a/CMake/variants/variants.kis001
+++ b/CMake/variants/variants.kis001
@@ -1,8 +1,7 @@
-option(BUILD_SHARED_LIBS        "Build shared libraries"      OFF)
-
 set(ENV{JAVA_HOME} /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0)
 #set(PVSS_ROOT_DIR /opt/pvss/pvss2_v3.7)
-set(PVSS_ROOT_DIR /opt/WinCC_OA/3.10)
+#set(PVSS_ROOT_DIR /opt/WinCC_OA/3.10)
+set(PVSS_PROJ_DIR /opt/pvss/pvssproj)
 set(PVSS_DEFINITIONS "-Wno-deprecated")
 set(LOG4CPLUS_ROOT_DIR "/usr/local/log4cplus")
 
diff --git a/CMake/variants/variants.lce072 b/CMake/variants/variants.lce072
index f203bc5dd0409bdd3c64b22f3c418f6a2d4b105c..ccc44214f64da8c438048ba78bd35ec0fa4466de 100644
--- a/CMake/variants/variants.lce072
+++ b/CMake/variants/variants.lce072
@@ -1,3 +1,5 @@
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+
 set(CASACORE_ROOT_DIR /opt/cep/LofIm/daily/casacore)
 set(CASAREST_ROOT_DIR /opt/cep/LofIm/daily/casarest)
 set(LDA_ROOT_DIR /opt/cep/lda)
diff --git a/CMake/variants/variants.lfe001 b/CMake/variants/variants.lfe001
index b72d84db644a764f932c92f9f744e0cd00792729..2bf1ea99e27ec8d83f6efed367896d69f09b17d4 100644
--- a/CMake/variants/variants.lfe001
+++ b/CMake/variants/variants.lfe001
@@ -1,3 +1,5 @@
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+
 set(CASACORE_ROOT_DIR /opt/cep/casacore)
 set(CASAREST_ROOT_DIR /opt/cep/casarest)
 set(LDA_ROOT_DIR /opt/cep/lda)
diff --git a/CMake/variants/variants.lfe002 b/CMake/variants/variants.lfe002
index b72d84db644a764f932c92f9f744e0cd00792729..2bf1ea99e27ec8d83f6efed367896d69f09b17d4 100644
--- a/CMake/variants/variants.lfe002
+++ b/CMake/variants/variants.lfe002
@@ -1,3 +1,5 @@
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+
 set(CASACORE_ROOT_DIR /opt/cep/casacore)
 set(CASAREST_ROOT_DIR /opt/cep/casarest)
 set(LDA_ROOT_DIR /opt/cep/lda)
diff --git a/CMake/variants/variants.lhn001 b/CMake/variants/variants.lhn001
index 70a36aa44504a824a7791f7b349b22ce172cb3ed..ec7471769b4689da707dea90afe625bd4ea0a0a6 100644
--- a/CMake/variants/variants.lhn001
+++ b/CMake/variants/variants.lhn001
@@ -1,3 +1,5 @@
+option(BUILD_SHARED_LIBS        "Build shared libraries"      ON)
+
 set(CASACORE_ROOT_DIR /opt/cep/casacore)
 set(CASAREST_ROOT_DIR /opt/cep/casarest)
 set(DAL_ROOT_DIR /opt/cep/dal/current)
diff --git a/CMake/variants/variants.macdiepen b/CMake/variants/variants.macdiepen
index 63018fbdc3d0c3a93fd0478938de8d0d2d1f0715..ebfc84d2dda6a51f8ebbfc37e47ee1ac42ffc06e 100644
--- a/CMake/variants/variants.macdiepen
+++ b/CMake/variants/variants.macdiepen
@@ -1,4 +1,5 @@
 # Specific options
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
 option(USE_BACKTRACE     "No backtrace" OFF)
 option(USE_LOG4CPLUS     "log4cxx is used" OFF)
 option(USE_LOG4CXX     "log4cxx is used" OFF)
diff --git a/JAVA/LofarUtils/src/nl/astron/lofar/lofarutils/LofarUtils.java b/JAVA/LofarUtils/src/nl/astron/lofar/lofarutils/LofarUtils.java
index 18d8fcbc8b1c0ac707fd6cd3a0fa7572bfbd9e8e..42236b227516251c93ed7b74a2bd9a6b77b408d3 100644
--- a/JAVA/LofarUtils/src/nl/astron/lofar/lofarutils/LofarUtils.java
+++ b/JAVA/LofarUtils/src/nl/astron/lofar/lofarutils/LofarUtils.java
@@ -309,6 +309,34 @@ public abstract class LofarUtils {
         aComboBox.validate();
     }
 
+    static public BitSet beamletToBitSet(String aS) {
+
+        BitSet aBitSet = new BitSet(216);
+
+        if (aS == null || aS.length() <= 2) {
+            return aBitSet;
+        }
+        //remove [] from string
+        String beamlets = aS.substring(aS.indexOf("[") + 1, aS.lastIndexOf("]"));
+
+        // split into seperate beamlet nr's
+        String[] beamletList = beamlets.split("[,]");
+
+        //fill bitset
+
+        for (int j = 0; j < beamletList.length; j++) {
+            int val;
+            try {
+                val = Integer.parseInt(beamletList[j]);
+                aBitSet.set(val);
+            } catch (NumberFormatException ex) {
+                System.out.println("Error converting beamlet numbers");
+
+            }
+        }
+        return aBitSet;
+    }
+
     static public String ltrim(String aS, String matchSet) {
         String reg = "^[" + matchSet + "]*";
         return Pattern.compile(reg).matcher(aS).replaceAll("");
diff --git a/LCS/ACC/ALC/src/ApplControlClient.cc b/LCS/ACC/ALC/src/ApplControlClient.cc
index 7e5ba75a1f6aed8e882d1d9050d0240159cb308c..3c1304ca7c8ac5dbdd7e27436122abdea071b66f 100644
--- a/LCS/ACC/ALC/src/ApplControlClient.cc
+++ b/LCS/ACC/ALC/src/ApplControlClient.cc
@@ -80,8 +80,8 @@ ApplControlClient::ApplControlClient(const string&	aUniqUserName,
 	LOG_DEBUG(formatString("Private ACserver is at %s:%d, trying to connect", 
 														host.c_str(), port));
 
-	LOG_DEBUG("Waiting 5 second before starting up the ApplController");
-	sleep (5);
+	LOG_DEBUG("Waiting 3 second before starting up the ApplController");
+	sleep (3);
 
 	itsCommChan = new ApplControlComm(host, toString(port), syncClient);
 	ASSERTSTR(itsCommChan, "Unable to allocate a communication channel");
diff --git a/LCS/Common/include/Common/ParameterSet.h b/LCS/Common/include/Common/ParameterSet.h
index aee1f7f99ea5897e05fc88f83b90d361f88e8dbf..241b80410ae7ed0c7c3eb29be392dcc109adb69a 100644
--- a/LCS/Common/include/Common/ParameterSet.h
+++ b/LCS/Common/include/Common/ParameterSet.h
@@ -140,10 +140,6 @@ public:
         // <br>If theCollection is this collection, nothing will be done.
 	void	adoptCollection(const ParameterSet&         theCollection,
 				const string&               thePrefix = "");
-
-        // Adds the Key-Values pairs in the argument list.
-        // It ignores arguments not having the Key=Value syntax.
-        void    adoptArgv      (int nr, char const * const argv[]);
 	// @}
 
 
@@ -344,10 +340,6 @@ public:
 
 	// @}
 
-        // Get all unused parameter names, thus the names of parameters
-        // that have not been asked for.
-        vector<string> unusedKeys() const;
-
 	// \name Printing
 	// Mostly for debug purposes the collection can be printed.
 	// @{
@@ -433,11 +425,6 @@ inline void	ParameterSet::adoptCollection	(const ParameterSet& theCollection, co
 	itsSet->adoptCollection (*theCollection.itsSet, thePrefix);
 }
 
-  inline void	ParameterSet::adoptArgv  	(int nr, const char * const argv[])
-{
-        itsSet->adoptArgv (nr, argv);
-}
-
 inline void	ParameterSet::writeFile   (const string& theFilename, bool append) const
 {
 	itsSet->writeFile (theFilename, append);
@@ -871,11 +858,6 @@ inline vector<time_t> ParameterSet::getTimeVector(const string& aKey,
         return itsSet->getTimeVector(aKey, aValue, expandable);
 }
 
-inline vector<string> ParameterSet::unusedKeys() const
-{
-        return itsSet->unusedKeys();
-}
-
 } // namespace LOFAR
 
 #endif
diff --git a/LCS/Common/include/Common/ParameterSetImpl.h b/LCS/Common/include/Common/ParameterSetImpl.h
index f2e470beb3d1f84533254472833b7ff6d0b9e153..359c3b2ab6f9856008bb85653fc9d26a5513ebc4 100644
--- a/LCS/Common/include/Common/ParameterSetImpl.h
+++ b/LCS/Common/include/Common/ParameterSetImpl.h
@@ -31,7 +31,6 @@
 #include <Common/ParameterValue.h>
 #include <Common/LofarTypes.h>
 #include <Common/lofar_map.h>
-#include <Common/lofar_set.h>
 #include <Common/lofar_string.h>
 #include <Common/lofar_vector.h>
 #include <Common/lofar_iostream.h>
@@ -126,10 +125,6 @@ public:
 	// thePrefix.
 	void	adoptCollection(const ParameterSetImpl&     theCollection,
 				const string&               thePrefix = "");
-
-        // Adds the Key-Values pairs in the argument list.
-        // It ignores arguments not having the Key=Value syntax.
-        void    adoptArgv      (int nr, char const * const argv[]);
 	// @}
 
 
@@ -321,9 +316,6 @@ public:
 	friend std::ostream& operator<<(std::ostream& os, const ParameterSetImpl &thePS);
 	// @}
 
-        // Get all unused parameter names.
-        vector<string> unusedKeys() const;
-
 private:
 	// Copying is not needed, thus not allowed.
 	// @{
@@ -355,8 +347,6 @@ private:
 	int itsCount;
 	// Key comparison mode.
 	const KeyCompare::Mode itsMode;
-        // The set of keys that have been asked.
-        mutable set<string> itsAskedParms;
 };
 
 //# -------------------- Global functions --------------------
diff --git a/LCS/Common/src/InputParSet.cc b/LCS/Common/src/InputParSet.cc
index a075948e5a18babf2c9fdefb5f4ab5bee5875f76..b4f721b8b29781a6434be148a7baeb14e5bc3d55 100644
--- a/LCS/Common/src/InputParSet.cc
+++ b/LCS/Common/src/InputParSet.cc
@@ -27,12 +27,6 @@
 # include <casa/Inputs/Input.h>
 #endif
 
-// Read input args from command line if given as key=value or as --key value
-// First arg can be parset name
-// Otherwise use default parset name (can be empty)
-// Do this in parset class
-
-
 namespace LOFAR {
 
   InputParSet::InputParSet()
diff --git a/LCS/Common/src/ParameterSetImpl.cc b/LCS/Common/src/ParameterSetImpl.cc
index a1e751b63b5d969245a093e6e32e3788fd2863ff..b7e1228120eb8c9d0f078fed428ed8627fcc9feb 100644
--- a/LCS/Common/src/ParameterSetImpl.cc
+++ b/LCS/Common/src/ParameterSetImpl.cc
@@ -104,7 +104,6 @@ ParameterSetImpl::makeSubset(const string& baseKey,
     // cut off baseString and copy to subset
     pos = subSet->insert(pos, make_pair(prefix + it->first.substr(base.size()),
                                         it->second));
-    itsAskedParms.insert (it->first);
   }
   
   return (subSet);
@@ -190,18 +189,6 @@ void ParameterSetImpl::adoptCollection(const ParameterSetImpl& theCollection,
   }
 }
 
-void ParameterSetImpl::adoptArgv (int nr, char const * const argv[])
-{
-  for (int i=0; i<nr; ++i) {
-    string arg(argv[i]);
-    // Only add arguments containing an =-sign.
-    string::size_type eqs = arg.find('=');
-    if (eqs != string::npos) {
-      replace (arg.substr(0, eqs), ParameterValue(arg.substr(eqs+1)));
-    }
-  }
-}
-
 //
 // readFile
 // (private)
@@ -339,12 +326,8 @@ ParameterSetImpl::findKV(const string& aKey, bool doThrow) const
 
 	const_iterator	iter = find(aKey);
 
-	if (iter == end()) {
-          if (doThrow) {
+	if (iter == end() && doThrow) {
 		THROW (APSException, formatString("Key %s unknown", aKey.c_str()));
-          }
-        } else {
-          itsAskedParms.insert (aKey);          \
 	}
 
 	return (iter);
@@ -669,15 +652,4 @@ string	ParameterSetImpl::fullModuleName(const string&	shortKey) const
 	return ("");
 }
 
-vector<string> ParameterSetImpl::unusedKeys() const
-{
-  vector<string> vec;
-  for (const_iterator iter = begin(); iter != end(); ++iter) {
-    if (itsAskedParms.find (iter->first) == itsAskedParms.end()) {
-      vec.push_back (iter->first);
-    }
-  }
-  return vec;
-}
-
 } // namespace LOFAR
diff --git a/LCS/Common/test/tParameterSet.cc b/LCS/Common/test/tParameterSet.cc
index d071288f11deae7fddb6cd8bb6383d90dfb28931..d473531adabaa049e40cf1a7464274c739b4c38e 100644
--- a/LCS/Common/test/tParameterSet.cc
+++ b/LCS/Common/test/tParameterSet.cc
@@ -1,4 +1,4 @@
-//# tParameterSet.cc: Program to test the ParameterSet class.
+//# tParameterSet.cc: Simple testprogrm to test the ParameterSet class.
 //#
 //# Copyright (C) 2002-2003
 //# ASTRON (Netherlands Institute for Radio Astronomy)
@@ -272,33 +272,6 @@ int doIt(KeyCompare::Mode mode)
   return 0;
 }
 
-void testUsed()
-{
-  ParameterSet parset;
-  const char* argv1[] = {"name", "k1=v1", "k2={k2=v2}", "-re"};
-  parset.adoptArgv (4, argv1);
-  ASSERT (parset.getString("k1") == "v1");
-  vector<string> unused = parset.unusedKeys();
-  ASSERT (unused.size()==1 && unused[0]=="k2");
-  ASSERT (parset.getString("k2") == "{k2=v2}");
-  unused = parset.unusedKeys();
-  ASSERT (unused.size()==0);
-  const char* argv2[] = {"s1.k1=v1a", "s1.sk1.k2=v2a"};
-  parset.adoptArgv (2, argv2);
-  unused = parset.unusedKeys();
-  ASSERT (unused.size()==2);
-  // Take a subset and check that such keys are marked as used.
-  ParameterSet subset = parset.makeSubset ("s1.");
-  unused = parset.unusedKeys();
-  // Check the subset.
-  ASSERT (unused.size()==0);
-  unused = subset.unusedKeys();
-  ASSERT (unused.size()==2);
-  ASSERT (subset.getString("k1") == "v1a");
-  ASSERT (subset.getString("sk1.k2") == "v2a");
-  unused = subset.unusedKeys();
-  ASSERT (unused.size()==0);
-}
 
 int main()
 {
@@ -306,7 +279,6 @@ int main()
   uint fails(0);
   fails += doIt(KeyCompare::NORMAL);
   fails += doIt(KeyCompare::NOCASE);
-  testUsed();
   if (fails > 0) {
     cout << fails << " test(s) failed" << endl;
     return 1;
diff --git a/LCS/MSLofar/src/FailedTileInfo.cc b/LCS/MSLofar/src/FailedTileInfo.cc
index 421c0349f16e8ee8dd42b9e55172e60be0c0b911..f28604ed9da0a77f2e35d2f727cd91fa9e0375a8 100644
--- a/LCS/MSLofar/src/FailedTileInfo.cc
+++ b/LCS/MSLofar/src/FailedTileInfo.cc
@@ -266,8 +266,7 @@ namespace LOFAR {
         }
       }
     } else {
-      // LBA and HBA already provide the tile number
-      return fail.itsSeqNr;
+      return fail.itsSeqNr/2;
     }
     return -1;
   }
diff --git a/LCS/MSLofar/test/tBeamTables.stdout b/LCS/MSLofar/test/tBeamTables.stdout
index 56c4d253482ccedcadd51d13c9b762ac0c62ccab..9f898e5afb9e0e23996361582e082c663d50b187 100644
--- a/LCS/MSLofar/test/tBeamTables.stdout
+++ b/LCS/MSLofar/test/tBeamTables.stdout
@@ -898,14 +898,14 @@ Axis Lengths: [2, 48]  (NB: Matrix in Row/Column order)
 
 ELEMENT_FLAG after FailedTileInfo _filled:
 Axis Lengths: [2, 48]  (NB: Matrix in Row/Column order)
-[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+[0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
 Axis Lengths: [2, 48]  (NB: Matrix in Row/Column order)
-[1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1
- 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1]
+[1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1
+ 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1]
 Axis Lengths: [2, 96]  (NB: Matrix in Row/Column order)
-[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 Axis Lengths: [2, 48]  (NB: Matrix in Row/Column order)
 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
@@ -915,16 +915,19 @@ Axis Lengths: [2, 48]  (NB: Matrix in Row/Column order)
     ELEMENT_INDEX: Int 1
     TIME: Double 4.85676e+09
     ANTENNA_FIELD_ID: Int 0
-    ELEMENT_INDEX: Int 22
+    ELEMENT_INDEX: Int 11
     TIME: Double 4.85676e+09
     ANTENNA_FIELD_ID: Int 1
-    ELEMENT_INDEX: Int 10
+    ELEMENT_INDEX: Int 5
     TIME: Double 4.85676e+09
     ANTENNA_FIELD_ID: Int 3
     ELEMENT_INDEX: Int 44
     TIME: Double 4.85676e+09
     ANTENNA_FIELD_ID: Int 2
-    ELEMENT_INDEX: Int 43
+    ELEMENT_INDEX: Int 21
+    TIME: Double 4.85676e+09
+    ANTENNA_FIELD_ID: Int 1
+    ELEMENT_INDEX: Int 12
     TIME: Double 4.85676e+09
 
 Test HBA_ZERO .....
diff --git a/LCS/pyparameterset/src/__init__.py b/LCS/pyparameterset/src/__init__.py
index afcd34c1b54872d59fd027997fa1ec170d174384..21d735a9884392cad1095565955152caed45aac5 100755
--- a/LCS/pyparameterset/src/__init__.py
+++ b/LCS/pyparameterset/src/__init__.py
@@ -137,12 +137,6 @@ class parameterset(PyParameterSet):
             d[key] = self.get(key).get()
         return d
 
-    def adoptArgv(self, argv):
-        for arg in argv:
-            kv = arg.split('=', 1)
-            if len(kv) == 2:
-                self.replace (kv[0], kv[1])
-
     def get(self, key):
         """Get the parametervalue object of a parameter."""
         return parametervalue (self._get(key), _copyObj=True)
diff --git a/LCS/pyparameterset/src/pyparameterset.cc b/LCS/pyparameterset/src/pyparameterset.cc
index 20aad23021b650694a8d5a656f5b99d2911aec58..aa854e19e9f3eb13142fe12728517dd06b4574bf 100644
--- a/LCS/pyparameterset/src/pyparameterset.cc
+++ b/LCS/pyparameterset/src/pyparameterset.cc
@@ -274,8 +274,6 @@ namespace LOFAR {
       .def ("isDefined", &ParameterSet::isDefined,
  	    (boost::python::arg("key")),
             "Does a parameter with the given name exist? ")
-      .def ("unusedKeys", &ParameterSet::unusedKeys,
-            "Get the list of parameter keys not asked for")
       .def ("_get", &PyParameterSet::get,
             ///            return_value_policy < copy_const_reference> (),
  	    (boost::python::arg("key")))
diff --git a/MAC/APL/APLCommon/src/ChildControl.cc b/MAC/APL/APLCommon/src/ChildControl.cc
index 9a0ef06279cf9b271df429b5dde57598d7c86c2c..2f24adf0f0ca3940f057557e3f363db790848c2d 100644
--- a/MAC/APL/APLCommon/src/ChildControl.cc
+++ b/MAC/APL/APLCommon/src/ChildControl.cc
@@ -65,7 +65,7 @@ ChildControl::ChildControl() :
 	itsTimerPort			(*this, "childControlTimer"),
 	itsStartDaemonMap		(),
 	itsStartupRetryInterval	(10),
-	itsMaxStartupRetries	(2),
+	itsMaxStartupRetries	(5),
 	itsCntlrList	 		(0),
 	itsActionList	 		(),
 	itsActionTimer			(0),
@@ -1053,8 +1053,9 @@ void ChildControl::_doGarbageCollection()
 				LOG_DEBUG_STR ("Controller " << iter->cntlrName << " is still unreachable, informing main task");
 				_setEstablishedState(iter->cntlrName, CTState::QUITED, time(0), CT_RESULT_LOST_CONNECTION);
 				iter->port = (GCFPortInterface*) -1;
+				restartTimer = true;
 			}
-			restartTimer = true;
+
 			iter++;
 		} else if (iter->port == (GCFPortInterface*)-1) {
 			LOG_DEBUG_STR ("Removing controller " << iter->cntlrName << " from the controller list");
diff --git a/MAC/APL/APLCommon/src/swlevel b/MAC/APL/APLCommon/src/swlevel
index c0b6cf8fab8a4db80941b8b8558f66360f3d480b..8168875889a4b4a9ba8d4bc8313d607ccedd4b78 100644
--- a/MAC/APL/APLCommon/src/swlevel
+++ b/MAC/APL/APLCommon/src/swlevel
@@ -124,7 +124,6 @@ start_prog()
 	# Check if program is already running
 	/sbin/pidof ${prog} 1>/dev/null 2>&1
 	if [ $? -ne 0 ]; then
-                curdate=`date +%Y%m%dT%H%M%S`
 		# PVSS needs special treatment
 		if [ "$prog" = "PVSS00pmon" ]; then 
 		    echo Starting $prog
@@ -137,7 +136,7 @@ start_prog()
 		    if [ "$user" = "lofarsys" ]; then
 			echo Starting $prog
 			rm -f $LOGDIR/$prog.log*.? 1>/dev/null 2>&1
-			$BINDIR/$prog 1>>$LOGDIR//$prog.stdout.${curdate} 2>&1 &
+			$BINDIR/$prog 1>>$LOGDIR//$prog.stdout 2>&1 &
                     else
                         echo "Local use, not starting $prog"
                     fi		    
@@ -147,14 +146,14 @@ start_prog()
 		       sudo rm -f $LOGDIR/$prog.log.? 1>/dev/null 2>&1
 		       if [ "$prog" = "RSPDriver" ]; then
 			   selectImage
-			   sudo -b $BINDIR/$prog 1>>$LOGDIR/$prog.stdout.${curdate} 2>&1
+			   sudo -b $BINDIR/$prog 1>>$LOGDIR/$prog.stdout 2>&1
 		       else
-		           sudo -b $BINDIR/$prog 1>>$LOGDIR/$prog.stdout.${curdate} 2>&1
+		           sudo -b $BINDIR/$prog 1>>$LOGDIR/$prog.stdout 2>&1
 		       fi
 		    else
 			echo Starting $prog
 			rm -f $LOGDIR/$prog.log*.? 1>/dev/null 2>&1
-			$BINDIR/$prog 1>>$LOGDIR/$prog.stdout.${curdate} 2>&1 &
+			$BINDIR/$prog 1>>$LOGDIR/$prog.stdout 2>&1 &
 		    fi
 		fi
 		usleep 250000
diff --git a/MAC/APL/APLCommon/src/swlevel.conf b/MAC/APL/APLCommon/src/swlevel.conf
index 5ffd797cad27a3737f2f25e0b085ce30e300b456..48ee9d1b738d2853d2880ac4d660afe5c0f6a54f 100644
--- a/MAC/APL/APLCommon/src/swlevel.conf
+++ b/MAC/APL/APLCommon/src/swlevel.conf
@@ -10,7 +10,8 @@
 #1:u:d:::LogClient
 1:u:d:::CEPlogProcessor
 1:u:d:::ServiceBroker
-#1:u:d:::SASGateway
+1:u:d:::SoftwareMonitor
+1:u:d:::SASGateway
 1:u:d:::ACDaemon
 #
 2:u:d:r::_EPAStub
diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc
index e2a9fbc7d22e61a68fa7283a3b6c4a61844a5c96..64b50993a527ac17702aae0049bab4a7f29b0241 100644
--- a/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc
+++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/CEPHardwareMonitorMain.cc
@@ -36,54 +36,49 @@ using namespace LOFAR::CEPCU;
 
 int main(int argc, char* argv[])
 {
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, "CEPHardwareMonitor");
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, "CEPHardwareMonitor");
 
-		LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor");
-		LOG_INFO(Version::getInfo<CEPCUVersion>("CEPHardwareMonitor"));
+	LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor");
+	LOG_INFO(Version::getInfo<CEPCUVersion>("CEPHardwareMonitor"));
 
-		// Create tasks and call initial routines
-		BlueGeneMonitor*	bgm(0);
-		ClusterMonitor*		ctm(0);
-		
-		// monitor BLUEGENE?
-		if (globalParameterSet()->getUint32("WatchBlueGene",0)) {
-			bgm = new BlueGeneMonitor("BlueGeneMonitor");
-			bgm->start();
-			LOG_INFO("Monitoring the BlueGene");
-		}
+	// Create tasks and call initial routines
+	BlueGeneMonitor*	bgm(0);
+	ClusterMonitor*		ctm(0);
+	
+	// monitor BLUEGENE?
+	if (globalParameterSet()->getUint32("WatchBlueGene",0)) {
+		bgm = new BlueGeneMonitor("BlueGeneMonitor");
+		bgm->start();
+		LOG_INFO("Monitoring the BlueGene");
+	}
 
-		// monitor CEP2Cluster?
-		if (globalParameterSet()->getUint32("WatchCluster",0)) {
-			ctm = new ClusterMonitor("ClusterMonitor");
-			ctm->start();
-			LOG_INFO("Monitoring the Cluster");
-		}
+	// monitor CEP2Cluster?
+	if (globalParameterSet()->getUint32("WatchCluster",0)) {
+		ctm = new ClusterMonitor("ClusterMonitor");
+		ctm->start();
+		LOG_INFO("Monitoring the Cluster");
+	}
 
-		// sanity check
-		if (!bgm && !ctm) {
-			LOG_FATAL_STR("Non of the monitortask (WatchBlueGene, WatchCluster) "
-							"was switched on in the configfile, terminating program");
-			return (0);
-		}
+	// sanity check
+	if (!bgm && !ctm) {
+		LOG_FATAL_STR("Non of the monitortask (WatchBlueGene, WatchCluster) "
+						"was switched on in the configfile, terminating program");
+		return (0);
+	}
 
-		// ok, we have something to do, do it.
-		GCFScheduler::instance()->setDelayedQuit(true);	// we need a clean shutdown
-		GCFScheduler::instance()->run();				// until stop was called
+	// ok, we have something to do, do it.
+	GCFScheduler::instance()->setDelayedQuit(true);	// we need a clean shutdown
+	GCFScheduler::instance()->run();				// until stop was called
 
-		if (bgm) {
-			bgm->quit();		// let task quit nicely
-		}
-		if (ctm) {
-			ctm->quit();		// let task quit nicely
-		}
-		double	postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5);
-		GCFScheduler::instance()->run(postRunTime);	// let processes die.
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
+	if (bgm) {
+		bgm->quit();		// let task quit nicely
+	}
+	if (ctm) {
+		ctm->quit();		// let task quit nicely
 	}
+	double	postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5);
+	GCFScheduler::instance()->run(postRunTime);	// let processes die.
 
 	return (0);
 }
diff --git a/MAC/APL/CEPCU/src/CEPlogProcessor/CEPlogProcessorMain.cc b/MAC/APL/CEPCU/src/CEPlogProcessor/CEPlogProcessorMain.cc
index 146070a681404d3e1aa9a20039926418214f1dec..79d6d55cfa8b21488b43576deadea44cc8d2baea 100644
--- a/MAC/APL/CEPCU/src/CEPlogProcessor/CEPlogProcessorMain.cc
+++ b/MAC/APL/CEPCU/src/CEPlogProcessor/CEPlogProcessorMain.cc
@@ -49,11 +49,15 @@ int main (int argc, char* argv[])
 		loggerTask.start(); // make initial transition
 
 		GCFScheduler::instance()->run();
+
+		LOG_INFO_STR("Shutting down: " << argv[0]);
 	}
 	catch (LOFAR::Exception&	ex) {
 		LOG_FATAL_STR("Caught exception: " << ex);
+		LOG_FATAL     ("Terminated by exception!");
 		return (1);
 	}
 
+	LOG_INFO("Terminated normally");
 	return (0);
 }
diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
index 2e4cabf1232659469fd3b2fb2478ee48a00ea4cd..8da5578db85ed3e87acd999ab7a5bdfe80b23d1f 100644
--- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
+++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControl.cc
@@ -615,7 +615,7 @@ GCFEvent::TResult OnlineControl::finishing_state(GCFEvent& event, GCFPortInterfa
 		int32	result = system (startCmd.c_str());
 		LOG_INFO_STR ("Result of command = " << result);
 
-		itsTimerPort->setTimer(302.0); // IONProc, and thus CEPlogProcessor, can take up to 5 minutes to wrap up
+		itsTimerPort->setTimer(2.0);
 		break;
 	}
 
@@ -776,8 +776,8 @@ void OnlineControl::_doBoot()
 			remoteCopy(paramFileName,accHost,LOFAR_SHARE_LOCATION);
 
 			// Finally start ApplController on the right host
-			LOG_INFO_STR("Starting controller for " << applName << " in 5 seconds ");
-			sleep(5);			 // sometimes we are too quick, wait a second.
+			LOG_INFO_STR("Starting controller for " << applName << " in 3 seconds ");
+			sleep(3);			 // sometimes we are too quick, wait a second.
 			int32	expectedRuntime = time_duration(itsStopTime - itsStartTime).total_seconds();
 			uint32	obsID = globalParameterSet()->getUint32("Observation.ObsID");
 			CEPApplMgrPtr	accClient (new CEPApplMgr(*this, formatString("%s%d", applName.c_str(), obsID),
diff --git a/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc b/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc
index a1daffe7a2df34771e53c0ce7385552c3a9f6403..1a0dadbfb119ca7d17b1862b81eb7be052a8122b 100644
--- a/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc
+++ b/MAC/APL/CEPCU/src/OnlineControl/OnlineControlMain.cc
@@ -42,20 +42,15 @@ int main(int argc, char* argv[])
 		return(-1);
 	}
 
-	try {
-		GCFScheduler::instance()->init(argc, argv, argv[1]);
+	GCFScheduler::instance()->init(argc, argv, argv[1]);
 
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
 
-		OnlineControl	olc(argv[1]);
-		olc.start(); 	// make initial transition
+	OnlineControl	olc(argv[1]);
+	olc.start(); 	// make initial transition
 
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->run();
 
 	return (0);
 }
diff --git a/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc b/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc
index 0e65b89a8d794348849140d97cca593d82103fd3..9fa935bd723bc8ab05211317dd12e71ebacb2340 100644
--- a/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc
+++ b/MAC/APL/CEPCU/src/PythonControl/PythonControl.cc
@@ -315,29 +315,28 @@ GCFEvent::TResult PythonControl::initial_state(GCFEvent& event, GCFPortInterface
 		string	pythonHost      (thePS->getString(myPrefix+"pythonHost",     "@pythonHost@"));
 		itsChildCanCommunicate = thePS->getBool  (myPrefix+"canCommunicate", true);
 		// START PYTHON
-		// QUICK FIX #3633: if-else nesting was different
-		if (itsChildCanCommunicate) {
-			bool startOK = _startPython(pythonProg, getObservationNr(getName()), realHostname(pythonHost), 
-										itsListener->makeServiceName());
-			if (!startOK) {
-				LOG_ERROR("Failed to start the Python environment.");
-				CONTROLConnectedEvent	answer;
-				answer.cntlrName = msg.cntlrName;
-				answer.result    = CONTROL_LOST_CONN_ERR;
-				port.send(answer);
-				TRAN(PythonControl::finishing_state);
-				break;
-			}
-			LOG_DEBUG ("Started Python environment, going to waitForConnection state");
-			TRAN(PythonControl::waitForConnection_state);
+		bool	startOK = _startPython(pythonProg, getObservationNr(getName()), realHostname(pythonHost), itsListener->makeServiceName());
+		if (!startOK) {
+			LOG_ERROR("Failed to start the Python environment.");
+			CONTROLConnectedEvent	answer;
+			answer.cntlrName = msg.cntlrName;
+			answer.result    = CONTROL_LOST_CONN_ERR;
+			port.send(answer);
+			TRAN(PythonControl::finishing_state);
 		}
 		else {
-			LOG_WARN ("Python environment CANNOT COMMUNICATE, FAKING RESPONSES!!!");
-			CONTROLConnectedEvent	answer;
-			answer.cntlrName = itsMyName;
-			answer.result = CT_RESULT_NO_ERROR;
-			itsParentPort->send(answer);
-			TRAN(PythonControl::operational_state);
+			if (itsChildCanCommunicate) {
+				LOG_DEBUG ("Started Python environment, going to waitForConnection state");
+				TRAN(PythonControl::waitForConnection_state);
+			}
+			else {
+				LOG_WARN ("Started Python environment, CHILD CANNOT COMMUNICATE, FAKING RESPONSES!!!");
+				CONTROLConnectedEvent	answer;
+				answer.cntlrName = itsMyName;
+				answer.result = CT_RESULT_NO_ERROR;
+				itsParentPort->send(answer);
+				TRAN(PythonControl::operational_state);
+			}
 		}
 	}
 	break;
@@ -574,25 +573,7 @@ GCFEvent::TResult PythonControl::operational_state(GCFEvent& event, GCFPortInter
 			itsPythonPort->send(msg);
 		}
 		else {
-			// QUICK FIX #3633
-			LOG_INFO("Trying to start the Python environment");
-			ParameterSet*   thePS  = globalParameterSet();      // shortcut to global PS.
-			string  myPrefix        (thePS->locateModule("PythonControl")+"PythonControl.");
-			string	pythonProg      (thePS->getString(myPrefix+"pythonProgram",  "@pythonProgram@"));
-			string	pythonHost      (thePS->getString(myPrefix+"pythonHost",     "@pythonHost@"));
-			bool startOK = _startPython(pythonProg, getObservationNr(getName()), realHostname(pythonHost), 
-										itsListener->makeServiceName());
-			if (!startOK) {
-				LOG_ERROR("Failed to start the Python environment, ABORTING.");
-				CONTROLConnectedEvent	answer;
-				answer.cntlrName = msg.cntlrName;
-				answer.result    = CONTROL_LOST_CONN_ERR;
-				port.send(answer);
-				TRAN(PythonControl::finishing_state);
-				break;
-			}
-			// QUICK FIX #3633 END
-			LOG_WARN("Start of Python environment looks OK, sending FAKE Resume response");
+			LOG_WARN("Sending FAKE Resume response");
 			sendControlResult(*itsParentPort, event.signal, itsMyName, CT_RESULT_NO_ERROR);
 		}
 		break;
diff --git a/MAC/APL/CEPCU/src/PythonControl/PythonControlMain.cc b/MAC/APL/CEPCU/src/PythonControl/PythonControlMain.cc
index a9ff9f09e88a9be79c372158d32099135c2e48e7..38bee7485f3e8e150128a8a402bd6bd1ae0b74ba 100644
--- a/MAC/APL/CEPCU/src/PythonControl/PythonControlMain.cc
+++ b/MAC/APL/CEPCU/src/PythonControl/PythonControlMain.cc
@@ -42,20 +42,15 @@ int main(int argc, char* argv[])
 		return(-1);
 	}
 
-	try {
-		GCFScheduler::instance()->init(argc, argv, argv[1]);
+	GCFScheduler::instance()->init(argc, argv, "PythonControl");
 
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
 
-		PythonControl	pyc(argv[1]);
-		pyc.start(); 	// make initial transition
+	PythonControl	pyc(argv[1]);
+	pyc.start(); 	// make initial transition
 
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->run();
 
 	return (0);
 }
diff --git a/MAC/APL/CEPCU/src/_OfflineControl/OfflineControlMain.cc b/MAC/APL/CEPCU/src/_OfflineControl/OfflineControlMain.cc
index 48941455ee2b756ad49f5ffc744ee1597eb90a65..f827d1fedfbff9aef19b27e08e6fe62e95fb27cb 100644
--- a/MAC/APL/CEPCU/src/_OfflineControl/OfflineControlMain.cc
+++ b/MAC/APL/CEPCU/src/_OfflineControl/OfflineControlMain.cc
@@ -38,21 +38,15 @@ int main(int argc, char* argv[])
 	  printf("%s usage: %s <controller name>\n",argv[0],argv[0]);
 	  exit(-1);
 	}
+	GCFTask::init(argc, argv);
 
-	try {
-		GCFTask::init(argc, argv);
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
 
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
+	OfflineControl	ofc(argv[1]);
+	ofc.start(); 	// make initial transition
 
-		OfflineControl	ofc(argv[1]);
-		ofc.start(); 	// make initial transition
-
-		GCFTask::run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFTask::run();
 
 	return 0;
 }
diff --git a/MAC/APL/CUDaemons/src/CTStartDaemon/CTStartDaemonMain.cc b/MAC/APL/CUDaemons/src/CTStartDaemon/CTStartDaemonMain.cc
index 48b47c13aedc3b642327af449300352cf318983b..d78c0e9c4784d7c5a2554f017e6ccfd2a60fde8b 100644
--- a/MAC/APL/CUDaemons/src/CTStartDaemon/CTStartDaemonMain.cc
+++ b/MAC/APL/CUDaemons/src/CTStartDaemon/CTStartDaemonMain.cc
@@ -35,20 +35,15 @@ int main(int argc, char* argv[])
 {
 //	signal (SIGCHLD, SIG_IGN);
 
-	try {
-		GCFScheduler::instance()->init(argc, argv, "CTStartDaemon");
+	GCFScheduler::instance()->init(argc, argv, "CTStartDaemon");
 
-		LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_CTStartDaemon");
+	LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_CTStartDaemon");
 
-		CUDaemons::CTStartDaemon sd("StartDaemon");		// give myself a name
+	CUDaemons::CTStartDaemon sd("StartDaemon");		// give myself a name
 
-		sd.start(); // make initial transition
+	sd.start(); // make initial transition
 
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/APL/CUDaemons/src/ServiceBroker/ServiceBrokerMain.cc b/MAC/APL/CUDaemons/src/ServiceBroker/ServiceBrokerMain.cc
index fa9848e6985357e178cb252c9cd6d24f57697081..cc23478288b343a04a449c0f6131eeba52bdf26b 100644
--- a/MAC/APL/CUDaemons/src/ServiceBroker/ServiceBrokerMain.cc
+++ b/MAC/APL/CUDaemons/src/ServiceBroker/ServiceBrokerMain.cc
@@ -36,20 +36,15 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char *argv[])
 {
-	try {
-		GCFScheduler::instance()->init(argc, argv, "ServiceBroker");
-		
-		LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_ServiceBroker");
+  GCFScheduler::instance()->init(argc, argv, "ServiceBroker");
+  
+  LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_ServiceBroker");
 
-		ServiceBroker	 sb; 
-		
-		sb.start(); // make initial transition
-		
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+  ServiceBroker	 sb; 
+  
+  sb.start(); // make initial transition
+  
+  GCFScheduler::instance()->run();
 
-	return 0;
+  return 0;
 }
diff --git a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc
index 10e89211e210afbd86b76e38289219758c586494..bfb6138b975dd939d9e8e3cb7cd5b02b6bec2bb0 100644
--- a/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc
+++ b/MAC/APL/CURTDBDaemons/src/KeyValueLogger/KeyValueLoggerMain.cc
@@ -35,18 +35,13 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char *argv[])
 {
-	try {
-		GCFScheduler::instance()->init(argc, argv, "KeyValueLogger");
-		LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_KVLogger");
-
-		KeyValueLogger kvl("KeyValueLogger"); 
-		kvl.start(); // make initial transition
-
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->init(argc, argv, "KeyValueLogger");
+	LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_KVLogger");
+
+	KeyValueLogger kvl("KeyValueLogger"); 
+	kvl.start(); // make initial transition
+
+	GCFScheduler::instance()->run();
 
 	return (0);
 }
diff --git a/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc b/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc
index 9b4132e8c3b68ceec69a7e7867ea99796c836ba8..65cd3c3ceddb4333eda0613478c95cc015df3471 100644
--- a/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc
+++ b/MAC/APL/CURTDBDaemons/src/LogProcessor/LogProcessorMain.cc
@@ -35,18 +35,13 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char *argv[])
 {
-	try {
-		GCFScheduler::instance()->init(argc, argv, "LogProcessor");
-	//	LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_LogProcessor");
-
-		LogProcessor clp("LogProcessor"); 
-		clp.start(); // make initial transition
-
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->init(argc, argv, "LogProcessor");
+//	LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_LogProcessor");
+
+	LogProcessor clp("LogProcessor"); 
+	clp.start(); // make initial transition
+
+	GCFScheduler::instance()->run();
 
 	return (0);
 }
diff --git a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc
index d265a8f6b058d41f18639a9a2a82fe8c4189fd35..e7c3000739a1cd3acc7befd7d4740cca83226a40 100644
--- a/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc
+++ b/MAC/APL/CURTDBDaemons/src/SASGateway/SASGatewayMain.cc
@@ -35,18 +35,13 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char *argv[])
 {
-	try {
-		GCFScheduler::instance()->init(argc, argv, "SASGateway");
-		LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_SASGateway");
-
-		SASGateway SGW("SASGateway"); 
-		SGW.start(); // make initial transition
-
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->init(argc, argv, "SASGateway");
+	LOG_INFO("MACProcessScope: LOFAR_PermSW_Daemons_SASGateway");
+
+	SASGateway SGW("SASGateway"); 
+	SGW.start(); // make initial transition
+
+	GCFScheduler::instance()->run();
 
 	return (0);
 }
diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc
index fe578f42de9fbb06606e0b87893c5cbd4a38a88f..a1c9969cd39aefcf263acc2452843d0a418c049a 100644
--- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc
+++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitorMain.cc
@@ -40,33 +40,28 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char* argv[])
 {
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, "SoftwareMonitor");
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, "SoftwareMonitor");
 
-		LOG_INFO("MACProcessScope: LOFAR_PermSW_SoftwareMonitor");
-		LOG_INFO(Version::getInfo<CURTDBDaemonsVersion>("SoftwareMonitor"));
+	LOG_INFO("MACProcessScope: LOFAR_PermSW_SoftwareMonitor");
+	LOG_INFO(Version::getInfo<CURTDBDaemonsVersion>("SoftwareMonitor"));
 
-		// for debugging purposes
-		registerProtocol (DP_PROTOCOL,  DP_PROTOCOL_STRINGS);
+	// for debugging purposes
+	registerProtocol (DP_PROTOCOL,  DP_PROTOCOL_STRINGS);
 
-		// Create tasks and call initial routines
-		SoftwareMonitor*	swm = new SoftwareMonitor("SoftwareMonitor");
-		ASSERTSTR(swm, "Can't create an software monitortask");
-		swm->start();
+	// Create tasks and call initial routines
+	SoftwareMonitor*	swm = new SoftwareMonitor("SoftwareMonitor");
+	ASSERTSTR(swm, "Can't create an software monitortask");
+	swm->start();
 
-		// ok, we have something to do, do it.
-		GCFScheduler::instance()->setDelayedQuit(true);	// we need a clean shutdown
-		GCFScheduler::instance()->run();	// until stop was called
+	// ok, we have something to do, do it.
+	GCFScheduler::instance()->setDelayedQuit(true);	// we need a clean shutdown
+	GCFScheduler::instance()->run();	// until stop was called
 
-		swm->quit();		// let task quit nicely
+	swm->quit();		// let task quit nicely
 
-		double	postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5);
-		GCFScheduler::instance()->run(postRunTime);	// let processes die.
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	double	postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5);
+	GCFScheduler::instance()->run(postRunTime);	// let processes die.
 
 	return (0);
 }
diff --git a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControlMain.cc b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControlMain.cc
index 19e80f6cc378bf4bec08c7f130f9853cacff9cc0..7fd6086d47c292ecdd95fd09da16a1cee8d4df23 100644
--- a/MAC/APL/MainCU/src/CRTriggerControl/TriggerControlMain.cc
+++ b/MAC/APL/MainCU/src/CRTriggerControl/TriggerControlMain.cc
@@ -35,18 +35,14 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char* argv[])
 {
-	try {
-		// args: cntlrname
-		GCFScheduler::instance()->init(argc, argv, argv[0]);
-
-		TriggerControl	tc(argv[0]);
-		tc.start(); // make initial transition
-
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	
+	// args: cntlrname
+	GCFScheduler::instance()->init(argc, argv, argv[0]);
+
+	TriggerControl	tc(argv[0]);
+	tc.start(); // make initial transition
+
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc b/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc
index d03e2036e340e3bc829865fa96bf144bf1a8fa7e..5f6b5ab611740cd6d905fcf605ffe06a88305c9b 100644
--- a/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/MACSchedulerMain.cc
@@ -36,20 +36,15 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char* argv[])
 {
-	try {
-		GCFScheduler::instance()->init(argc, argv, "MACScheduler");
-
-		ChildControl*	cc = ChildControl::instance();
-		cc->start();	// make initial transition
-
-		MACScheduler	ms;
-		ms.start(); // make initial transition
-	  
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->init(argc, argv, "MACScheduler");
+
+	ChildControl*	cc = ChildControl::instance();
+	cc->start();	// make initial transition
+
+	MACScheduler	ms;
+	ms.start(); // make initial transition
+  
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
index d2c0c21f2ba4ca54b63ba206a133ffe191dd2735..8c36a9e70d185ef5f5b9697b451fe17ac611ea23 100644
--- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
+++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc
@@ -762,7 +762,7 @@ void  ObservationControl::doHeartBeatTask()
 		uint32	nrStations = itsChildControl->countChilds(0, CNTLRTYPE_STATIONCTRL);
 		time_t	now   = to_time_t(second_clock::universal_time());
 		time_t	stop  = to_time_t(itsStopTime);
-		if (!nrChilds || (now < stop && itsProcessType == "Observation" && !nrStations)) {
+		if (now < stop && itsProcessType == "Observation" && !nrStations) {
 			LOG_FATAL("Too less stations left, FORCING QUIT OF OBSERVATION");
 			if (itsState < CTState::RESUME) {
 				itsQuitReason = CT_RESULT_LOST_CONNECTION;
diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControlMain.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControlMain.cc
index e3ed26971c012aaae0dc4df06a50dd57a39871dd..7c52a1dce68ffbf319b2daf6e4837b9f902396f3 100644
--- a/MAC/APL/MainCU/src/ObservationControl/ObservationControlMain.cc
+++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControlMain.cc
@@ -36,24 +36,19 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char* argv[])
 {
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, argv[1]);
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, argv[1]);
 
-		ChildControl*	cc = ChildControl::instance();
-		cc->start();	// make initial transition
+	ChildControl*	cc = ChildControl::instance();
+	cc->start();	// make initial transition
 
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
 
-		ObservationControl	oc(argv[1]);
-		oc.start(); // make initial transition
+	ObservationControl	oc(argv[1]);
+	oc.start(); // make initial transition
 
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/APL/PIC/RSP_Driver/src/rspctl.cc b/MAC/APL/PIC/RSP_Driver/src/rspctl.cc
index 3a5fc4a405f36658b878e987bb3c236fc6ed2541..362a1491c092ffed4118ffa87768350fcaec4ad4 100644
--- a/MAC/APL/PIC/RSP_Driver/src/rspctl.cc
+++ b/MAC/APL/PIC/RSP_Driver/src/rspctl.cc
@@ -1251,7 +1251,7 @@ void SICommand::send()
 		request.settings()(0).setXSI(m_siOn);
 		request.settings()(0).setYSI(m_siOn);
 
-		logMessage(cout,formatString("bypassSetting  =%02X", request.settings()(0).getAsUint8()));
+		logMessage(cout,formatString("bypassSetting  =%02X", request.settings()(0).getAsUint16()));
 
 		m_rspport.send(request);
 	}
diff --git a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h
index f1dd042faf3b51b3594a4ab861daa0a30b769d4d..c8811409b9b142a42a2f16a7ec2366d3817a1340 100644
--- a/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h
+++ b/MAC/APL/PIC/RSP_Protocol/include/APL/RSP_Protocol/BypassSettings.h
@@ -56,7 +56,7 @@ public:
 		void setYSI(bool	on) { bypass.siy_enable = on ? 1 : 0; }
 		bool getXSI() const 	{ return (bypass.six_enable); }
 		bool getYSI() const 	{ return (bypass.siy_enable); }
-		uint8	getAsUint8() const	{ return *reinterpret_cast<const uint8*>(&bypass); } // Yak
+		uint16	getAsUint16() const	{ return (*((uint16*) &bypass)); } // Yak
 		DIAGBypass	getRaw()  const	{ return (bypass); }
 		void setRaw(const DIAGBypass	newBypass) { bypass = newBypass; }
 	private:
diff --git a/MAC/APL/StationCU/src/BeamControl/BeamControlMain.cc b/MAC/APL/StationCU/src/BeamControl/BeamControlMain.cc
index b42ebef64418622035cabf50fe041321077be0b0..b6eab6f10ce6c4614fec117fd03e0d1546945448 100644
--- a/MAC/APL/StationCU/src/BeamControl/BeamControlMain.cc
+++ b/MAC/APL/StationCU/src/BeamControl/BeamControlMain.cc
@@ -34,21 +34,16 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char* argv[])
 {
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, argv[1]);
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, argv[1]);
 
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
 
-		BeamControl	bc(argv[1]);
-		bc.start(); 	// make initial transition
+	BeamControl	bc(argv[1]);
+	bc.start(); 	// make initial transition
 
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlMain.cc b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlMain.cc
index 3fb2dac4b0b3b0f31a3a9fc7a89c3e373818c4ea..d6f05db5fba6edbc54b9fd47394b87275b09edf7 100644
--- a/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlMain.cc
+++ b/MAC/APL/StationCU/src/CalibrationControl/CalibrationControlMain.cc
@@ -34,21 +34,16 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char* argv[])
 {
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, argv[1]);
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, argv[1]);
 
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
 
-		CalibrationControl	cc(argv[1]);
-		cc.start(); 	// make initial transition
+	CalibrationControl	cc(argv[1]);
+	cc.start(); 	// make initial transition
 
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc b/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc
index 6e3105283f9bac999db0f5e8e6e064aa86dffd3a..23e3a6158a5e16f9e97c05c35a80e2b56f708055 100644
--- a/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc
+++ b/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc
@@ -39,21 +39,16 @@ int main(int argc, char* argv[])
 		return (1);
 	}
 
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, "ClockControl");
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, "ClockControl");
 
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
 
-		ClockControl	cc(argv[1]);
-		cc.start(); 	// make initial transition
+	ClockControl	cc(argv[1]);
+	cc.start(); 	// make initial transition
 
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc b/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc
index 281322d4a6f98718a6e6cd639e695b2a87878732..f671ca5b3a421f529ff1bbb7034bdcf2c5824f7d 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc
+++ b/MAC/APL/StationCU/src/HardwareMonitor/HardwareMonitorMain.cc
@@ -42,70 +42,65 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char* argv[])
 {
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, "HardwareMonitor");
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, "HardwareMonitor");
 
-		LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor");
-		LOG_INFO(Version::getInfo<StationCUVersion>("HardwareMonitor"));
+	LOG_INFO("MACProcessScope: LOFAR_PermSW_HardwareMonitor");
+	LOG_INFO(Version::getInfo<StationCUVersion>("HardwareMonitor"));
 
-		// for debugging purposes
-		registerProtocol (RSP_PROTOCOL, RSP_PROTOCOL_STRINGS);
-		registerProtocol (TBB_PROTOCOL, TBB_PROTOCOL_STRINGS);
-		registerProtocol (DP_PROTOCOL,  DP_PROTOCOL_STRINGS);
+	// for debugging purposes
+	registerProtocol (RSP_PROTOCOL, RSP_PROTOCOL_STRINGS);
+	registerProtocol (TBB_PROTOCOL, TBB_PROTOCOL_STRINGS);
+	registerProtocol (DP_PROTOCOL,  DP_PROTOCOL_STRINGS);
 
-		// Create tasks and call initial routines
-		RSPMonitor*		rsp(0);
-		TBBMonitor*		tbb(0);
-		ECMonitor*     ec(0);
-		
-		// monitor RSP?
-		if (globalParameterSet()->getUint32("WatchRSPboards",0)) {
-			rsp = new RSPMonitor("RSPMonitor");
-			rsp->start();
-			LOG_INFO("Monitoring the RSP boards");
-		}
+	// Create tasks and call initial routines
+	RSPMonitor*		rsp(0);
+	TBBMonitor*		tbb(0);
+	ECMonitor*     ec(0);
+	
+	// monitor RSP?
+	if (globalParameterSet()->getUint32("WatchRSPboards",0)) {
+		rsp = new RSPMonitor("RSPMonitor");
+		rsp->start();
+		LOG_INFO("Monitoring the RSP boards");
+	}
 
-		// monitor TBB?
-		if (globalParameterSet()->getUint32("WatchTBboards",0)) {
-			tbb = new TBBMonitor("TBBMonitor");
-			tbb->start();
-			LOG_INFO("Monitoring the TB boards");
-		}
+	// monitor TBB?
+	if (globalParameterSet()->getUint32("WatchTBboards",0)) {
+		tbb = new TBBMonitor("TBBMonitor");
+		tbb->start();
+		LOG_INFO("Monitoring the TB boards");
+	}
 
-		// monitor EC?
-		if (globalParameterSet()->getUint32("WatchEnvCntrl",0)) {
-			ec = new ECMonitor("ECMonitor");
-			ec->start();
-			LOG_INFO("Monitoring the Environment Controller");
-		}
+	// monitor EC?
+	if (globalParameterSet()->getUint32("WatchEnvCntrl",0)) {
+		ec = new ECMonitor("ECMonitor");
+		ec->start();
+		LOG_INFO("Monitoring the Environment Controller");
+	}
 
-		// sanity check
-		if (!tbb && !rsp && !ec) {
-			LOG_FATAL_STR("Non of the monitortask (WatchRSPboards, WatchTBboards, WatchEnvCntrl) "
-							"was switched on in the configfile, terminating program");
-			return (0);
-		}
+	// sanity check
+	if (!tbb && !rsp && !ec) {
+		LOG_FATAL_STR("Non of the monitortask (WatchRSPboards, WatchTBboards, WatchEnvCntrl) "
+						"was switched on in the configfile, terminating program");
+		return (0);
+	}
 
-		// ok, we have something to do, do it.
-		GCFScheduler::instance()->setDelayedQuit(true);	// we need a clean shutdown
-		GCFScheduler::instance()->run();	// until stop was called
+	// ok, we have something to do, do it.
+	GCFScheduler::instance()->setDelayedQuit(true);	// we need a clean shutdown
+	GCFScheduler::instance()->run();	// until stop was called
 
-		if (rsp) {
-			rsp->quit();		// let task quit nicely
-		}
-		if (tbb) {
-			tbb->quit();		// let task quit nicely
-		}
-	   if (ec) {
-			ec->quit();		   // let task quit nicely
-		}
-		double	postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5);
-		GCFScheduler::instance()->run(postRunTime);	// let processes die.
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
+	if (rsp) {
+		rsp->quit();		// let task quit nicely
+	}
+	if (tbb) {
+		tbb->quit();		// let task quit nicely
+	}
+   if (ec) {
+		ec->quit();		   // let task quit nicely
 	}
+	double	postRunTime = globalParameterSet()->getDouble("closingDelay", 1.5);
+	GCFScheduler::instance()->run(postRunTime);	// let processes die.
 
 	return (0);
 }
diff --git a/MAC/APL/StationCU/src/StationControl/StationControl.cc b/MAC/APL/StationCU/src/StationControl/StationControl.cc
index 6a69ef45c0e4894ec3242c577a0683296aaffed1..1277b8e67c0199aed60185698d8a363b4a780554 100644
--- a/MAC/APL/StationCU/src/StationControl/StationControl.cc
+++ b/MAC/APL/StationCU/src/StationControl/StationControl.cc
@@ -852,7 +852,6 @@ GCFEvent::TResult	StationControl::startObservation_state(GCFEvent&	event, GCFPor
                     LOG_INFO_STR("new observation also uses clock " << itsClock);
 		            itsTimerPort->setTimer(0.0);
                 }
-				break;
             }
 
             case 1: {
@@ -871,7 +870,6 @@ GCFEvent::TResult	StationControl::startObservation_state(GCFEvent&	event, GCFPor
                 CLKCTRLSetSplittersEvent	setEvent;
                 setEvent.splittersOn = splitterState;
                 itsClkCtrlPort->send(setEvent);		// will result in CLKCTRL_SET_SPLITTERS_ACK
-				break;
             } 
 
             case 2: {
@@ -903,7 +901,6 @@ GCFEvent::TResult	StationControl::startObservation_state(GCFEvent&	event, GCFPor
                     LOG_INFO_STR("new observation also uses bitmode " << itsBitmode);
 		            itsTimerPort->setTimer(0.0);
                 }
-				break;
             }
 
             default: {
@@ -915,7 +912,6 @@ GCFEvent::TResult	StationControl::startObservation_state(GCFEvent&	event, GCFPor
                 LOG_INFO("Going back to operational state");
                 itsStartingObs = itsObsMap.end();
                 TRAN(StationControl::operational_state);
-				break;
             }
         }  
 	}
diff --git a/MAC/APL/StationCU/src/StationControl/StationControlMain.cc b/MAC/APL/StationCU/src/StationControl/StationControlMain.cc
index f199efe9479233092cfcf823b57fe4c4c92dde7f..38ff113ea9e627c501b9ae2e5eaa6a946e4f8969 100644
--- a/MAC/APL/StationCU/src/StationControl/StationControlMain.cc
+++ b/MAC/APL/StationCU/src/StationControl/StationControlMain.cc
@@ -37,31 +37,26 @@ int main(int argc, char* argv[])
 {
 	using LOFAR::basename;
 
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, basename(argv[0]));
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, basename(argv[0]));
 
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
 
-		ChildControl*	cc = ChildControl::instance();
-		cc->start();	// make initial transition
+	ChildControl*	cc = ChildControl::instance();
+	cc->start();	// make initial transition
 
-		string		myName;
-		if (argc < 2) {		// started by swlevel?
-			myName = myHostname(false) + ":" + basename(argv[0]);
-		}
-		else {
-			myName = argv[1];
-		}
-		StationControl	sc(myName.c_str());
-		sc.start(); 	// make initial transition
-
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
+	string		myName;
+	if (argc < 2) {		// started by swlevel?
+		myName = myHostname(false) + ":" + basename(argv[0]);
+	}
+	else {
+		myName = argv[1];
 	}
+	StationControl	sc(myName.c_str());
+	sc.start(); 	// make initial transition
+
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/APL/StationCU/src/TBBControl/TBBControlMain.cc b/MAC/APL/StationCU/src/TBBControl/TBBControlMain.cc
index 162fcef5388c449a8a4ae84f592825620fd1a589..8b99850b0e7775ca5bca42d05dc256d5cc65d467 100644
--- a/MAC/APL/StationCU/src/TBBControl/TBBControlMain.cc
+++ b/MAC/APL/StationCU/src/TBBControl/TBBControlMain.cc
@@ -34,22 +34,17 @@ Exception::TerminateHandler t(Exception::terminate);
 
 int main(int argc, char* argv[])
 {
-	try {
-		// args: cntlrname, parentHost, parentService
-		GCFScheduler::instance()->init(argc, argv, argv[0]);
-		GCFScheduler::instance()->disableQueue();  // run as fast as possible
-
-		ParentControl*	pc = ParentControl::instance();
-		pc->start();	// make initial transition
-
-		TBBControl		tc(argv[1]);
-		tc.start(); 	// make initial transition
-
-		GCFScheduler::instance()->run();
-	} catch( Exception &ex ) {
-		LOG_FATAL_STR("Caught exception: " << ex);
-		return 1;
-	}
+	// args: cntlrname, parentHost, parentService
+	GCFScheduler::instance()->init(argc, argv, argv[0]);
+	GCFScheduler::instance()->disableQueue();  // run as fast as possible
+
+	ParentControl*	pc = ParentControl::instance();
+	pc->start();	// make initial transition
+
+	TBBControl		tc(argv[1]);
+	tc.start(); 	// make initial transition
+
+	GCFScheduler::instance()->run();
 
 	return 0;
 }
diff --git a/MAC/Deployment/data/Coordinates/ETRF_FILES/DE601/de601-antenna-positions-etrs.csv b/MAC/Deployment/data/Coordinates/ETRF_FILES/DE601/de601-antenna-positions-etrs.csv
index 7cf6e72c4d0aa95960da3afe9d570363ea19b72e..95c1d80e70e0fad76cd99ff4aaa5641b7fd010d3 100644
--- a/MAC/Deployment/data/Coordinates/ETRF_FILES/DE601/de601-antenna-positions-etrs.csv
+++ b/MAC/Deployment/data/Coordinates/ETRF_FILES/DE601/de601-antenna-positions-etrs.csv
@@ -1,195 +1,195 @@
 NAME,ETRS-X,ETRS-Y,ETRS-Z,STATION-P,STATION-Q,STATION-R,RCU-X,RCU-Y
-L0,4034033.347,487013.892,4900285.590,0.000,0.000,0.000,0,1
-L1,4034029.374,487020.589,4900288.223,0.000,0.000,0.000,2,3
-L2,4034030.373,487014.167,4900288.028,0.000,0.000,0.000,4,5
-L3,4034026.867,487019.788,4900290.357,0.000,0.000,0.000,6,7
-L4,4034043.285,487045.409,4900274.365,0.000,0.000,0.000,8,9
-L5,4034039.743,487050.144,4900276.800,0.000,0.000,0.000,10,11
-L6,4034049.398,487047.611,4900269.126,0.000,0.000,0.000,12,13
-L7,4034047.268,487052.001,4900270.298,0.000,0.000,0.000,14,15
-L8,4034030.861,487008.854,4900288.138,0.000,0.000,0.000,16,17
-L9,4034032.968,487002.322,4900287.043,0.000,0.000,0.000,18,19
-L10,4034030.474,487000.052,4900289.308,0.000,0.000,0.000,20,21
-L11,4034027.561,487001.916,4900291.548,0.000,0.000,0.000,22,23
-L12,4034039.707,487030.613,4900278.699,0.000,0.000,0.000,24,25
-L13,4034035.670,487028.638,4900282.247,0.000,0.000,0.000,26,27
-L14,4034034.133,487031.493,4900283.264,0.000,0.000,0.000,28,29
-L15,4034036.197,487035.336,4900281.186,0.000,0.000,0.000,30,31
-L16,4034031.412,487031.898,4900285.447,0.000,0.000,0.000,32,33
-L17,4034029.085,487028.053,4900287.700,0.000,0.000,0.000,34,35
-L18,4034026.720,487036.318,4900288.838,0.000,0.000,0.000,36,37
-L19,4034024.119,487033.236,4900291.240,0.000,0.000,0.000,38,39
-L20,4034053.919,487016.781,4900268.485,0.000,0.000,0.000,40,41
-L21,4034052.207,487008.224,4900270.666,0.000,0.000,0.000,42,43
-L22,4034060.495,487012.599,4900263.452,0.000,0.000,0.000,44,45
-L23,4034054.947,487003.398,4900268.951,0.000,0.000,0.000,46,47
-L24,4034039.309,487012.752,4900280.798,0.000,0.000,0.000,48,49
-L25,4034037.017,487010.014,4900282.947,0.000,0.000,0.000,50,51
-L26,4034041.901,487009.815,4900279.008,0.000,0.000,0.000,52,53
-L27,4034043.105,487006.009,4900278.384,0.000,0.000,0.000,54,55
-L28,4034053.457,487032.393,4900267.331,0.000,0.000,0.000,56,57
-L29,4034055.536,487035.042,4900265.336,0.000,0.000,0.000,58,59
-L30,4034058.415,487025.612,4900264.001,0.000,0.000,0.000,60,61
-L31,4034061.530,487029.743,4900260.984,0.000,0.000,0.000,62,63
-L32,4034025.941,487040.171,4900289.098,0.000,0.000,0.000,64,65
-L33,4034028.092,487045.952,4900286.784,0.000,0.000,0.000,66,67
-L34,4034022.824,487053.581,4900290.317,0.000,0.000,0.000,68,69
-L35,4034020.266,487048.216,4900292.959,0.000,0.000,0.000,70,71
-L36,4034043.400,487029.155,4900275.814,0.000,0.000,0.000,72,73
-L37,4034041.882,487034.592,4900276.534,0.000,0.000,0.000,74,75
-L38,4034046.314,487030.388,4900273.337,0.000,0.000,0.000,76,77
-L39,4034045.902,487034.110,4900273.310,0.000,0.000,0.000,78,79
-L40,4034021.811,487014.001,4900295.090,0.000,0.000,0.000,80,81
-L41,4034020.023,487023.885,4900295.622,0.000,0.000,0.000,82,83
-L42,4034015.932,487016.799,4900299.658,0.000,0.000,0.000,84,85
-L43,4034015.086,487027.327,4900299.313,0.000,0.000,0.000,86,87
-L44,4034043.951,487022.656,4900276.024,0.000,0.000,0.000,88,89
-L45,4034046.978,487023.474,4900273.481,0.000,0.000,0.000,90,91
-L46,4034044.297,487017.889,4900276.252,0.000,0.000,0.000,92,93
-L47,4034048.107,487019.463,4900272.998,0.000,0.000,0.000,94,95
-L48,4034038.141,487043.803,4900278.736,0.000,0.000,0.000,96,97
-L49,4034054.470,487023.447,4900267.430,0.000,0.000,0.000,98,99
-L50,4034038.090,487054.699,4900277.651,0.000,0.000,0.000,100,101
-L51,4034030.801,487046.129,4900284.587,0.000,0.000,0.000,102,103
-L52,4034046.825,487002.539,4900275.652,0.000,0.000,0.000,104,105
-L53,4034062.848,487019.479,4900260.902,0.000,0.000,0.000,106,107
-L54,4034030.207,487053.677,4900284.281,0.000,0.000,0.000,108,109
-L55,4034039.240,487033.959,4900278.779,0.000,0.000,0.000,110,111
-L56,4034022.092,487007.100,4900295.570,0.000,0.000,0.000,112,113
-L57,4034047.947,487009.170,4900274.079,0.000,0.000,0.000,114,115
-L58,4034035.955,487006.383,4900284.149,0.000,0.000,0.000,116,117
-L59,4034059.474,487039.290,4900261.617,0.000,0.000,0.000,118,119
-L60,4034051.743,487025.820,4900269.377,0.000,0.000,0.000,120,121
-L61,4034048.140,487012.974,4900273.587,0.000,0.000,0.000,122,123
-L62,4034023.309,487024.198,4900292.821,0.000,0.000,0.000,124,125
-L63,4034033.370,487025.532,4900284.437,0.000,0.000,0.000,126,127
-L64,4034041.953,487040.192,4900275.947,0.000,0.000,0.000,128,129
-L65,4034035.921,487019.267,4900282.931,0.000,0.000,0.000,130,131
-L66,4034052.546,487039.630,4900267.259,0.000,0.000,0.000,132,133
-L67,4034049.152,487033.638,4900270.651,0.000,0.000,0.000,134,135
-L68,4034040.211,487002.213,4900281.093,0.000,0.000,0.000,136,137
-L69,4034038.095,487000.422,4900283.026,0.000,0.000,0.000,138,139
-L70,4034039.746,487021.259,4900279.660,0.000,0.000,0.000,140,141
-L71,4034025.196,487015.613,4900292.184,0.000,0.000,0.000,142,143
-L72,4034048.596,487026.407,4900271.859,0.000,0.000,0.000,144,145
-L73,4034032.445,487041.349,4900283.689,0.000,0.000,0.000,146,147
-L74,4034044.669,487039.963,4900273.706,0.000,0.000,0.000,148,149
-L75,4034032.977,487053.849,4900281.961,0.000,0.000,0.000,150,151
-L76,4034038.816,487016.294,4900280.872,0.000,0.000,0.000,152,153
-L77,4034051.089,487020.822,4900270.427,0.000,0.000,0.000,154,155
-L78,4034027.920,487008.577,4900290.545,0.000,0.000,0.000,156,157
-L79,4034019.633,487032.252,4900295.069,0.000,0.000,0.000,158,159
-L80,4034025.391,487028.657,4900290.693,0.000,0.000,0.000,160,161
-L81,4034036.852,487047.888,4900279.413,0.000,0.000,0.000,162,163
-L82,4034029.710,487035.916,4900286.441,0.000,0.000,0.000,164,165
-L83,4034035.942,487022.864,4900282.568,0.000,0.000,0.000,166,167
-L84,4034058.181,487016.929,4900264.967,0.000,0.000,0.000,168,169
-L85,4034042.629,487025.880,4900276.770,0.000,0.000,0.000,170,171
-L86,4034054.796,487048.725,4900264.467,0.000,0.000,0.000,172,173
-L87,4034050.342,487041.582,4900268.873,0.000,0.000,0.000,174,175
-L88,4034030.768,487025.234,4900286.586,0.000,0.000,0.000,176,177
-L89,4034015.433,487038.140,4900297.956,0.000,0.000,0.000,178,179
-L90,4034033.755,487017.367,4900284.880,0.000,0.000,0.000,180,181
-L91,4034049.289,487001.601,4900273.749,0.000,0.000,0.000,182,183
-L92,4034022.234,487039.225,4900292.229,0.000,0.000,0.000,184,185
-L93,4034041.064,487018.150,4900278.858,0.000,0.000,0.000,186,187
-L94,4034044.655,487014.362,4900276.344,0.000,0.000,0.000,188,189
-L95,4034035.142,487038.556,4900281.737,0.000,0.000,0.000,190,191
-H0,4034122.709,486997.076,4900214.711,0.000,0.000,0.000,0,1
-H1,4034123.206,487002.115,4900213.812,0.000,0.000,0.000,2,3
-H2,4034123.703,487007.159,4900212.916,0.000,0.000,0.000,4,5
-H3,4034124.189,487012.202,4900212.013,0.000,0.000,0.000,6,7
-H4,4034124.677,487017.242,4900211.114,0.000,0.000,0.000,8,9
-H5,4034118.252,486992.988,4900218.755,0.000,0.000,0.000,10,11
-H6,4034118.753,486998.032,4900217.855,0.000,0.000,0.000,12,13
-H7,4034119.244,487003.080,4900216.956,0.000,0.000,0.000,14,15
-H8,4034119.743,487008.127,4900216.051,0.000,0.000,0.000,16,17
-H9,4034120.227,487013.161,4900215.147,0.000,0.000,0.000,18,19
-H10,4034120.728,487018.187,4900214.255,0.000,0.000,0.000,20,21
-H11,4034121.218,487023.240,4900213.352,0.000,0.000,0.000,22,23
-H12,4034113.795,486988.892,4900222.785,0.000,0.000,0.000,24,25
-H13,4034114.295,486993.944,4900221.878,0.000,0.000,0.000,26,27
-H14,4034114.799,486999.005,4900220.975,0.000,0.000,0.000,28,29
-H15,4034115.293,487004.045,4900220.091,0.000,0.000,0.000,30,31
-H16,4034115.776,487009.089,4900219.193,0.000,0.000,0.000,32,33
-H17,4034116.260,487014.122,4900218.289,0.000,0.000,0.000,34,35
-H18,4034116.756,487019.145,4900217.392,0.000,0.000,0.000,36,37
-H19,4034117.252,487024.187,4900216.491,0.000,0.000,0.000,38,39
-H20,4034117.735,487029.208,4900215.565,0.000,0.000,0.000,40,41
-H21,4034109.835,486989.847,4900225.939,0.000,0.000,0.000,42,43
-H22,4034110.338,486994.898,4900225.034,0.000,0.000,0.000,44,45
-H23,4034110.835,486999.960,4900224.118,0.000,0.000,0.000,46,47
-H24,4034111.341,487005.006,4900223.230,0.000,0.000,0.000,48,49
-H25,4034111.829,487010.042,4900222.328,0.000,0.000,0.000,50,51
-H26,4034112.318,487015.079,4900221.420,0.000,0.000,0.000,52,53
-H27,4034112.803,487020.091,4900220.539,0.000,0.000,0.000,54,55
-H28,4034113.285,487025.121,4900219.649,0.000,0.000,0.000,56,57
-H29,4034113.789,487030.160,4900218.731,0.000,0.000,0.000,58,59
-H30,4034105.885,486990.801,4900229.083,0.000,0.000,0.000,60,61
-H31,4034106.371,486995.851,4900228.195,0.000,0.000,0.000,62,63
-H32,4034106.864,487000.929,4900227.282,0.000,0.000,0.000,64,65
-H33,4034107.367,487005.967,4900226.380,0.000,0.000,0.000,66,67
-H34,4034107.866,487010.988,4900225.475,0.000,0.000,0.000,68,69
-H35,4034108.350,487016.023,4900224.583,0.000,0.000,0.000,70,71
-H36,4034108.834,487021.042,4900223.694,0.000,0.000,0.000,72,73
-H37,4034109.326,487026.070,4900222.800,0.000,0.000,0.000,74,75
-H38,4034109.826,487031.117,4900221.888,0.000,0.000,0.000,76,77
-H39,4034101.925,486991.739,4900232.246,0.000,0.000,0.000,78,79
-H40,4034102.408,486996.795,4900231.344,0.000,0.000,0.000,80,81
-H41,4034102.903,487001.866,4900230.439,0.000,0.000,0.000,82,83
-H42,4034103.392,487006.920,4900229.540,0.000,0.000,0.000,84,85
-H43,4034103.879,487011.940,4900228.636,0.000,0.000,0.000,86,87
-H44,4034104.372,487016.972,4900227.742,0.000,0.000,0.000,88,89
-H45,4034104.851,487021.996,4900226.856,0.000,0.000,0.000,90,91
-H46,4034105.350,487027.030,4900225.957,0.000,0.000,0.000,92,93
-H47,4034105.851,487032.079,4900225.015,0.000,0.000,0.000,94,95
-H48,4034097.947,486992.687,4900235.414,0.000,0.000,0.000,96,97
-H49,4034098.433,486997.770,4900234.506,0.000,0.000,0.000,98,99
-H50,4034098.932,487002.836,4900233.578,0.000,0.000,0.000,100,101
-H51,4034099.434,487007.876,4900232.671,0.000,0.000,0.000,102,103
-H52,4034099.937,487012.893,4900231.774,0.000,0.000,0.000,104,105
-H53,4034100.430,487017.920,4900230.873,0.000,0.000,0.000,106,107
-H54,4034100.915,487022.938,4900229.993,0.000,0.000,0.000,108,109
-H55,4034101.386,487027.964,4900229.106,0.000,0.000,0.000,110,111
-H56,4034101.852,487033.038,4900228.170,0.000,0.000,0.000,112,113
-H57,4034093.989,486993.634,4900238.568,0.000,0.000,0.000,114,115
-H58,4034094.473,486998.699,4900237.656,0.000,0.000,0.000,116,117
-H59,4034094.964,487003.787,4900236.742,0.000,0.000,0.000,118,119
-H60,4034095.469,487008.833,4900235.837,0.000,0.000,0.000,120,121
-H61,4034095.957,487013.852,4900234.935,0.000,0.000,0.000,122,123
-H62,4034096.444,487018.883,4900234.038,0.000,0.000,0.000,124,125
-H63,4034096.934,487023.890,4900233.147,0.000,0.000,0.000,126,127
-H64,4034097.431,487028.925,4900232.242,0.000,0.000,0.000,128,129
-H65,4034097.900,487033.988,4900231.297,0.000,0.000,0.000,130,131
-H66,4034090.025,486994.592,4900241.696,0.000,0.000,0.000,132,133
-H67,4034090.508,486999.628,4900240.799,0.000,0.000,0.000,134,135
-H68,4034090.994,487004.714,4900239.897,0.000,0.000,0.000,136,137
-H69,4034091.499,487009.774,4900238.986,0.000,0.000,0.000,138,139
-H70,4034092.000,487014.809,4900238.077,0.000,0.000,0.000,140,141
-H71,4034092.484,487019.828,4900237.188,0.000,0.000,0.000,142,143
-H72,4034092.966,487024.847,4900236.290,0.000,0.000,0.000,144,145
-H73,4034093.463,487029.903,4900235.370,0.000,0.000,0.000,146,147
-H74,4034093.939,487034.935,4900234.441,0.000,0.000,0.000,148,149
-H75,4034086.063,486995.547,4900244.847,0.000,0.000,0.000,150,151
-H76,4034086.548,487000.568,4900243.949,0.000,0.000,0.000,152,153
-H77,4034087.033,487005.665,4900243.030,0.000,0.000,0.000,154,155
-H78,4034087.532,487010.736,4900242.125,0.000,0.000,0.000,156,157
-H79,4034088.029,487015.747,4900241.226,0.000,0.000,0.000,158,159
-H80,4034088.504,487020.747,4900240.346,0.000,0.000,0.000,160,161
-H81,4034088.996,487025.806,4900239.435,0.000,0.000,0.000,162,163
-H82,4034089.506,487030.871,4900238.500,0.000,0.000,0.000,164,165
-H83,4034090.002,487035.905,4900237.585,0.000,0.000,0.000,166,167
-H84,4034082.601,487001.525,4900247.076,0.000,0.000,0.000,168,169
-H85,4034083.081,487006.590,4900246.166,0.000,0.000,0.000,170,171
-H86,4034083.564,487011.674,4900245.269,0.000,0.000,0.000,172,173
-H87,4034084.056,487016.700,4900244.376,0.000,0.000,0.000,174,175
-H88,4034084.549,487021.691,4900243.481,0.000,0.000,0.000,176,177
-H89,4034085.058,487026.762,4900242.555,0.000,0.000,0.000,178,179
-H90,4034085.536,487031.824,4900241.615,0.000,0.000,0.000,180,181
-H91,4034079.129,487007.507,4900249.306,0.000,0.000,0.000,182,183
-H92,4034079.609,487012.597,4900248.407,0.000,0.000,0.000,184,185
-H93,4034080.109,487017.633,4900247.516,0.000,0.000,0.000,186,187
-H94,4034080.597,487022.643,4900246.619,0.000,0.000,0.000,188,189
-H95,4034081.082,487027.695,4900245.710,0.000,0.000,0.000,190,191
-CLBA,4034038.635,487026.223,4900280.057,0.000,0.000,0.000,-1,-1
-CHBA,4034101.901,487012.401,4900230.210,0.000,0.000,0.000,-1,-1
+L0,4034032.589,487014.603,4900286.169,0.000,0.000,0.000,0,1
+L1,4034028.615,487021.301,4900288.802,0.000,0.000,0.000,2,3
+L2,4034029.615,487014.879,4900288.607,0.000,0.000,0.000,4,5
+L3,4034026.109,487020.500,4900290.936,0.000,0.000,0.000,6,7
+L4,4034042.526,487046.121,4900274.944,0.000,0.000,0.000,8,9
+L5,4034038.984,487050.856,4900277.379,0.000,0.000,0.000,10,11
+L6,4034048.639,487048.323,4900269.705,0.000,0.000,0.000,12,13
+L7,4034046.510,487052.713,4900270.876,0.000,0.000,0.000,14,15
+L8,4034030.103,487009.566,4900288.716,0.000,0.000,0.000,16,17
+L9,4034032.210,487003.034,4900287.622,0.000,0.000,0.000,18,19
+L10,4034029.716,487000.764,4900289.887,0.000,0.000,0.000,20,21
+L11,4034026.803,487002.628,4900292.127,0.000,0.000,0.000,22,23
+L12,4034038.949,487031.324,4900279.278,0.000,0.000,0.000,24,25
+L13,4034034.912,487029.350,4900282.826,0.000,0.000,0.000,26,27
+L14,4034033.375,487032.204,4900283.843,0.000,0.000,0.000,28,29
+L15,4034035.439,487036.048,4900281.765,0.000,0.000,0.000,30,31
+L16,4034030.654,487032.610,4900286.026,0.000,0.000,0.000,32,33
+L17,4034028.327,487028.765,4900288.278,0.000,0.000,0.000,34,35
+L18,4034025.961,487037.029,4900289.417,0.000,0.000,0.000,36,37
+L19,4034023.360,487033.948,4900291.819,0.000,0.000,0.000,38,39
+L20,4034053.160,487017.493,4900269.063,0.000,0.000,0.000,40,41
+L21,4034051.449,487008.936,4900271.245,0.000,0.000,0.000,42,43
+L22,4034059.737,487013.311,4900264.031,0.000,0.000,0.000,44,45
+L23,4034054.189,487004.109,4900269.529,0.000,0.000,0.000,46,47
+L24,4034038.550,487013.464,4900281.377,0.000,0.000,0.000,48,49
+L25,4034036.259,487010.726,4900283.526,0.000,0.000,0.000,50,51
+L26,4034041.143,487010.526,4900279.587,0.000,0.000,0.000,52,53
+L27,4034042.347,487006.721,4900278.963,0.000,0.000,0.000,54,55
+L28,4034052.698,487033.105,4900267.910,0.000,0.000,0.000,56,57
+L29,4034054.777,487035.754,4900265.914,0.000,0.000,0.000,58,59
+L30,4034057.657,487026.323,4900264.580,0.000,0.000,0.000,60,61
+L31,4034060.772,487030.455,4900261.562,0.000,0.000,0.000,62,63
+L32,4034025.183,487040.883,4900289.677,0.000,0.000,0.000,64,65
+L33,4034027.334,487046.664,4900287.363,0.000,0.000,0.000,66,67
+L34,4034022.066,487054.293,4900290.896,0.000,0.000,0.000,68,69
+L35,4034019.508,487048.928,4900293.538,0.000,0.000,0.000,70,71
+L36,4034042.641,487029.867,4900276.392,0.000,0.000,0.000,72,73
+L37,4034041.123,487035.304,4900277.113,0.000,0.000,0.000,74,75
+L38,4034045.556,487031.099,4900273.916,0.000,0.000,0.000,76,77
+L39,4034045.144,487034.822,4900273.889,0.000,0.000,0.000,78,79
+L40,4034021.053,487014.712,4900295.668,0.000,0.000,0.000,80,81
+L41,4034019.264,487024.597,4900296.201,0.000,0.000,0.000,82,83
+L42,4034015.174,487017.511,4900300.236,0.000,0.000,0.000,84,85
+L43,4034014.327,487028.039,4900299.892,0.000,0.000,0.000,86,87
+L44,4034043.193,487023.368,4900276.602,0.000,0.000,0.000,88,89
+L45,4034046.220,487024.185,4900274.060,0.000,0.000,0.000,90,91
+L46,4034043.538,487018.600,4900276.831,0.000,0.000,0.000,92,93
+L47,4034047.349,487020.174,4900273.576,0.000,0.000,0.000,94,95
+L48,4034037.383,487044.515,4900279.315,0.000,0.000,0.000,96,97
+L49,4034053.712,487024.159,4900268.009,0.000,0.000,0.000,98,99
+L50,4034037.332,487055.411,4900278.230,0.000,0.000,0.000,100,101
+L51,4034030.042,487046.841,4900285.166,0.000,0.000,0.000,102,103
+L52,4034046.066,487003.251,4900276.231,0.000,0.000,0.000,104,105
+L53,4034062.090,487020.191,4900261.481,0.000,0.000,0.000,106,107
+L54,4034029.449,487054.389,4900284.859,0.000,0.000,0.000,108,109
+L55,4034038.482,487034.671,4900279.358,0.000,0.000,0.000,110,111
+L56,4034021.334,487007.812,4900296.149,0.000,0.000,0.000,112,113
+L57,4034047.189,487009.882,4900274.657,0.000,0.000,0.000,114,115
+L58,4034035.197,487007.095,4900284.728,0.000,0.000,0.000,116,117
+L59,4034058.716,487040.001,4900262.196,0.000,0.000,0.000,118,119
+L60,4034050.985,487026.532,4900269.955,0.000,0.000,0.000,120,121
+L61,4034047.382,487013.686,4900274.166,0.000,0.000,0.000,122,123
+L62,4034022.551,487024.910,4900293.400,0.000,0.000,0.000,124,125
+L63,4034032.612,487026.243,4900285.015,0.000,0.000,0.000,126,127
+L64,4034041.195,487040.904,4900276.526,0.000,0.000,0.000,128,129
+L65,4034035.163,487019.979,4900283.510,0.000,0.000,0.000,130,131
+L66,4034051.788,487040.342,4900267.838,0.000,0.000,0.000,132,133
+L67,4034048.393,487034.349,4900271.230,0.000,0.000,0.000,134,135
+L68,4034039.452,487002.925,4900281.672,0.000,0.000,0.000,136,137
+L69,4034037.337,487001.134,4900283.604,0.000,0.000,0.000,138,139
+L70,4034038.988,487021.971,4900280.238,0.000,0.000,0.000,140,141
+L71,4034024.438,487016.325,4900292.763,0.000,0.000,0.000,142,143
+L72,4034047.837,487027.119,4900272.438,0.000,0.000,0.000,144,145
+L73,4034031.686,487042.061,4900284.268,0.000,0.000,0.000,146,147
+L74,4034043.911,487040.675,4900274.285,0.000,0.000,0.000,148,149
+L75,4034032.219,487054.560,4900282.540,0.000,0.000,0.000,150,151
+L76,4034038.058,487017.005,4900281.451,0.000,0.000,0.000,152,153
+L77,4034050.331,487021.534,4900271.006,0.000,0.000,0.000,154,155
+L78,4034027.162,487009.289,4900291.124,0.000,0.000,0.000,156,157
+L79,4034018.875,487032.963,4900295.647,0.000,0.000,0.000,158,159
+L80,4034024.633,487029.369,4900291.272,0.000,0.000,0.000,160,161
+L81,4034036.094,487048.600,4900279.992,0.000,0.000,0.000,162,163
+L82,4034028.952,487036.628,4900287.020,0.000,0.000,0.000,164,165
+L83,4034035.184,487023.576,4900283.147,0.000,0.000,0.000,166,167
+L84,4034057.422,487017.640,4900265.545,0.000,0.000,0.000,168,169
+L85,4034041.871,487026.592,4900277.349,0.000,0.000,0.000,170,171
+L86,4034054.037,487049.436,4900265.046,0.000,0.000,0.000,172,173
+L87,4034049.584,487042.294,4900269.452,0.000,0.000,0.000,174,175
+L88,4034030.009,487025.945,4900287.165,0.000,0.000,0.000,176,177
+L89,4034014.675,487038.852,4900298.535,0.000,0.000,0.000,178,179
+L90,4034032.997,487018.079,4900285.459,0.000,0.000,0.000,180,181
+L91,4034048.531,487002.313,4900274.328,0.000,0.000,0.000,182,183
+L92,4034021.476,487039.937,4900292.808,0.000,0.000,0.000,184,185
+L93,4034040.305,487018.862,4900279.436,0.000,0.000,0.000,186,187
+L94,4034043.897,487015.074,4900276.922,0.000,0.000,0.000,188,189
+L95,4034034.383,487039.267,4900282.315,0.000,0.000,0.000,190,191
+H0,4034121.951,486997.788,4900215.290,0.000,0.000,0.000,0,1
+H1,4034122.448,487002.827,4900214.390,0.000,0.000,0.000,2,3
+H2,4034122.945,487007.871,4900213.494,0.000,0.000,0.000,4,5
+H3,4034123.431,487012.914,4900212.592,0.000,0.000,0.000,6,7
+H4,4034123.919,487017.954,4900211.693,0.000,0.000,0.000,8,9
+H5,4034117.494,486993.700,4900219.334,0.000,0.000,0.000,10,11
+H6,4034117.995,486998.744,4900218.434,0.000,0.000,0.000,12,13
+H7,4034118.486,487003.792,4900217.534,0.000,0.000,0.000,14,15
+H8,4034118.985,487008.838,4900216.630,0.000,0.000,0.000,16,17
+H9,4034119.469,487013.873,4900215.726,0.000,0.000,0.000,18,19
+H10,4034119.970,487018.899,4900214.834,0.000,0.000,0.000,20,21
+H11,4034120.460,487023.952,4900213.931,0.000,0.000,0.000,22,23
+H12,4034113.037,486989.604,4900223.364,0.000,0.000,0.000,24,25
+H13,4034113.537,486994.656,4900222.457,0.000,0.000,0.000,26,27
+H14,4034114.041,486999.717,4900221.553,0.000,0.000,0.000,28,29
+H15,4034114.535,487004.757,4900220.669,0.000,0.000,0.000,30,31
+H16,4034115.018,487009.801,4900219.772,0.000,0.000,0.000,32,33
+H17,4034115.502,487014.834,4900218.867,0.000,0.000,0.000,34,35
+H18,4034115.998,487019.857,4900217.971,0.000,0.000,0.000,36,37
+H19,4034116.494,487024.899,4900217.069,0.000,0.000,0.000,38,39
+H20,4034116.977,487029.920,4900216.144,0.000,0.000,0.000,40,41
+H21,4034109.077,486990.559,4900226.518,0.000,0.000,0.000,42,43
+H22,4034109.580,486995.610,4900225.612,0.000,0.000,0.000,44,45
+H23,4034110.077,487000.672,4900224.697,0.000,0.000,0.000,46,47
+H24,4034110.583,487005.718,4900223.809,0.000,0.000,0.000,48,49
+H25,4034111.071,487010.754,4900222.906,0.000,0.000,0.000,50,51
+H26,4034111.560,487015.791,4900221.998,0.000,0.000,0.000,52,53
+H27,4034112.045,487020.803,4900221.117,0.000,0.000,0.000,54,55
+H28,4034112.527,487025.833,4900220.227,0.000,0.000,0.000,56,57
+H29,4034113.031,487030.872,4900219.310,0.000,0.000,0.000,58,59
+H30,4034105.127,486991.513,4900229.661,0.000,0.000,0.000,60,61
+H31,4034105.613,486996.563,4900228.773,0.000,0.000,0.000,62,63
+H32,4034106.106,487001.641,4900227.861,0.000,0.000,0.000,64,65
+H33,4034106.609,487006.679,4900226.958,0.000,0.000,0.000,66,67
+H34,4034107.108,487011.700,4900226.054,0.000,0.000,0.000,68,69
+H35,4034107.592,487016.735,4900225.162,0.000,0.000,0.000,70,71
+H36,4034108.076,487021.754,4900224.273,0.000,0.000,0.000,72,73
+H37,4034108.568,487026.782,4900223.379,0.000,0.000,0.000,74,75
+H38,4034109.068,487031.829,4900222.466,0.000,0.000,0.000,76,77
+H39,4034101.167,486992.451,4900232.824,0.000,0.000,0.000,78,79
+H40,4034101.649,486997.507,4900231.923,0.000,0.000,0.000,80,81
+H41,4034102.145,487002.578,4900231.017,0.000,0.000,0.000,82,83
+H42,4034102.634,487007.632,4900230.118,0.000,0.000,0.000,84,85
+H43,4034103.121,487012.652,4900229.214,0.000,0.000,0.000,86,87
+H44,4034103.614,487017.684,4900228.320,0.000,0.000,0.000,88,89
+H45,4034104.093,487022.708,4900227.435,0.000,0.000,0.000,90,91
+H46,4034104.592,487027.742,4900226.535,0.000,0.000,0.000,92,93
+H47,4034105.093,487032.791,4900225.594,0.000,0.000,0.000,94,95
+H48,4034097.189,486993.399,4900235.993,0.000,0.000,0.000,96,97
+H49,4034097.675,486998.482,4900235.085,0.000,0.000,0.000,98,99
+H50,4034098.174,487003.548,4900234.157,0.000,0.000,0.000,100,101
+H51,4034098.676,487008.588,4900233.250,0.000,0.000,0.000,102,103
+H52,4034099.179,487013.605,4900232.352,0.000,0.000,0.000,104,105
+H53,4034099.672,487018.632,4900231.452,0.000,0.000,0.000,106,107
+H54,4034100.157,487023.650,4900230.572,0.000,0.000,0.000,108,109
+H55,4034100.628,487028.676,4900229.684,0.000,0.000,0.000,110,111
+H56,4034101.094,487033.750,4900228.748,0.000,0.000,0.000,112,113
+H57,4034093.231,486994.345,4900239.147,0.000,0.000,0.000,114,115
+H58,4034093.715,486999.410,4900238.235,0.000,0.000,0.000,116,117
+H59,4034094.206,487004.499,4900237.320,0.000,0.000,0.000,118,119
+H60,4034094.711,487009.545,4900236.415,0.000,0.000,0.000,120,121
+H61,4034095.199,487014.564,4900235.513,0.000,0.000,0.000,122,123
+H62,4034095.686,487019.595,4900234.616,0.000,0.000,0.000,124,125
+H63,4034096.176,487024.602,4900233.725,0.000,0.000,0.000,126,127
+H64,4034096.673,487029.637,4900232.821,0.000,0.000,0.000,128,129
+H65,4034097.142,487034.700,4900231.876,0.000,0.000,0.000,130,131
+H66,4034089.267,486995.304,4900242.275,0.000,0.000,0.000,132,133
+H67,4034089.750,487000.340,4900241.377,0.000,0.000,0.000,134,135
+H68,4034090.236,487005.426,4900240.475,0.000,0.000,0.000,136,137
+H69,4034090.741,487010.486,4900239.565,0.000,0.000,0.000,138,139
+H70,4034091.242,487015.521,4900238.655,0.000,0.000,0.000,140,141
+H71,4034091.726,487020.540,4900237.767,0.000,0.000,0.000,142,143
+H72,4034092.208,487025.559,4900236.869,0.000,0.000,0.000,144,145
+H73,4034092.705,487030.615,4900235.948,0.000,0.000,0.000,146,147
+H74,4034093.181,487035.647,4900235.019,0.000,0.000,0.000,148,149
+H75,4034085.305,486996.259,4900245.426,0.000,0.000,0.000,150,151
+H76,4034085.790,487001.280,4900244.528,0.000,0.000,0.000,152,153
+H77,4034086.275,487006.377,4900243.609,0.000,0.000,0.000,154,155
+H78,4034086.774,487011.448,4900242.704,0.000,0.000,0.000,156,157
+H79,4034087.271,487016.459,4900241.805,0.000,0.000,0.000,158,159
+H80,4034087.746,487021.459,4900240.925,0.000,0.000,0.000,160,161
+H81,4034088.238,487026.518,4900240.014,0.000,0.000,0.000,162,163
+H82,4034088.748,487031.583,4900239.079,0.000,0.000,0.000,164,165
+H83,4034089.244,487036.617,4900238.164,0.000,0.000,0.000,166,167
+H84,4034081.842,487002.237,4900247.654,0.000,0.000,0.000,168,169
+H85,4034082.322,487007.302,4900246.744,0.000,0.000,0.000,170,171
+H86,4034082.806,487012.386,4900245.848,0.000,0.000,0.000,172,173
+H87,4034083.298,487017.412,4900244.955,0.000,0.000,0.000,174,175
+H88,4034083.791,487022.403,4900244.060,0.000,0.000,0.000,176,177
+H89,4034084.299,487027.474,4900243.134,0.000,0.000,0.000,178,179
+H90,4034084.778,487032.536,4900242.193,0.000,0.000,0.000,180,181
+H91,4034078.371,487008.219,4900249.884,0.000,0.000,0.000,182,183
+H92,4034078.851,487013.309,4900248.986,0.000,0.000,0.000,184,185
+H93,4034079.351,487018.345,4900248.095,0.000,0.000,0.000,186,187
+H94,4034079.839,487023.355,4900247.197,0.000,0.000,0.000,188,189
+H95,4034080.324,487028.407,4900246.288,0.000,0.000,0.000,190,191
+CLBA 4034037.877,487026.935,4900280.635,0.000,0.000,0.000,-1,-1
+CHBA,4034101.143,487013.113,4900230.789,0.000,0.000,0.000,-1,-1
diff --git a/MAC/Deployment/data/Coordinates/ETRF_FILES/RS310/rs310-antenna-positions-etrs.csv b/MAC/Deployment/data/Coordinates/ETRF_FILES/RS310/rs310-antenna-positions-etrs.csv
deleted file mode 100644
index 8ff53a0a6a7cc6ae26545d890dfc78eeb4f3ad1a..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/Coordinates/ETRF_FILES/RS310/rs310-antenna-positions-etrs.csv
+++ /dev/null
@@ -1,149 +0,0 @@
-NAME,ETRS-X,ETRS-Y,ETRS-Z,STATION-P,STATION-Q,STATION-R,RCU-X,RCU-Y
-L0,3845433.443,413580.563,5054755.909,0.000,0.000,0.000,0,1
-L1,3845431.428,413580.320,5054757.453,0.000,2.550,0.000,2,3
-L2,3845432.117,413582.669,5054756.740,2.250,1.350,0.000,4,5
-L3,3845434.251,413582.927,5054755.105,2.250,-1.350,0.000,6,7
-L4,3845435.458,413580.806,5054754.365,0.000,-2.550,0.000,8,9
-L5,3845434.769,413578.457,5054755.078,-2.250,-1.350,0.000,10,11
-L6,3845432.635,413578.199,5054756.713,-2.250,1.350,0.000,12,13
-L7,3845431.434,413575.478,5054757.843,-4.808,3.243,0.000,14,15
-L8,3845429.221,413578.444,5054759.274,-1.599,5.575,0.000,16,17
-L9,3845428.984,413582.402,5054759.131,2.359,5.299,0.000,18,19
-L10,3845430.833,413585.499,5054757.480,5.213,2.543,0.000,20,21
-L11,3845433.904,413586.287,5054755.093,5.628,-1.403,0.000,22,23
-L12,3845436.759,413584.396,5054753.089,3.409,-4.692,0.000,24,25
-L13,3845438.062,413580.712,5054752.404,-0.405,-5.786,0.000,26,27
-L14,3845437.204,413576.958,5054753.359,-4.029,-4.172,0.000,28,29
-L15,3845434.586,413574.891,5054755.508,-5.768,-0.606,0.000,30,31
-L16,3845434.643,413571.315,5054755.756,-9.325,-0.160,0.000,32,33
-L17,3845431.744,413571.047,5054757.971,-9.245,3.497,0.000,34,35
-L18,3845428.012,413573.152,5054760.621,-6.708,7.850,0.000,36,37
-L19,3845425.440,413579.813,5054762.022,0.213,10.096,0.000,38,39
-L20,3845425.482,413583.027,5054761.728,3.399,9.579,0.000,40,41
-L21,3845426.902,413586.835,5054760.343,7.010,7.256,0.000,42,43
-L22,3845429.832,413588.813,5054757.967,8.623,3.314,0.000,44,45
-L23,3845434.408,413589.376,5054754.460,8.635,-2.479,0.000,46,47
-L24,3845438.156,413588.213,5054751.721,7.032,-6.988,0.000,48,49
-L25,3845440.545,413584.872,5054750.187,3.429,-9.487,0.000,50,51
-L26,3845440.850,413580.941,5054750.277,-0.511,-9.299,0.000,52,53
-L27,3845439.965,413576.290,5054751.326,-5.023,-7.522,0.000,54,55
-L28,3845437.653,413572.785,5054753.360,-8.226,-4.129,0.000,56,57
-L29,3845434.187,413566.248,5054756.515,-14.302,1.142,0.000,58,59
-L30,3845431.142,413566.248,5054758.817,-13.937,4.942,0.000,60,61
-L31,3845428.956,413567.886,5054760.336,-12.050,7.433,0.000,62,63
-L32,3845424.593,413573.967,5054763.139,-5.490,11.998,0.000,64,65
-L33,3845422.373,413575.209,5054764.717,-3.991,14.590,0.000,66,67
-L34,3845422.867,413582.620,5054763.738,3.307,12.901,0.000,68,69
-L35,3845424.214,413587.309,5054762.337,7.802,10.542,0.000,70,71
-L36,3845425.421,413592.312,5054761.016,12.625,8.312,0.000,72,73
-L37,3845428.082,413592.566,5054758.984,12.558,4.955,0.000,74,75
-L38,3845431.761,413593.499,5054756.125,13.045,0.228,0.000,76,77
-L39,3845437.336,413592.573,5054751.985,11.458,-6.595,0.000,78,79
-L40,3845439.470,413591.650,5054750.447,10.287,-9.125,0.000,80,81
-L41,3845442.221,413587.429,5054748.711,5.767,-11.948,0.000,82,83
-L42,3845444.853,413584.748,5054746.940,2.790,-14.845,0.000,84,85
-L43,3845444.288,413575.974,5054748.083,-5.854,-12.871,0.000,86,87
-L44,3845442.818,413572.541,5054749.474,-9.086,-10.540,0.000,88,89
-L45,3845440.139,413568.382,5054751.840,-12.895,-6.595,0.000,90,91
-L46,3845401.766,413544.548,5054782.800,-31.968,44.740,0.000,92,93
-L47,3845403.056,413621.932,5054775.511,44.708,31.940,0.000,94,95
-L48,3845439.556,413564.001,5054752.638,-17.175,-5.234,0.000,1,0
-L49,3845438.728,413561.168,5054753.495,-19.889,-3.791,0.000,3,2
-L50,3845426.344,413562.707,5054762.734,-16.879,11.441,0.000,5,4
-L51,3845418.301,413575.739,5054767.753,-2.978,19.595,0.000,7,6
-L52,3845417.055,413580.476,5054768.308,1.874,20.465,0.000,9,8
-L53,3845421.131,413591.201,5054764.351,12.035,13.827,0.000,11,10
-L54,3845429.922,413598.074,5054757.143,17.807,1.862,0.000,13,12
-L55,3845435.855,413600.568,5054752.453,19.573,-5.903,0.000,15,14
-L56,3845444.804,413590.965,5054746.469,8.969,-15.683,0.000,17,16
-L57,3845448.852,413584.327,5054743.950,1.894,-19.774,0.000,19,18
-L58,3845447.825,413574.553,5054745.524,-7.687,-17.080,0.000,21,20
-L59,3845450.542,413566.959,5054744.089,-15.552,-19.372,0.000,23,22
-L60,3845443.194,413558.237,5054750.358,-23.333,-8.940,0.000,25,24
-L61,3845433.317,413555.273,5054758.068,-25.094,3.815,0.000,27,26
-L62,3845428.330,413556.168,5054761.766,-23.609,9.909,0.000,29,28
-L63,3845421.856,413558.901,5054766.438,-20.121,17.593,0.000,31,30
-L64,3845415.132,413574.758,5054770.229,-3.573,23.692,0.000,33,32
-L65,3845413.922,413582.638,5054770.501,4.395,24.062,0.000,35,34
-L66,3845416.043,413596.061,5054767.802,17.469,19.474,0.000,37,36
-L67,3845425.176,413603.909,5054760.255,24.168,6.941,0.000,39,38
-L68,3845432.189,413606.556,5054754.736,25.957,-2.194,0.000,41,40
-L69,3845441.203,413602.809,5054748.226,21.159,-12.901,0.000,43,42
-L70,3845451.944,413593.297,5054740.880,10.430,-24.931,0.000,45,44
-L71,3845454.851,413575.811,5054740.109,-7.279,-26.030,0.000,47,46
-L72,3845457.628,413562.314,5054739.110,-21.012,-27.544,0.000,49,48
-L73,3845447.985,413554.198,5054747.064,-27.916,-14.336,0.000,51,50
-L74,3845437.136,413549.488,5054755.652,-31.294,-0.115,0.000,53,52
-L75,3845430.863,413548.327,5054760.490,-31.697,7.881,0.000,55,54
-L76,3845417.283,413557.380,5054770.020,-21.084,23.520,0.000,57,56
-L77,3845407.582,413571.281,5054776.221,-6.122,33.616,0.000,59,58
-L78,3845406.243,413583.501,5054776.237,6.171,33.520,0.000,61,60
-L79,3845410.568,413590.854,5054772.366,12.954,27.059,0.000,63,62
-L80,3845413.340,413604.871,5054769.127,26.539,21.573,0.000,65,64
-L81,3845426.438,413613.659,5054758.505,33.697,3.956,0.000,67,66
-L82,3845433.552,413614.243,5054753.078,33.426,-5.007,0.000,69,68
-L83,3845446.078,413610.550,5054743.908,28.261,-20.105,0.000,71,70
-L84,3845450.270,413603.977,5054741.274,21.234,-24.386,0.000,73,72
-L85,3845459.372,413586.306,5054735.834,2.600,-33.189,0.000,75,74
-L86,3845457.925,413579.948,5054737.446,-3.539,-30.465,0.000,77,76
-L87,3845462.784,413578.105,5054733.923,-5.950,-36.262,0.000,79,78
-L88,3845449.856,413543.308,5054746.538,-38.952,-15.096,0.000,81,80
-L89,3845429.545,413541.220,5054762.067,-38.595,10.554,0.000,83,82
-L90,3845414.109,413547.567,5054773.221,-30.447,28.900,0.000,85,84
-L91,3845406.244,413560.724,5054778.095,-16.443,36.813,0.000,87,86
-L92,3845406.444,413605.631,5054774.280,28.118,30.070,0.000,89,88
-L93,3845422.305,413614.929,5054761.527,35.453,8.930,0.000,91,90
-L94,3845433.864,413621.845,5054752.222,40.936,-6.495,0.000,93,92
-L95,3845461.675,413594.721,5054733.405,10.679,-37.281,0.000,95,94
-H0,3845365.140,413630.155,5054803.676,15.197,12.394,0.000,0,1
-H1,3845368.888,413632.037,5054800.689,16.617,7.444,0.000,2,3
-H2,3845372.637,413633.919,5054797.700,18.037,2.493,0.000,4,5
-H3,3845376.386,413635.800,5054794.712,19.456,-2.457,0.000,6,7
-H4,3845366.830,413625.373,5054802.787,10.247,10.975,0.000,8,9
-H5,3845370.579,413627.254,5054799.799,11.666,6.024,0.000,10,11
-H6,3845374.328,413629.136,5054796.811,13.086,1.074,0.000,12,13
-H7,3845378.077,413631.018,5054793.822,14.506,-3.877,0.000,14,15
-H8,3845361.024,413616.827,5054807.873,2.457,19.456,0.000,16,17
-H9,3845364.772,413618.709,5054804.885,3.877,14.506,0.000,18,19
-H10,3845368.522,413620.590,5054801.897,5.296,9.555,0.000,20,21
-H11,3845372.270,413622.472,5054798.909,6.716,4.605,0.000,22,23
-H12,3845376.019,413624.354,5054795.921,8.136,-0.346,0.000,24,25
-H13,3845379.767,413626.235,5054792.933,9.555,-5.296,0.000,26,27
-H14,3845383.517,413628.117,5054789.944,10.975,-10.247,0.000,28,29
-H15,3845387.265,413629.997,5054786.956,12.394,-15.197,0.000,30,31
-H16,3845362.714,413612.045,5054806.984,-2.493,18.037,0.000,32,33
-H17,3845366.464,413613.926,5054803.995,-1.074,13.086,0.000,34,35
-H18,3845370.212,413615.808,5054801.007,0.346,8.136,0.000,36,37
-H19,3845373.961,413617.689,5054798.019,1.765,3.185,0.000,38,39
-H20,3845377.710,413619.571,5054795.031,3.185,-1.765,0.000,40,41
-H21,3845381.459,413621.453,5054792.043,4.605,-6.716,0.000,42,43
-H22,3845385.207,413623.334,5054789.055,6.024,-11.666,0.000,44,45
-H23,3845388.956,413625.216,5054786.066,7.444,-16.617,0.000,46,47
-H24,3845364.406,413607.262,5054806.094,-7.444,16.617,0.000,48,49
-H25,3845368.155,413609.144,5054803.105,-6.024,11.666,0.000,50,51
-H26,3845371.903,413611.025,5054800.117,-4.605,6.716,0.000,52,53
-H27,3845375.652,413612.907,5054797.129,-3.185,1.765,0.000,54,55
-H28,3845379.401,413614.789,5054794.141,-1.765,-3.185,0.000,56,57
-H29,3845383.150,413616.670,5054791.153,-0.346,-8.136,0.000,58,59
-H30,3845386.898,413618.552,5054788.165,1.074,-13.086,0.000,60,61
-H31,3845390.648,413620.433,5054785.176,2.493,-18.037,0.000,62,63
-H32,3845366.097,413602.481,5054805.204,-12.394,15.197,0.000,64,65
-H33,3845369.845,413604.361,5054802.216,-10.975,10.247,0.000,66,67
-H34,3845373.595,413606.243,5054799.227,-9.555,5.296,0.000,68,69
-H35,3845377.343,413608.124,5054796.239,-8.136,0.346,0.000,70,71
-H36,3845381.092,413610.006,5054793.251,-6.716,-4.605,0.000,72,73
-H37,3845384.840,413611.888,5054790.263,-5.296,-9.555,0.000,74,75
-H38,3845388.590,413613.769,5054787.275,-3.877,-14.506,0.000,76,77
-H39,3845392.338,413615.651,5054784.287,-2.457,-19.456,0.000,78,79
-H40,3845375.285,413601.460,5054798.338,-14.506,3.877,0.000,80,81
-H41,3845379.034,413603.342,5054795.349,-13.086,-1.074,0.000,82,83
-H42,3845382.783,413605.224,5054792.361,-11.666,-6.024,0.000,84,85
-H43,3845386.532,413607.105,5054789.373,-10.247,-10.975,0.000,86,87
-H44,3845376.976,413596.678,5054797.448,-19.456,2.457,0.000,88,89
-H45,3845380.725,413598.559,5054794.460,-18.037,-2.493,0.000,90,91
-H46,3845384.474,413600.441,5054791.471,-16.617,-7.444,0.000,92,93
-H47,3845388.222,413602.323,5054788.484,-15.197,-12.394,0.000,94,95
-CLBA,3845433.443,413580.563,5054755.909,0.000,0.000,0.000,-1,-1
-CHBA,3845376.681,413616.239,5054796.080,0.000,0.000,0.000,-1,-1
-0.000,0.000,0.000,0.000,0.000,0.000,0.000,-1,-1
-0.000,0.000,0.000,0.000,0.000,0.000,0.000,-1,-1
diff --git a/MAC/Deployment/data/Coordinates/ETRF_FILES/RS407/rs407-antenna-positions-etrs.csv b/MAC/Deployment/data/Coordinates/ETRF_FILES/RS407/rs407-antenna-positions-etrs.csv
index bb7764221cf606ee430c1b6fc79a534706be30bd..413a9355853d15552a4b44424c3d96e38e0f6f21 100644
--- a/MAC/Deployment/data/Coordinates/ETRF_FILES/RS407/rs407-antenna-positions-etrs.csv
+++ b/MAC/Deployment/data/Coordinates/ETRF_FILES/RS407/rs407-antenna-positions-etrs.csv
@@ -137,7 +137,7 @@ H38,3811655.566,453472.344,5076723.249,11.997,-9.028,0.000,76,77
 H39,3811655.380,453477.481,5076722.924,17.119,-9.567,0.000,78,79
 H40,3811660.432,453451.754,5076721.458,-9.028,-11.997,0.000,80,81
 H41,3811660.245,453456.889,5076721.133,-3.907,-12.535,0.000,82,83
-H42,3811660.060,453462.026,5076720.808,1.215,-13.074,0.000,84,85
+H41,3811660.060,453462.026,5076720.808,1.215,-13.074,0.000,84,85
 H43,3811659.873,453467.162,5076720.484,6.337,-13.612,0.000,86,87
 H44,3811664.553,453451.707,5076718.369,-9.567,-17.119,0.000,88,89
 H45,3811664.366,453456.844,5076718.044,-4.445,-17.657,0.000,90,91
diff --git a/MAC/Deployment/data/Coordinates/ETRF_FILES/RS409/rs409-antenna-positions-etrs.csv b/MAC/Deployment/data/Coordinates/ETRF_FILES/RS409/rs409-antenna-positions-etrs.csv
deleted file mode 100644
index f9206ee2e1afc0fe077f86c5fbeb9f5f151b75ef..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/Coordinates/ETRF_FILES/RS409/rs409-antenna-positions-etrs.csv
+++ /dev/null
@@ -1,149 +0,0 @@
-NAME,ETRS-X,ETRS-Y,ETRS-Z,STATION-P,STATION-Q,STATION-R,RCU-X,RCU-Y
-L0,3824756.246,426178.523,5069289.608,0.000,0.000,0.000,0,1
-L1,3824754.227,426178.280,5069291.146,0.000,2.550,0.000,2,3
-L2,3824754.908,426180.628,5069290.422,2.250,1.350,0.000,4,5
-L3,3824757.046,426180.886,5069288.794,2.250,-1.350,0.000,6,7
-L4,3824758.265,426178.766,5069288.070,0.000,-2.550,0.000,8,9
-L5,3824757.584,426176.418,5069288.794,-2.250,-1.350,0.000,10,11
-L6,3824755.446,426176.160,5069290.422,-2.250,1.350,0.000,12,13
-L7,3824753.609,426183.456,5069291.142,5.213,2.543,0.000,14,15
-L8,3824756.684,426184.244,5069288.762,5.628,-1.403,0.000,16,17
-L9,3824759.554,426182.355,5069286.778,3.409,-4.692,0.000,18,19
-L10,3824760.877,426178.673,5069286.119,-0.405,-5.786,0.000,20,21
-L11,3824760.032,426174.921,5069287.092,-4.029,-4.172,0.000,22,23
-L12,3824757.416,426172.854,5069289.242,-5.768,-0.606,0.000,24,25
-L13,3824754.253,426173.440,5069291.564,-4.808,3.243,0.000,26,27
-L14,3824752.022,426176.404,5069292.970,-1.599,5.575,0.000,28,29
-L15,3824751.767,426180.359,5069292.804,2.359,5.299,0.000,30,31
-L16,3824749.246,426182.236,5069294.527,4.524,8.156,0.000,32,33
-L17,3824750.375,426185.522,5069293.382,7.651,6.258,0.000,34,35
-L18,3824753.539,426188.422,5069290.745,10.152,1.885,0.000,36,37
-L19,3824759.357,426187.597,5069286.453,8.637,-5.232,0.000,38,39
-L20,3824761.581,426185.810,5069284.945,6.596,-7.733,0.000,40,41
-L21,3824763.595,426182.208,5069283.759,2.779,-9.699,0.000,42,43
-L22,3824763.644,426177.963,5069284.105,-1.441,-9.124,0.000,44,45
-L23,3824761.959,426172.700,5069285.846,-6.465,-6.238,0.000,46,47
-L24,3824759.446,426169.271,5069288.042,-9.568,-2.596,0.000,48,49
-L25,3824756.029,426168.494,5069290.678,-9.931,1.774,0.000,50,51
-L26,3824753.146,426170.295,5069292.679,-7.798,5.092,0.000,52,53
-L27,3824750.301,426173.776,5069294.499,-4.002,8.111,0.000,54,55
-L28,3824748.905,426178.179,5069295.150,0.537,9.189,0.000,56,57
-L29,3824745.916,426185.477,5069296.734,8.140,11.815,0.000,58,59
-L30,3824747.299,426188.775,5069295.397,11.249,9.599,0.000,60,61
-L31,3824749.434,426190.255,5069293.660,12.463,6.719,0.000,62,63
-L32,3824755.660,426191.682,5069288.858,13.135,-1.244,0.000,64,65
-L33,3824757.536,426193.415,5069287.294,14.631,-3.838,0.000,66,67
-L34,3824762.485,426188.863,5069283.991,9.519,-9.315,0.000,68,69
-L35,3824765.146,426184.862,5069282.354,5.229,-12.028,0.000,70,71
-L36,3824768.090,426180.842,5069280.508,0.886,-15.089,0.000,72,73
-L37,3824767.059,426177.823,5069281.555,-1.988,-13.353,0.000,74,75
-L38,3824766.039,426173.332,5069282.726,-6.325,-11.411,0.000,76,77
-L39,3824762.861,426167.797,5069285.612,-11.440,-6.625,0.000,78,79
-L40,3824761.249,426165.985,5069286.986,-13.046,-4.347,0.000,80,81
-L41,3824757.052,426165.293,5069290.199,-13.231,0.980,0.000,82,83
-L42,3824753.985,426163.897,5069292.627,-14.251,5.007,0.000,84,85
-L43,3824748.117,426169.264,5069296.547,-8.220,11.506,0.000,86,87
-L44,3824746.389,426172.717,5069297.532,-4.585,13.139,0.000,88,89
-L45,3824744.702,426177.873,5069298.332,0.736,14.465,0.000,90,91
-L46,3824797.767,426196.371,5069256.828,12.753,-54.355,0.000,92,93
-L47,3824771.578,426127.521,5069282.709,-52.470,-11.436,0.000,94,95
-L48,3824741.909,426180.879,5069300.157,4.054,17.491,0.000,1,0
-L49,3824740.308,426183.312,5069301.138,6.661,19.119,0.000,3,2
-L50,3824747.005,426195.890,5069294.975,18.348,8.898,0.000,5,4
-L51,3824759.756,426197.538,5069285.255,18.459,-7.219,0.000,7,6
-L52,3824763.628,426196.320,5069282.458,16.786,-11.856,0.000,9,8
-L53,3824769.263,426186.091,5069279.153,5.957,-17.336,0.000,11,10
-L54,3824770.068,426172.845,5069279.746,-7.291,-16.352,0.000,13,12
-L55,3824769.115,426165.068,5069281.164,-14.898,-14.000,0.000,15,14
-L56,3824758.347,426160.579,5069289.653,-18.067,0.075,0.000,17,16
-L57,3824751.876,426159.794,5069294.581,-18.072,8.247,0.000,19,18
-L58,3824745.520,426166.203,5069298.773,-10.949,15.197,0.000,21,20
-L59,3824738.986,426167.377,5069303.571,-9.001,23.154,0.000,23,22
-L60,3824736.234,426180.064,5069304.490,3.924,24.677,0.000,25,24
-L61,3824738.651,426192.369,5069301.564,15.851,19.824,0.000,27,26
-L62,3824741.540,426197.285,5069298.951,20.386,15.491,0.000,29,28
-L63,3824746.388,426202.815,5069294.812,25.297,8.628,0.000,31,30
-L64,3824760.510,426201.502,5069284.331,22.304,-8.752,0.000,33,32
-L65,3824766.559,426198.541,5069280.058,18.641,-15.837,0.000,35,34
-L66,3824774.966,426188.968,5069274.612,8.131,-24.866,0.000,37,36
-L67,3824776.297,426174.822,5069274.892,-6.073,-24.401,0.000,39,38
-L68,3824774.960,426165.791,5069276.712,-14.879,-21.383,0.000,41,40
-L69,3824768.251,426158.060,5069282.446,-21.752,-11.874,0.000,43,42
-L70,3824756.734,426151.582,5069291.677,-26.806,3.432,0.000,45,44
-L71,3824743.207,426157.912,5069301.258,-18.903,19.319,0.000,47,46
-L72,3824732.524,426162.220,5069308.887,-13.348,31.969,0.000,49,48
-L73,3824731.238,426177.064,5069308.511,1.543,31.344,0.000,51,50
-L74,3824732.878,426191.367,5069305.988,15.547,27.159,0.000,53,52
-L75,3824734.915,426198.791,5069303.787,22.674,23.510,0.000,55,54
-L76,3824747.402,426208.591,5069293.528,30.910,6.499,0.000,57,56
-L77,3824761.510,426211.563,5069282.670,32.173,-11.506,0.000,59,58
-L78,3824770.649,426206.390,5069276.278,25.944,-22.104,0.000,61,60
-L79,3824773.817,426197.720,5069274.684,16.957,-24.748,0.000,63,62
-L80,3824782.343,426187.119,5069269.242,5.413,-33.770,0.000,65,64
-L81,3824782.529,426168.171,5069270.816,-13.422,-31.160,0.000,67,66
-L82,3824779.706,426160.148,5069273.660,-21.049,-26.444,0.000,69,68
-L83,3824771.441,426148.584,5069280.909,-31.542,-14.423,0.000,71,70
-L84,3824764.948,426147.606,5069285.870,-31.736,-6.196,0.000,73,72
-L85,3824748.480,426147.327,5069298.257,-30.043,14.343,0.000,75,74
-L86,3824744.699,426152.340,5069300.642,-24.614,18.297,0.000,77,76
-L87,3824741.206,426148.076,5069303.649,-28.429,23.284,0.000,79,78
-L88,3824722.788,426180.941,5069314.504,6.403,41.281,0.000,81,80
-L89,3824730.553,426204.070,5069306.584,28.437,28.148,0.000,83,82
-L90,3824741.994,426217.349,5069296.797,40.252,11.918,0.000,85,84
-L91,3824754.749,426218.735,5069287.097,40.102,-4.166,0.000,87,86
-L92,3824786.005,426194.178,5069265.856,11.983,-39.386,0.000,89,88
-L93,3824785.292,426171.958,5069268.399,-9.992,-35.168,0.000,91,90
-L94,3824784.871,426155.690,5069270.186,-26.093,-32.204,0.000,93,92
-L95,3824753.308,426140.271,5069295.271,-37.626,9.392,0.000,95,94
-H0,3824798.058,426125.046,5069263.168,-3.135,19.358,0.000,0,1
-H1,3824798.447,426130.126,5069262.418,1.862,18.113,0.000,2,3
-H2,3824798.836,426135.206,5069261.666,6.859,16.867,0.000,4,5
-H3,3824799.225,426140.286,5069260.915,11.856,15.621,0.000,6,7
-H4,3824802.165,426124.286,5069260.155,-4.381,14.361,0.000,8,9
-H5,3824802.553,426129.366,5069259.404,0.616,13.116,0.000,10,11
-H6,3824802.942,426134.446,5069258.653,5.613,11.870,0.000,12,13
-H7,3824803.331,426139.526,5069257.901,10.610,10.624,0.000,14,15
-H8,3824805.493,426113.366,5069258.644,-15.621,11.856,0.000,16,17
-H9,3824805.882,426118.446,5069257.892,-10.624,10.610,0.000,18,19
-H10,3824806.271,426123.526,5069257.141,-5.627,9.364,0.000,20,21
-H11,3824806.660,426128.606,5069256.390,-0.630,8.118,0.000,22,23
-H12,3824807.049,426133.686,5069255.639,4.367,6.873,0.000,24,25
-H13,3824807.438,426138.766,5069254.888,9.364,5.627,0.000,26,27
-H14,3824807.827,426143.846,5069254.137,14.361,4.381,0.000,28,29
-H15,3824808.216,426148.926,5069253.385,19.358,3.135,0.000,30,31
-H16,3824809.599,426112.606,5069255.630,-16.867,6.859,0.000,32,33
-H17,3824809.988,426117.686,5069254.879,-11.870,5.613,0.000,34,35
-H18,3824810.378,426122.766,5069254.127,-6.873,4.367,0.000,36,37
-H19,3824810.767,426127.846,5069253.376,-1.876,3.121,0.000,38,39
-H20,3824811.155,426132.926,5069252.625,3.121,1.876,0.000,40,41
-H21,3824811.544,426138.006,5069251.874,8.118,0.630,0.000,42,43
-H22,3824811.933,426143.087,5069251.123,13.116,-0.616,0.000,44,45
-H23,3824812.322,426148.167,5069250.372,18.113,-1.862,0.000,46,47
-H24,3824813.706,426111.845,5069252.616,-18.113,1.862,0.000,48,49
-H25,3824814.095,426116.925,5069251.865,-13.116,0.616,0.000,50,51
-H26,3824814.484,426122.006,5069251.114,-8.118,-0.630,0.000,52,53
-H27,3824814.873,426127.086,5069250.363,-3.121,-1.876,0.000,54,55
-H28,3824815.261,426132.166,5069249.612,1.876,-3.121,0.000,56,57
-H29,3824815.650,426137.246,5069248.861,6.873,-4.367,0.000,58,59
-H30,3824816.040,426142.326,5069248.109,11.870,-5.613,0.000,60,61
-H31,3824816.429,426147.406,5069247.358,16.867,-6.859,0.000,62,63
-H32,3824817.812,426111.086,5069249.603,-19.358,-3.135,0.000,64,65
-H33,3824818.201,426116.166,5069248.851,-14.361,-4.381,0.000,66,67
-H34,3824818.590,426121.246,5069248.100,-9.364,-5.627,0.000,68,69
-H35,3824818.979,426126.326,5069247.349,-4.367,-6.873,0.000,70,71
-H36,3824819.368,426131.406,5069246.598,0.630,-8.118,0.000,72,73
-H37,3824819.757,426136.486,5069245.847,5.627,-9.364,0.000,74,75
-H38,3824820.146,426141.566,5069245.096,10.624,-10.610,0.000,76,77
-H39,3824820.535,426146.646,5069244.344,15.621,-11.856,0.000,78,79
-H40,3824822.697,426120.486,5069245.087,-10.610,-10.624,0.000,80,81
-H41,3824823.086,426125.566,5069244.335,-5.613,-11.870,0.000,82,83
-H42,3824823.475,426130.646,5069243.584,-0.616,-13.116,0.000,84,85
-H43,3824823.863,426135.726,5069242.833,4.381,-14.361,0.000,86,87
-H44,3824826.803,426119.726,5069242.073,-11.856,-15.621,0.000,88,89
-H45,3824827.192,426124.806,5069241.322,-6.859,-16.867,0.000,90,91
-H46,3824827.581,426129.886,5069240.570,-1.862,-18.113,0.000,92,93
-H47,3824827.970,426134.966,5069239.820,3.135,-19.358,0.000,94,95
-CLBA,3824756.246,426178.523,5069289.608,0.000,0.000,0.000,-1,-1
-CHBA,3824813.014,426130.006,5069251.494,0.000,0.000,0.000,-1,-1
-0.000,0.000,0.000,0.000,0.000,0.000,0.000,-1,-1
-0.000,0.000,0.000,0.000,0.000,0.000,0.000,-1,-1
diff --git a/MAC/Deployment/data/Coordinates/data/hba-rotations.csv b/MAC/Deployment/data/Coordinates/data/hba-rotations.csv
index e2774cadeeee5cc84679947c3b241705921563fc..7ccb46d63c707815511ee218a2a62efede6286ab 100644
--- a/MAC/Deployment/data/Coordinates/data/hba-rotations.csv
+++ b/MAC/Deployment/data/Coordinates/data/hba-rotations.csv
@@ -45,7 +45,7 @@ RS410,44,
 RS503,78,
 RS508,26,
 RS509,40,
-DE601,196,
+DE601,-74,
 DE602,60,
 DE603,120,
 DE604,0,
diff --git a/MAC/Deployment/data/Coordinates/data/normal_vectors.dat b/MAC/Deployment/data/Coordinates/data/normal_vectors.dat
index 4ac30c04f16754bae6ac008224cb0523b897aee4..437de58fd4316118919097071e92742ce0ba1994 100644
--- a/MAC/Deployment/data/Coordinates/data/normal_vectors.dat
+++ b/MAC/Deployment/data/Coordinates/data/normal_vectors.dat
@@ -42,8 +42,6 @@ cs011, hba1, 0.598753, 0.072099, 0.797682
 cs006, lba , 0.598753, 0.072099, 0.797682
 cs006, hba0, 0.598753, 0.072099, 0.797682
 cs006, hba1, 0.598753, 0.072099, 0.797682
-rs310, lba , 0.601869, 0.064948, 0.795949
-rs310, hba , 0.601934, 0.064739, 0.795917
 rs407, lba , 0.598753, 0.072099, 0.797682
 rs407, hba , 0.598753, 0.072099, 0.797682
 rs508, lba , 0.593792, 0.070643, 0.801512
@@ -82,8 +80,6 @@ cs003, hba0, 0.598753, 0.072099, 0.797682
 cs003, hba1, 0.598753, 0.072099, 0.797682
 uk608, lba , 0.626845, -0.014960, 0.779000
 uk608, hba , 0.627506, -0.014332, 0.778480
-rs409, lba , 0.598753, 0.072099, 0.797682
-rs409, hba , 0.598753, 0.072099, 0.797682
 rs208, lba , 0.601735, 0.072879, 0.795364
 rs208, hba , 0.598753, 0.072099, 0.797682
 cs501, lba , 0.598753, 0.072099, 0.797682
diff --git a/MAC/Deployment/data/Coordinates/data/rotation_matrices.dat b/MAC/Deployment/data/Coordinates/data/rotation_matrices.dat
index 5d6af60f11e34c03ea39a64acfa7ca16cb9e3941..0f4945e5ab3f3303f52c8a0f72d78182acdf9754 100644
--- a/MAC/Deployment/data/Coordinates/data/rotation_matrices.dat
+++ b/MAC/Deployment/data/Coordinates/data/rotation_matrices.dat
@@ -42,8 +42,6 @@ cs011, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.095418
 cs006, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs006, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs006, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs310, lba , -0.1151008123, -0.7902562310, 0.6018694978, 0.9933358105, -0.0952140698, 0.0649480442, 0.0059808478, 0.6053340980, 0.7959490305
-rs310, hba , -0.1149710136, -0.7902260105, 0.6019340000, 0.9933497978, -0.0952104287, 0.0647391200, 0.0061518565, 0.6053741212, 0.7959173300
 rs407, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 rs407, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 rs508, lba , -0.1190892356, -0.7957570796, 0.5937915663, 0.9928832966, -0.0958768399, 0.0706426986, 0.0007164314, 0.5979785128, 0.8015118121
@@ -82,8 +80,6 @@ cs003, hba0, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.095418
 cs003, hba1, -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 uk608, lba , -0.0635635542, -0.7765468618, 0.6268449936, 0.9955010195, -0.0935622956, -0.0149605152, 0.0702665977, 0.6230738867, 0.7790003447
 uk608, hba , -0.0638438351, -0.7759896972, 0.6275061391, 0.9955165671, -0.0934951656, -0.0143324330, 0.0697906108, 0.6237777199, 0.7784796894
-rs409, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
-rs409, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 rs208, lba , -0.1198462583, -0.7896526923, 0.6017354069, 0.9927924178, -0.0951413524, 0.0728789281, -0.0002991213, 0.6061326163, 0.7953635407
 rs208, hba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
 cs501, lba , -0.1195951054, -0.7919544517, 0.5987530018, 0.9928227484, -0.0954186800, 0.0720990002, 0.0000330969, 0.6030782884, 0.7976820024
diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/DE601/de601-hba-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/DE601/de601-hba-solution.lisp
index 8301fdbbfd76de176c918e547b5c36ff4092abf6..8227db52bb4af5f1305e6ff48716f46c0f6f9bc8 100644
--- a/MAC/Deployment/data/Coordinates/vectors-and-matrices/DE601/de601-hba-solution.lisp
+++ b/MAC/Deployment/data/Coordinates/vectors-and-matrices/DE601/de601-hba-solution.lisp
@@ -1,12 +1,12 @@
-(discarded-points
-    NIL)
-(reduced-chi-squared 0.009967096579413644)
-(normal-vector               (0.6315838091894460 0.0768144370032466 0.7714929904002105))
-(normal-vector-uncertainties (0.0000019 0.0000032 0.0000015))
-(normal-vector-direction-uncertainties-arcsec :max  0.65 :rms  0.48 :avg  0.45)
-(reference-point :etrs (4034101.901 487012.401 4900230.210)
-                 :station-pqr (0.0 0.0 0.0))
-(station-pqr-to-etrs-matrix
-    #2A((-0.1198066951176159 -0.7659948264431504 0.6315838091894460)
-        (0.9927969402960025 -0.0919453659417217 0.0768144370032466)
-        (-0.0007688587789930 0.6362373578658382 0.7714929904002105)))
+(discarded-points
+    NIL)
+(reduced-chi-squared 0.009967096579413644)
+(normal-vector               (0.6315838091894460 0.0768144370032466 0.7714929904002105))
+(normal-vector-uncertainties (0.0000019 0.0000032 0.0000015))
+(normal-vector-direction-uncertainties-arcsec :max  0.65 :rms  0.48 :avg  0.45)
+(reference-point :etrs (4034101.143 487013.113 4900230.789)
+                 :station-pqr (0.0 0.0 0.0))
+(station-pqr-to-etrs-matrix
+    #2A((-0.1198066951176159 -0.7659948264431504 0.6315838091894460)
+        (0.9927969402960025 -0.0919453659417217 0.0768144370032466)
+        (-0.0007688587789930 0.6362373578658382 0.7714929904002105)))
diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/DE601/de601-lba-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/DE601/de601-lba-solution.lisp
index 5ab4802c75d7b4feccb7ad0398c689e5f3db5cf4..532e7b863e5995ad5dc28945b2c50a8716c029df 100644
--- a/MAC/Deployment/data/Coordinates/vectors-and-matrices/DE601/de601-lba-solution.lisp
+++ b/MAC/Deployment/data/Coordinates/vectors-and-matrices/DE601/de601-lba-solution.lisp
@@ -1,12 +1,12 @@
-(discarded-points
-    NIL)
-(reduced-chi-squared 0.000001820887470935997)
-(normal-vector               (0.6328271882340650 0.0780991312002186 0.7703442292333122))
-(normal-vector-uncertainties (0.0000120 0.0001073 0.0000108))
-(normal-vector-direction-uncertainties-arcsec :max 22.14 :rms 12.93 :avg  8.95)
-(reference-point :etrs (4034038.635 487026.223 4900280.057)
-                 :station-pqr (0.0 0.0 0.0))
-(station-pqr-to-etrs-matrix
-    #2A((-0.1214634322601195 -0.7647321881206433 0.6328271882340650)
-        (0.9925955422980562 -0.0928219139137982 0.0780991312002186)
-        (-0.0008509016506948 0.6376274560819920 0.7703442292333122)))
+(discarded-points
+    NIL)
+(reduced-chi-squared 0.000001820887470935997)
+(normal-vector               (0.6328271882340650 0.0780991312002186 0.7703442292333122))
+(normal-vector-uncertainties (0.0000120 0.0001073 0.0000108))
+(normal-vector-direction-uncertainties-arcsec :max 22.14 :rms 12.93 :avg  8.95)
+(reference-point :etrs (4034037.877 487026.935 4900280.635)
+                 :station-pqr (0.0 0.0 0.0))
+(station-pqr-to-etrs-matrix
+    #2A((-0.1214634322601195 -0.7647321881206433 0.6328271882340650)
+        (0.9925955422980562 -0.0928219139137982 0.0780991312002186)
+        (-0.0008509016506948 0.6376274560819920 0.7703442292333122)))
diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS310/rs310-hba-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS310/rs310-hba-solution.lisp
deleted file mode 100644
index a7777512a5c5ee24bc321964da86dfbbc4688110..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS310/rs310-hba-solution.lisp
+++ /dev/null
@@ -1,14 +0,0 @@
-(discarded-points
-    ("D144;3845395.650339911;413617.8581444614;5054781.564794847;0.015"))
-(reduced-chi-squared 2.0853094076394134)
-(normal-vector               (0.60193396 0.064739116 0.7959173))
-(normal-vector-uncertainties (0.0000675 0.0000893 0.0000507))
-(normal-vector-direction-uncertainties-arcsec :max 18.42 :rms 14.64 :avg 14.27)
-(reference-point :etrs (3845376.681 413616.239 5054796.080)
-                 :station-pqr (0.0 0.0 0.0))
-(station-pqr-to-etrs-matrix
-#2A((-0.114971013597106d0 -0.7902260104949447d0 0.601934)
-    (0.9933497977522893d0 -0.09521042870427743d0 0.06473912)
-    (0.0061518564629060605d0 0.6053741211872138d0 0.79591733)))
-
-
diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS310/rs310-lba-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS310/rs310-lba-solution.lisp
deleted file mode 100644
index 483fa7c2bbfc998e9a272d4c0e24d4221a46e60e..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS310/rs310-lba-solution.lisp
+++ /dev/null
@@ -1,13 +0,0 @@
-(discarded-points
-    ("A269;3845455.6096987273;413595.3853607485;5054737.870879395;0.03"))
-(reduced-chi-squared 0.47506430452999376)
-(normal-vector               (0.6018695 0.0649480 0.7959490))
-(normal-vector-uncertainties (0.0000277 0.0000342 0.0000209))
-(normal-vector-direction-uncertainties-arcsec :max  7.06 :rms  5.81 :avg  5.70)
-(reference-point :etrs (3845433.443 413580.563 5054755.909)
-                 :station-pqr (0.0 0.0 0.0))
-(station-pqr-to-etrs-matrix
-    #2A((-0.11510081231738079 -0.7902562310190007 0.6018694977646923)
-        (0.9933358105211705 -0.09521406982594748 0.06494804418478792)
-        (0.005980847776749336 0.6053340980341546 0.7959490305396747)))
-
diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS409/rs409-hba-core-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS409/rs409-hba-core-solution.lisp
deleted file mode 100644
index 8f58eb5d21e60c92d2023a06fb455d26b855d68d..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS409/rs409-hba-core-solution.lisp
+++ /dev/null
@@ -1,8 +0,0 @@
-(normal-vector (0.598753 0.072099 0.797682))
-(reference-point :etrs  (3824813.014 426130.006 5069251.494)
-                 :station-pqr (0.0 0.0 0.0))
-(station-pqr-to-etrs-matrix
-  #2A((-0.11959510541518863d0 -0.7919544517060547d0 0.5987530018160178d0)
-      (0.9928227483621251d0 -0.09541868004821492d0 0.07209900021867627d0)
-      (3.3096921454367496d-5 0.6030782883845335d0 0.7976820024193695d0)))
-
diff --git a/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS409/rs409-lba-core-solution.lisp b/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS409/rs409-lba-core-solution.lisp
deleted file mode 100644
index 89a76da8834abe37c4b1180c154192db3d613145..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/Coordinates/vectors-and-matrices/RS409/rs409-lba-core-solution.lisp
+++ /dev/null
@@ -1,8 +0,0 @@
-(normal-vector (0.598753 0.072099 0.797682))
-(reference-point :etrs  (3824756.246 426178.523 5069289.608)
-                 :station-pqr (0.0 0.0 0.0))
-(station-pqr-to-etrs-matrix
-  #2A((-0.11959510541518863d0 -0.7919544517060547d0 0.5987530018160178d0)
-      (0.9928227483621251d0 -0.09541868004821492d0 0.07209900021867627d0)
-      (3.3096921454367496d-5 0.6030782883845335d0 0.7976820024193695d0)))
-
diff --git a/MAC/Deployment/data/OTDB/Calibration.comp b/MAC/Deployment/data/OTDB/Calibration.comp
index c29c0addb26c3cc6d51f10283f493267ec0ede02..376a8ce1e4a9d793a95ab486158a8f7517982a07 100644
--- a/MAC/Deployment/data/OTDB/Calibration.comp
+++ b/MAC/Deployment/data/OTDB/Calibration.comp
@@ -6,8 +6,7 @@
 #--------------------------------------------------------------------------------------------------------
 node  Calibration  4.0.0  development 'node constraint'  "Calibration pipeline"
 
-#    name                          dir. type   unit   prun. vm   value                constr.  descr.
+#    name                    dir. type   unit   prun. vm   value                constr.  descr.
 #--------------------------------------------------------------------------------------------------------
-par  CalibratorSource              I    text   -      100   0    ''                   -        "Calibrator source for generation of instrument model"
-par  SkyModel                      I    text   -      100   0    ''                   -        "User-supplied sky model for generic calibration pipeline"
-par  exportCalibrationParameters   I    bool   -      100   0    'false'              -        "export the instrument model parameters using parmexportcal"
+par  CalibratorSource        I    text   -	100   0    ''                   -        "Calibrator source for generation of instrument model"
+par  SkyModel                I    text   -      100   0    ''                   -        "User-supplied sky model for generic calibration pipeline"
diff --git a/MAC/Deployment/data/OTDB/CoherentStokesBeam.comp b/MAC/Deployment/data/OTDB/CoherentStokesBeam.comp
index 0500359ce8db63f762b73c2ec89a5ac75e1a0ac2..945c5b7b2ccfe636d3ac751158dc429f4928875c 100644
--- a/MAC/Deployment/data/OTDB/CoherentStokesBeam.comp
+++ b/MAC/Deployment/data/OTDB/CoherentStokesBeam.comp
@@ -64,7 +64,7 @@ node  CoherentStokesBeam	4.0.0  development  	'node constraint'  "CoherentStokes
 #--------------------------------------------------------------------------------------------------------
 par  SAP		            O    uint   -      10    0    0      	-   'Index of SubArrayPointing'
 par  TAB 	   	    		O    uint   -      10    0    0      	- 	'Index of TiedArrayBeam within SubArrayPointing'
-par  samplingTime 	   	    O    dbl   	seconds      10    0    0      	- 	'Duration of one sample'
+par  samplingTime 	   	    O    dbl   	s      10    0    0      	- 	'Duration of one sample'
 par  dispersionMeasure     	O    dbl    -      10    0    0	     	-  	''
 par  nrSubbands            	O    uint   -      10    0    0	        -	''
 par  stationSubbands	   	O    vint   -      10    0    '[]'     	- 	'Index of subband on the station, selects freq. range'
diff --git a/MAC/Deployment/data/OTDB/DPPP.comp b/MAC/Deployment/data/OTDB/DPPP.comp
index f11d13c47ff97da970cc377b7a15bb51c8d52dc1..c0d7fe4e234503c533f7d5491f1014af8910cc95 100644
--- a/MAC/Deployment/data/OTDB/DPPP.comp
+++ b/MAC/Deployment/data/OTDB/DPPP.comp
@@ -193,7 +193,7 @@ node   DPPP        	 4.0.0  development 'node constraint'  "DPPP"
 par	steps		I		vtext	-	10		0	["aoflagger","averager"]	-	"Names of the steps to perform."
 par	showprogress	I		bool	-	10		0	F					-	"Show a progress bar?"
 par	showtimings	I		bool	-	10		0	F					-	"At the end the percentage of elapsed time each step took can be shown"
-par	checkparset	I		int	-	10            0	0					-	"Check if all parameters in parset are used? -1=no, 0=warn, 1=fatal"
+par	checkparset	I		bool	-	10		0	F					-	"Check if all parameters in parset are used?"
 par	uselogger	I		bool	-	100		0	T					-	"Use logging framework for messages?"
 uses	msin        	4.0.0	development 1	"Input MeasurementSet"
 uses	msout       	4.0.0	development 1	"Output MeasurementSet"
diff --git a/MAC/Deployment/data/OTDB/FlysEyeBeam.comp b/MAC/Deployment/data/OTDB/FlysEyeBeam.comp
index 337026f9808433a568f6e431a0d36851f7d6f7da..1055a53b2c904408f2b7617d72044c33f94e8b6a 100644
--- a/MAC/Deployment/data/OTDB/FlysEyeBeam.comp
+++ b/MAC/Deployment/data/OTDB/FlysEyeBeam.comp
@@ -39,7 +39,7 @@ node  FlysEyeBeam	4.0.0  development  	'node constraint'  "FlysEyeBeam specifica
 #--------------------------------------------------------------------------------------------------------
 par  SAP	             	O    uint   -      10    0    0      	-   'Index of SubArrayPointing'
 par  TAB 	   	    		O    uint   -      10    0    0      	- 	'Index of TiedArrayBeam within SubArrayPointing'
-par  samplingTime 	   	    O    dbl   	seconds      10    0    0      	- 	'Duration of one sample'
+par  samplingTime 	   	    O    dbl   	s      10    0    0      	- 	'Duration of one sample'
 par  dispersionMeasure     	O    dbl    -      10    0    0	    	-  	''
 par  nrSubbands             O    uint   -      10    0    0	        -	''
 par  stationSubbands	   	O    vint   -      10    0    '[]'    	- 	'Index of subband on the station, selects freq. range'
diff --git a/MAC/Deployment/data/OTDB/IncoherentStokesBeam.comp b/MAC/Deployment/data/OTDB/IncoherentStokesBeam.comp
index d47c31844973516814e90bc5a38b9a0aa2e829c1..c145cd44d4157a14cb99093ac655e8d9f60ac71f 100644
--- a/MAC/Deployment/data/OTDB/IncoherentStokesBeam.comp
+++ b/MAC/Deployment/data/OTDB/IncoherentStokesBeam.comp
@@ -38,7 +38,7 @@ node  IncoherentStokesBeam	4.0.0  development  	'node constraint'  "IncoherentSt
 #--------------------------------------------------------------------------------------------------------
 par  SAP		            O    uint   -      10    0    0      	-   'Index of SubArrayPointing'
 par  TAB 	   	    		O    uint   -      10    0    0      	- 	'Index of TiedArrayBeam within SubArrayPointing'
-par  samplingTime 	   	    O    dbl   	seconds      10    0    0      	- 	'Duration of one sample'
+par  samplingTime 	   	    O    dbl   	s      10    0    0      	- 	'Duration of one sample'
 par  dispersionMeasure     	O    dbl    -      10    0    0	     	-  	''
 par  nrSubbands          	O    uint   -      10    0    0	        -	''
 par  stationSubbands	   	O    vint   -      10    0    '[]'     	- 	'Index of subband on the station, selects freq. range'
diff --git a/MAC/Deployment/data/PVSS/License/471_3031_2_Astron_Gen_II_2_311.log b/MAC/Deployment/data/PVSS/License/471_3031_2_Astron_Gen_II_2_311.log
index 62d6007314b329be907571c78508a121bdc02b99..49fbf91ae450e860ea75d36893016cb295bd9c8f 100644
--- a/MAC/Deployment/data/PVSS/License/471_3031_2_Astron_Gen_II_2_311.log
+++ b/MAC/Deployment/data/PVSS/License/471_3031_2_Astron_Gen_II_2_311.log
@@ -29,65 +29,3 @@ distributed = 255
     ctrlext = 1
      update = 0
 
-
----------------------------------------------------
-[license]
-code        = "RS407C 20556792170"
-version     = 30800002
-sn          = "471_3031_2_Astron_Gen_II_2_311/5"
-date        = 2012.11.29;16:53:51,000 
-comment     = "Remote Station RS407"
-expire      = 0000.00.00;00:00:00,000 
-redundancy  = 0
-ui          = 2
-para        = 1
-dde         = 5
-event       = 1
-ios         = 4000
-ssi         = 0
-api         = 80
-excelreport = 5
-http        = 0
-infoserver  = 1000
-comcenter   = 5
-maintenance = 1
-scheduler   = 1
-recipe      = 1
-distributed = 255
-uifix       = 0
-parafix     = 0
-pararemote  = 0
-ctrlext     = 1
-update      = 0
-
-
----------------------------------------------------
-[license]
-code        = "RS407C 00474340129"
-version     = 31100002
-sn          = "471_3031_2_Astron_Gen_II_2_311/6"
-date        = 2012.11.29;17:02:49,000 
-comment     = "Remote Station RS407"
-expire      = 0000.00.00;00:00:00,000 
-redundancy  = 0
-ui          = 2
-para        = 1
-dde         = 5
-event       = 1
-ios         = 4000
-ssi         = 0
-api         = 80
-excelreport = 5
-http        = 0
-infoserver  = 1000
-comcenter   = 5
-maintenance = 1
-scheduler   = 1
-recipe      = 1
-distributed = 255
-uifix       = 0
-parafix     = 0
-pararemote  = 0
-ctrlext     = 1
-update      = 0
-
diff --git a/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt b/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt
index abb14e142eeecc7ad06fa096351706d199fb6064..d8932c70f5be4ec96d749fd14bd114ca1dca2fd7 100644
--- a/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt
+++ b/MAC/Deployment/data/PVSS/License/Astron_Station_1_shield.txt
@@ -1,5 +1,5 @@
 [license]
-code        = "dongleHost 40096567708"
+code        = "dongleHost 60318387154"
 version     = 31100002
 sn          = "471_3031_2_Astron_Gen_II_2_311"
 expire      = 0000.00.00;00:00:00,000 
@@ -25,5 +25,5 @@ pararemote  = 0
 ctrlext     = 1
 update      = 0
 licenseMax  = 100
-licenseLeft = 94
+licenseLeft = 96
 
diff --git a/MAC/Deployment/data/PVSS/License/RS407C_option.txt b/MAC/Deployment/data/PVSS/License/RS407C_option.txt
deleted file mode 100644
index 1c158ca6965fd2afd0fe22e56d5b5421aa501dab..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/PVSS/License/RS407C_option.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-[license]
-code          = "RS407C 22827928169"
-version       = 31100002
-comment       = "Remote Station RS407"
-sn            = "471_3031_2_Astron_Gen_II_2_311"
-expire        = 0000.00.00;00:00:00,000
-redundancy    = 0
-ui            = 2
-para          = 1
-dde           = 5
-event         = 1
-api           = 80
-excelreport   = 5
-http          = 0
-infoserver    = 1000
-ios           = 4000
-comcenter     = 5
-maintenance   = 1
-scheduler     = 1
-ssi           = 0
-recipe        = 1
-distributed   = 255
-uifix         = 0
-parafix       = 0
-pararemote    = 0
-ctrlext       = 1
-update        = 0
-
-
diff --git a/MAC/Deployment/data/PVSS/License/shield.RS407C.txt b/MAC/Deployment/data/PVSS/License/shield.RS407C.txt
deleted file mode 100644
index 1566906b255683712fc3c0dd8666d75ec4cc6820..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/PVSS/License/shield.RS407C.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-[license]
-code        = "RS407C 00474340129"
-version     = 31100002
-sn          = "471_3031_2_Astron_Gen_II_2_311/6"
-date        = 2012.11.29;17:02:49,000 
-comment     = "Remote Station RS407"
-expire      = 0000.00.00;00:00:00,000 
-redundancy  = 0
-ui          = 2
-para        = 1
-dde         = 5
-event       = 1
-ios         = 4000
-ssi         = 0
-api         = 80
-excelreport = 5
-http        = 0
-infoserver  = 1000
-comcenter   = 5
-maintenance = 1
-scheduler   = 1
-recipe      = 1
-distributed = 255
-uifix       = 0
-parafix     = 0
-pararemote  = 0
-ctrlext     = 1
-update      = 0
-
diff --git a/MAC/Deployment/data/PVSS/bin/create_db_files b/MAC/Deployment/data/PVSS/bin/create_db_files
index 78d727a4b7e9a9e893ebb9ef68253662889828a3..4654f5814f2e772ad094f10a63c9f2dececb1b24 100755
--- a/MAC/Deployment/data/PVSS/bin/create_db_files
+++ b/MAC/Deployment/data/PVSS/bin/create_db_files
@@ -1308,8 +1308,8 @@ elif [ "$DBTYPE" == "C" ]; then
    fi    
 else
    check_start_dir
-   configdir="../../"
-   dpdefdir="../data/"
+   configdir="../.."
+   dpdefdir="../data"
    STNNAME=$DBTYPENAME
 fi
 
@@ -1358,12 +1358,14 @@ rm -f ${TMP_FILE}
 
 # Creating the c++ header file is for development hosts, only; in that case
 # the $dpdefdir is an empty string
-(
+if [ "${dpdefdir}" == "" ]; then
+  (
 	echo -n "// This file was generated by $(basename $0) ${VERSION} on " ; date
 	echo	""
-) >${DESTDIR}/${CPP_HEADERFILE}
-create_cpp_headerfile ${INPUTFILE} ${DBTYPE}
-echo "created: ${DESTDIR}/${CPP_HEADERFILE}"
-#mkdir -p ../../../../installed/gnu_debug/include/Deployment/
-#cp ${DESTDIR}/${CPP_HEADERFILE} ../../../../installed/gnu_debug/include/Deployment/
+  ) >${DESTDIR}/${CPP_HEADERFILE}
+  create_cpp_headerfile ${INPUTFILE} ${DBTYPE}
+  echo "created: ${DESTDIR}/${CPP_HEADERFILE}"
+  mkdir -p ../../../../installed/gnu_debug/include/Deployment/
+  cp ${DESTDIR}/${CPP_HEADERFILE} ../../../../installed/gnu_debug/include/Deployment/
+fi
 
diff --git a/MAC/Deployment/data/PVSS/data/CEPbase.dpdef b/MAC/Deployment/data/PVSS/data/CEPbase.dpdef
index d5cec3c7ceb44192909c9034e09d3fad23077a4a..39a2e8b7245561712c7022f4ef4c19af579ad6f3 100644
--- a/MAC/Deployment/data/PVSS/data/CEPbase.dpdef
+++ b/MAC/Deployment/data/PVSS/data/CEPbase.dpdef
@@ -1,8 +1,14 @@
 # CEP PVSS Database base types
 
+TypeName
+ScriptInfo.ScriptInfo	1#
+	paramDone	23#
+
+
 # Create missing CtrlDbg internals and DP for remoteStation
 # Datapoint/DpId
 DpName	TypeName
+scriptInfo	ScriptInfo
 _CtrlDebug_CTRL_5	_CtrlDebug
 _CtrlDebug_CTRL_6	_CtrlDebug
 _CtrlDebug_CTRL_7	_CtrlDebug
@@ -13,5 +19,3 @@ _CtrlDebug_CTRL_9	_CtrlDebug
 # DpValue
 ElementName	TypeName	_original.._value
 scriptInfo.paramDone	ScriptInfo	0
-_ValueArchive_2.size.maxDpElGet	_ValueArchive	4000
-_ValueArchive_2.size.maxDpElSet	_ValueArchive	4000
diff --git a/MAC/Deployment/data/PVSS/data/IONode.dpdef b/MAC/Deployment/data/PVSS/data/IONode.dpdef
index cb448d06155e26701f1456d46029dc099123ca0e..e561b292d58f45c1e3c58dce4dcd0c692ed11196 100644
--- a/MAC/Deployment/data/PVSS/data/IONode.dpdef
+++ b/MAC/Deployment/data/PVSS/data/IONode.dpdef
@@ -10,18 +10,9 @@ usedStation	string
 usedIP		string
 usedMAC		string
 
-
-#
-# Next points are needed for dataparameterization Do not alter them unless you know what you are doing. tabs are essential in these
-#
 !# DpFunction
 !ElementName	TypeName	_dp_fct.._type	_dp_fct.._param	_dp_fct.._fct
 !_mp_IONode.usedStation	IONode	60	_mp_IONode.station0:_original.._value, _mp_IONode.station1:_original.._value, _mp_IONode.use2ndStation:_original.._value	"p3?p2:p1"	
 !_mp_IONode.usedIP	IONode	60	_mp_IONode.IP0:_original.._value, _mp_IONode.IP1:_original.._value, LOFAR_PIC_BGP.BGPSwitch:_original.._value	"p3?p2:p1"	
 !_mp_IONode.usedMAC	IONode	60	_mp_IONode.MAC0:_original.._value, _mp_IONode.MAC1:_original.._value, _mp_IONode.MACForeign:_original.._value, LOFAR_PIC_BGP.BGPSwitch:_original.._value, _mp_IONode.use2ndStation:_original.._value	"p5?p3:(p4?p2:p1)"	
-!
-!# DpValue
-!ElementName	TypeName	_original.._value
-!_dt_IONode.Leaf	_DynamicDatapoints	"_mp_IONode.usedStation:_dp_fct", "_mp_IONode.usedIP:_dp_fct", "_mp_IONode.usedMAC:_dp_fct"
-!_dt_IONode.DynamicAttribute	_DynamicDatapoints	"_da_none", "_da_none", "_da_none"
 !
\ No newline at end of file
diff --git a/MAC/Deployment/data/PVSS/data/MCUbase.dpdef b/MAC/Deployment/data/PVSS/data/MCUbase.dpdef
index dfd22f5bcbc712bdfd51133c820b37bf30d235f0..adac271a995c4aee34440179e012b0fc725bf083 100644
--- a/MAC/Deployment/data/PVSS/data/MCUbase.dpdef
+++ b/MAC/Deployment/data/PVSS/data/MCUbase.dpdef
@@ -145,7 +145,9 @@ GCFWatchDog.GCFWatchDog	1#
 	lastDownTime	10#
 	name	9#
 
-
+TypeName
+ScriptInfo.ScriptInfo	1#
+	paramDone	23#
 
 # create mps for NavPanelConfig , NavigatorUserSaves and NavigatorInstance
 # Datapoint/DpId 
@@ -164,18 +166,16 @@ __navigator	Navigator
 root	NavPanelConfig
 __gcf_cwd	GCFWatchDog
 rootSaves	NavigatorUserSaves
+scriptInfo	ScriptInfo
 _CtrlDebug_CTRL_5	_CtrlDebug
 _CtrlDebug_CTRL_6	_CtrlDebug
 _CtrlDebug_CTRL_7	_CtrlDebug
-_CtrlDebug_CTRL_8	_CtrlDebug
 
 
 #Fill some defaults
 # DpValue
 ElementName	TypeName	_original.._value
 scriptInfo.paramDone	ScriptInfo	0
-_ValueArchive_2.size.maxDpElGet	_ValueArchive	500
-_ValueArchive_2.size.maxDpElSet	_ValueArchive	500
 root.LOFAR_Processes	NavPanelConfig	"Processes/MainCU_Processes.pnl"
 root.LOFAR_Observations	NavPanelConfig	"Observations/Observations.pnl"
 root.StnLOFAR_Hardware	NavPanelConfig	"Hardware/Station.pnl"
diff --git a/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base b/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base
index d63395a9f834ce2820610c2000ac34eb6317d02a..d7ebb363914233dbd41e6fac09a91b27d68fd3c9 100644
--- a/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base
+++ b/MAC/Deployment/data/PVSS/data/PVSSDataPoints.base
@@ -37,8 +37,8 @@ LogProcessor			-		M	Y	LOFAR_PermSW_Daemons_LogProcessor
 ServiceBroker			- 		M	Y	LOFAR_PermSW_Daemons_ServiceBroker
 SASGateway			-		M	Y	LOFAR_PermSW_Daemons_SASGateway
 KeyValueLogger			-		M	Y	LOFAR_PermSW_Daemons_KeyValueLogger
-SoftwareMonitor			-		M	Y	LOFAR_PermSW_Daemons_SoftwareMonitor
 CTStartDaemon			-		M	Y	LOFAR_PermSW_CTStartDaemon
+SoftwareMonitor			-		M	Y	LOFAR_PermSW_SoftwareMonitor
 MACScheduler			MS		M	Y	LOFAR_PermSW_MACScheduler
 CRTriggerControl		CRT		M	Y	LOFAR_PermSW_CRTriggerControl
 ObsSW				-		M	N	LOFAR_ObsSW
@@ -63,14 +63,14 @@ OSRack				-		C	N	LOFAR_PIC_@osrack@
 LocusNode			LCN		C	Y	LOFAR_PIC_@osrack@_@locusnode@
 CEPPermSW			-		C	N	LOFAR_PermSW
 CEPHardwareMonitor		CHM		C	Y	LOFAR_PermSW_CEPHardwareMonitor
+SoftwareMonitor			-		C	Y	LOFAR_PermSW_SoftwareMonitor
 Daemons				-		C	N	LOFAR_PermSW_Daemons
 PVSS00pmon			-		C	Y	LOFAR_PermSW_Daemons_PVSS00pmon
 LogProcessor			-		C	Y	LOFAR_PermSW_Daemons_LogProcessor
 CEPlogProcessor			-		C	Y	LOFAR_PermSW_Daemons_CEPlogProcessor
 ServiceBroker			- 		C	Y	LOFAR_PermSW_Daemons_ServiceBroker
-SoftwareMonitor			-		C	Y	LOFAR_PermSW_Daemons_SoftwareMonitor
-SASGateway			-		C	Y	LOFAR_PermSW_Daemons_SASGateway
 CTStartDaemon			-		C	Y	LOFAR_PermSW_CTStartDaemon
+SASGateway			-		C	Y	LOFAR_PermSW_Daemons_SASGateway
 CEPObsSW			-		C	N	LOFAR_ObsSW
 CEPObservation			-		C	N	LOFAR_ObsSW_@observation@
 OnlineControl			-		C	N	LOFAR_ObsSW_@observation@_OnlineControl
@@ -96,15 +96,15 @@ Daemons				-		S	N	LOFAR_PermSW_Daemons
 PVSS00pmon			-		S	Y	LOFAR_PermSW_Daemons_PVSS00pmon
 LogProcessor			LGP		S	Y	LOFAR_PermSW_Daemons_LogProcessor
 ServiceBroker			- 		S	Y	LOFAR_PermSW_Daemons_ServiceBroker
-SASGateway			SGW		S	Y	LOFAR_PermSW_Daemons_SASGateway
-SoftwareMonitor			SWM		S	Y	LOFAR_PermSW_Daemons_SoftwareMonitor
 CTStartDaemon			-		S	Y	LOFAR_PermSW_CTStartDaemon
+SASGateway			SGW		S	Y	LOFAR_PermSW_Daemons_SASGateway
 RSPDriver			-		S	Y	LOFAR_PermSW_RSPDriver
 TBBDriver			-		S	Y	LOFAR_PermSW_TBBDriver
 AMCServer			-		S	Y	LOFAR_PermSW_AMCServer
 BeamServer			-		S	Y	LOFAR_PermSW_BeamServer
 CalServer			-		S	Y	LOFAR_PermSW_CalServer
 HardwareMonitor			HWM		S	Y	LOFAR_PermSW_HardwareMonitor
+SoftwareMonitor			SWM		S	Y	LOFAR_PermSW_SoftwareMonitor
 SHMInfoServer			MIS		S	Y	LOFAR_PermSW_SHMInfoServer
 StationControl			SC		S	Y	LOFAR_PermSW_StationControl
 ClockControl			CLC		S	Y	LOFAR_PermSW_ClockControl
diff --git a/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef b/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef
index 0d0b747aa585607b90a1fbacf29f85f867222d7c..cf9934add75c1b5f0cbea4208e257a726d304b65 100644
--- a/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef
+++ b/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef
@@ -1,4 +1,4 @@
-# Common types in Station, CCU and MainCU PVSS Database
+# Common types in Station and MainCU PVSS Database
 # Definition of some basic types
 
 # DpType
@@ -80,50 +80,25 @@ ProcessStatus.ProcessStatus	1#
 	error	25#
 	currentAction	25#
 
-Typename
-ScriptInfo.ScriptInfo	1#
-	claim	1#
-		debug	23#
-	gcf_cwd	1#
-		debug	23#
-	monitorAlarms	1#
-		debug	23#
-	monitorStateChanges	1#
-		debug	23#
-	monitorStateReset	1#
-		debug	23#
-	monitorStationAlarms	1#
-		debug	23#
-	readStationBGPconnections	1#
-		debug	23#
-		runDone	23#
-	readStationConfigs	1#
-		debug	23#
-		runDone	23#
-	transferMPs	1#
-		debug	23#
-		runDone	23#
-
 # create mp for ProcessStatus and attach an archive
-DpName	TypeName
-_mp_ProcessStatus	ProcessStatus
-_dt_ProcessStatus	_DynamicDatapoints
+DpName	TypeName	ID
+_mp_ProcessStatus	ProcessStatus	0
+_dt_ProcessStatus	_DynamicDatapoints	0
 
-ElementName	TypeName	_original.._value
-_dt_ProcessStatus.Leaf	_DynamicDatapoints	"_mp_ProcessStatus.logMsg:_archive"
-_dt_ProcessStatus.DynamicAttribute	_DynamicDatapoints	"_da_none"
+ElementName	TypeName	_original.._value	_original.._status
+_dt_ProcessStatus.Leaf	_DynamicDatapoints	"_mp_ProcessStatus.logMsg:_archive"	0x101
+_dt_ProcessStatus.DynamicAttribute	_DynamicDatapoints	"_da_none"	0x101
 
-ElementName	TypeName	DetailNr	_archive.._type	_archive.._archive	_archive.._class
-_mp_ProcessStatus.logMsg	ProcessStatus		45	1
-_mp_ProcessStatus.logMsg	ProcessStatus	1	15		_ValueArchive_2
+StampSec	StampMSec	ElementName	TypeName	DetailNr	_archive.._type	_archive.._archive	_archive.._class
+0	0	_mp_ProcessStatus.logMsg	ProcessStatus		45	1
+0	0	_mp_ProcessStatus.logMsg	ProcessStatus	1	15		_ValueArchive_2
 
 
 # create datapoints for ClaimManager,NCFObjectState and lofarSpeedTest
-DpName	TypeName
-ClaimManager	ClaimManager
-__navObjectState	NCFObjectState
-__resetObjectState	NCFObjectState
-lofarSpeedTest	LofarSpeedTest
-scriptInfo	ScriptInfo
+DpName	TypeName	ID
+ClaimManager	ClaimManager	0
+__navObjectState	NCFObjectState	0
+__resetObjectState	NCFObjectState	0
+lofarSpeedTest	LofarSpeedTest	0
 
 
diff --git a/MAC/Deployment/data/PVSS/data/SoftwareMonitor.dpdef b/MAC/Deployment/data/PVSS/data/SoftwareMonitor.dpdef
index 8c5118707f74fdc3d7c39b6c94821a8f0a1070a3..82564f4365bb59c826be3b77322f7392a6c7dfc4 100644
--- a/MAC/Deployment/data/PVSS/data/SoftwareMonitor.dpdef
+++ b/MAC/Deployment/data/PVSS/data/SoftwareMonitor.dpdef
@@ -1,16 +1,7 @@
 # SoftwareMonitor
 SWLevel		int
 
-#
-# Next points are needed for dataparameterization Do not alter them unless you know what you are doing. tabs are essential in these
-#
-
 !# DbArchiveInfo
-!ElementName			TypeName	DetailNr	_archive.._type	_archive.._archive	_archive.._class
-!_mp_SoftwareMonitor.SWLevel	SoftwareMonitor			45	1
+!ElementName			TypeName	DetailNr	_archive.._type	_archive.._archive
+!_mp_SoftwareMonitor.SWLevel	SoftwareMonitor	45		1
 !_mp_SoftwareMonitor.SWLevel	SoftwareMonitor	1		15		_ValueArchive_2
-!
-!# DpValue
-!ElementName	TypeName	_original.._value
-!_dt_SoftwareMonitor.Leaf	_DynamicDatapoints	"_mp_SoftwareMonitor.logMsg:_archive", "_mp_SoftwareMonitor.SWLevel:_archive"
-!_dt_SoftwareMonitor.DynamicAttribute	_DynamicDatapoints	"_da_none", "_da_none"
diff --git a/MAC/Deployment/data/PVSS/data/StationInfo.dpdef b/MAC/Deployment/data/PVSS/data/StationInfo.dpdef
index 4192317f04b36bbd482cf3b059a1a5d1c2841ccb..15b693cf3b18762bd47e09f1768740c58247f7ae 100644
--- a/MAC/Deployment/data/PVSS/data/StationInfo.dpdef
+++ b/MAC/Deployment/data/PVSS/data/StationInfo.dpdef
@@ -46,18 +46,10 @@ LBA.RotationMatrix.Y	floatArr
 LBA.RotationMatrix.Z	floatArr
 
 
-#
-# Next points are needed for dataparameterization Do not alter them unless you know what you are doing. tabs are essential in these
-#
-
 !# DbArchiveInfo
-!ElementName			TypeName	DetailNr	_archive.._type	_archive.._archive	_archive.._class
-!_mp_StationInfo.datastream0	SoftwareMonitor			45	1
+!ElementName			TypeName	DetailNr	_archive.._type	_archive.._archive
+!_mp_StationInfo.datastream0	SoftwareMonitor	45		1
 !_mp_StationInfo.datastream0	SoftwareMonitor	1		15		_ValueArchive_2
-!_mp_StationInfo.datastream1	SoftwareMonitor			45	1
+!_mp_StationInfo.datastream1	SoftwareMonitor	45		1
 !_mp_StationInfo.datastream1	SoftwareMonitor	1		15		_ValueArchive_2
-!
-!# DpValue
-!ElementName	TypeName	_original.._value
-!_dt_StationInfo.Leaf	_DynamicDatapoints	"_mp_StationInfo.datastream0:_archive", "_mp_StationInfo.datastream1:_archive"
-!_dt_StationInfo.DynamicAttribute	_DynamicDatapoints	"_da_none", "_da_none"
+!
\ No newline at end of file
diff --git a/MAC/Deployment/data/PVSS/data/Stationbase.dpdef b/MAC/Deployment/data/PVSS/data/Stationbase.dpdef
index 599997c10882dad9aba6e7d1adc00e2500190b6e..bfc18377da78a4aeb9fda7c9562d0acbc6d5d983 100644
--- a/MAC/Deployment/data/PVSS/data/Stationbase.dpdef
+++ b/MAC/Deployment/data/PVSS/data/Stationbase.dpdef
@@ -150,6 +150,10 @@ HBAElement.HBAElement	1#
 	comm	1#
 		status	41#:ObjectStatus
 
+TypeName
+ScriptInfo.ScriptInfo	1#
+	paramDone	23#
+
 
 
 # Create missing CtrlDbg internals and DP for remoteStation
@@ -158,19 +162,17 @@ DpName	TypeName
 __navigator	Navigator
 standalone	NavPanelConfig
 rootSaves	NavigatorUserSaves
+scriptInfo	ScriptInfo
 _CtrlDebug_CTRL_5	_CtrlDebug
 _CtrlDebug_CTRL_6	_CtrlDebug
 _CtrlDebug_CTRL_7	_CtrlDebug
 _CtrlDebug_CTRL_8	_CtrlDebug
 _CtrlDebug_CTRL_9	_CtrlDebug
-_CtrlDebug_CTRL_10	_CtrlDebug
 
 #Fill some defaults
 # DpValue
 ElementName	TypeName	_original.._value
 scriptInfo.paramDone	ScriptInfo	0
-_ValueArchive_2.size.maxDpElGet	_ValueArchive	500
-_ValueArchive_2.size.maxDpElSet	_ValueArchive	500
 standalone.StnLOFAR_Hardware	NavPanelConfig	"Hardware/Station.pnl"
 standalone.StnPIC_Hardware	NavPanelConfig	"Hardware/Station_Cabinet.pnl"
 standalone.Cabinet_Hardware	NavPanelConfig	"Hardware/Station_Cabinet_detailed.pnl"
diff --git a/MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf b/MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf
index bdd0afe5040cd127d47dc6423ce6c84842f15e2a..884e4bc40ec2613b9e956956e5eba1be80f3a985 100644
--- a/MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf
+++ b/MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf
@@ -1,7 +1,7 @@
 #
 # AntennaPositions for DE601
 # ITRF2005 target_date = 2012.5
-# Created: 2012-11-22 13:33:45
+# Created: 2012-11-08 20:42:18
 #
 
 NORMAL_VECTOR LBA
@@ -15,104 +15,104 @@ ROTATION_MATRIX LBA
 ]
 
 LBA
-3 [ 4034038.246510000 487026.564083000 4900280.329 ]
+3 [ 4034036.395510000 487026.791083000 4900279.047 ]
 96 x 2 x 3 [
- -5.288000 -12.331000   5.533000    -5.288000 -12.331000   5.533000 
- -9.261000  -5.634000   8.166000    -9.261000  -5.634000   8.166000 
- -8.262000 -12.056000   7.971000    -8.262000 -12.056000   7.971000 
--11.768000  -6.435001  10.300000   -11.768000  -6.435001  10.300000 
-  4.650000  19.186001  -5.692000     4.650000  19.186001  -5.692000 
-  1.108000  23.921001  -3.257000     1.108000  23.921001  -3.257000 
- 10.763000  21.388001 -10.931000    10.763000  21.388001 -10.931000 
-  8.633000  25.778001  -9.759000     8.633000  25.778001  -9.759000 
- -7.774000 -17.369000   8.081000    -7.774000 -17.369000   8.081000 
- -5.667000 -23.901000   6.986000    -5.667000 -23.901000   6.986000 
- -8.161000 -26.171000   9.251000    -8.161000 -26.171000   9.251000 
--11.074000 -24.307000  11.491000   -11.074000 -24.307000  11.491000 
-  1.072000   4.390001  -1.358000     1.072000   4.390001  -1.358000 
- -2.965000   2.415000   2.190000    -2.965000   2.415000   2.190000 
- -4.502000   5.270000   3.207000    -4.502000   5.270000   3.207000 
- -2.438000   9.113000   1.129000    -2.438000   9.113000   1.129000 
- -7.223000   5.675000   5.390000    -7.223000   5.675000   5.390000 
- -9.550000   1.830000   7.643000    -9.550000   1.830000   7.643000 
--11.915000  10.094999   8.781000   -11.915000  10.094999   8.781000 
--14.516000   7.012999  11.183000   -14.516000   7.012999  11.183000 
- 15.284000  -9.441998 -11.572000    15.284000  -9.441998 -11.572000 
- 13.572000 -17.998998  -9.391000    13.572000 -17.998998  -9.391000 
- 21.860000 -13.623998 -16.604990    21.860000 -13.623998 -16.604990 
- 16.312000 -22.824998 -11.105990    16.312000 -22.824998 -11.105990 
-  0.674000 -13.470999   0.741000     0.674000 -13.470999   0.741000 
- -1.618000 -16.209000   2.890000    -1.618000 -16.209000   2.890000 
-  3.266000 -16.407999  -1.049000     3.266000 -16.407999  -1.049000 
-  4.470000 -20.213999  -1.673000     4.470000 -20.213999  -1.673000 
- 14.822000   6.170002 -12.726000    14.822000   6.170002 -12.726000 
- 16.901000   8.819002 -14.721000    16.901000   8.819002 -14.721000 
- 19.780000  -0.610998 -16.055990    19.780000  -0.610998 -16.055990 
- 22.895000   3.520002 -19.072990    22.895000   3.520002 -19.072990 
--12.694000  13.947999   9.041000   -12.694000  13.947999   9.041000 
--10.543000  19.729000   6.727000   -10.543000  19.729000   6.727000 
--15.811000  27.357999  10.260000   -15.811000  27.357999  10.260000 
--18.369000  21.992999  12.902000   -18.369000  21.992999  12.902000 
-  4.765000   2.932001  -4.243000     4.765000   2.932001  -4.243000 
-  3.247000   8.369001  -3.523000     3.247000   8.369001  -3.523000 
-  7.679000   4.165001  -6.720000     7.679000   4.165001  -6.720000 
-  7.267000   7.887001  -6.747000     7.267000   7.887001  -6.747000 
--16.824000 -12.222001  15.033000   -16.824000 -12.222001  15.033000 
--18.612000  -2.338001  15.565000   -18.612000  -2.338001  15.565000 
--22.703000  -9.424001  19.601000   -22.703000  -9.424001  19.601000 
--23.549000   1.103998  19.256000   -23.549000   1.103998  19.256000 
-  5.316000  -3.566999  -4.033000     5.316000  -3.566999  -4.033000 
-  8.343000  -2.748999  -6.576000     8.343000  -2.748999  -6.576000 
-  5.662000  -8.333999  -3.805000     5.662000  -8.333999  -3.805000 
-  9.472000  -6.759999  -7.059000     9.472000  -6.759999  -7.059000 
- -0.494000  17.580000  -1.321000    -0.494000  17.580000  -1.321000 
- 15.835000  -2.775998 -12.627000    15.835000  -2.775998 -12.627000 
- -0.545000  28.476000  -2.406000    -0.545000  28.476000  -2.406000 
- -7.834000  19.906000   4.530000    -7.834000  19.906000   4.530000 
-  8.190000 -23.683999  -4.405000     8.190000 -23.683999  -4.405000 
- 24.213000  -6.743998 -19.154990    24.213000  -6.743998 -19.154990 
- -8.428000  27.454000   4.224000    -8.428000  27.454000   4.224000 
-  0.605000   7.736000  -1.278000     0.605000   7.736000  -1.278000 
--16.543000 -19.123001  15.513000   -16.543000 -19.123001  15.513000 
-  9.312000 -17.052999  -5.978000     9.312000 -17.052999  -5.978000 
- -2.680000 -19.840000   4.092000    -2.680000 -19.840000   4.092000 
- 20.839000  13.067002 -18.439990    20.839000  13.067002 -18.439990 
- 13.108000  -0.402998 -10.680000    13.108000  -0.402998 -10.680000 
-  9.505000 -13.248999  -6.470000     9.505000 -13.248999  -6.470000 
--15.326000  -2.025001  12.764000   -15.326000  -2.025001  12.764000 
- -5.265000  -0.691000   4.380000    -5.265000  -0.691000   4.380000 
-  3.318000  13.969001  -4.110000     3.318000  13.969001  -4.110000 
- -2.714000  -6.956000   2.874000    -2.714000  -6.956000   2.874000 
- 13.911000  13.407002 -12.798000    13.911000  13.407002 -12.798000 
- 10.517000   7.415001  -9.406000    10.517000   7.415001  -9.406000 
-  1.576000 -24.009999   1.036000     1.576000 -24.009999   1.036000 
- -0.540000 -25.801000   2.969000    -0.540000 -25.801000   2.969000 
-  1.111000  -4.963999  -0.397000     1.111000  -4.963999  -0.397000 
--13.439000 -10.610001  12.127000   -13.439000 -10.610001  12.127000 
-  9.961000   0.184001  -8.198000     9.961000   0.184001  -8.198000 
- -6.190000  15.126000   3.632000    -6.190000  15.126000   3.632000 
-  6.034000  13.740001  -6.351000     6.034000  13.740001  -6.351000 
- -5.658000  27.626000   1.904000    -5.658000  27.626000   1.904000 
-  0.181000  -9.929000   0.815000     0.181000  -9.929000   0.815000 
- 12.454000  -5.400999  -9.630000    12.454000  -5.400999  -9.630000 
--10.715000 -17.646000  10.488000   -10.715000 -17.646000  10.488000 
--19.002000   6.028999  15.012000   -19.002000   6.028999  15.012000 
--13.244000   2.433999  10.636000   -13.244000   2.433999  10.636000 
- -1.783000  21.665000  -0.644000    -1.783000  21.665000  -0.644000 
- -8.925000   9.693000   6.384000    -8.925000   9.693000   6.384000 
- -2.693000  -3.359000   2.511000    -2.693000  -3.359000   2.511000 
- 19.546000  -9.293998 -15.089990    19.546000  -9.293998 -15.089990 
-  3.994000  -0.342999  -3.287000     3.994000  -0.342999  -3.287000 
- 16.161000  22.502002 -15.590000    16.161000  22.502002 -15.590000 
- 11.707000  15.359001 -11.184000    11.707000  15.359001 -11.184000 
- -7.867000  -0.989000   6.529000    -7.867000  -0.989000   6.529000 
--23.202000  11.916998  17.899000   -23.202000  11.916998  17.899000 
- -4.880000  -8.856000   4.823000    -4.880000  -8.856000   4.823000 
- 10.654000 -24.621999  -6.308000    10.654000 -24.621999  -6.308000 
--16.401000  13.001999  12.172000   -16.401000  13.001999  12.172000 
-  2.429000  -8.072999  -1.199000     2.429000  -8.072999  -1.199000 
-  6.020000 -11.860999  -3.713000     6.020000 -11.860999  -3.713000 
- -3.493000  12.333000   1.680000    -3.493000  12.333000   1.680000 
+ -4.195000 -11.847000   7.394000    -4.195000 -11.847000   7.394000 
+ -8.169000  -5.149000  10.027000    -8.169000  -5.149000  10.027000 
+ -7.169000 -11.571000   9.832000    -7.169000 -11.571000   9.832000 
+-10.675000  -5.950001  12.161000   -10.675000  -5.950001  12.161000 
+  5.742000  19.671001  -3.831000     5.742000  19.671001  -3.831000 
+  2.200000  24.406000  -1.396000     2.200000  24.406000  -1.396000 
+ 11.855000  21.873001  -9.070000    11.855000  21.873001  -9.070000 
+  9.726000  26.263001  -7.899000     9.726000  26.263001  -7.899000 
+ -6.681000 -16.884000   9.941000    -6.681000 -16.884000   9.941000 
+ -4.574000 -23.416000   8.847000    -4.574000 -23.416000   8.847000 
+ -7.068000 -25.686000  11.112000    -7.068000 -25.686000  11.112000 
+ -9.981000 -23.822001  13.352000    -9.981000 -23.822001  13.352000 
+  2.165000   4.874000   0.503000     2.165000   4.874000   0.503000 
+ -1.872000   2.900000   4.051000    -1.872000   2.900000   4.051000 
+ -3.409000   5.754000   5.068000    -3.409000   5.754000   5.068000 
+ -1.345000   9.598000   2.990000    -1.345000   9.598000   2.990000 
+ -6.130000   6.160000   7.251000    -6.130000   6.160000   7.251000 
+ -8.457000   2.315000   9.503000    -8.457000   2.315000   9.503000 
+-10.823000  10.578999  10.642000   -10.823000  10.578999  10.642000 
+-13.424000   7.497999  13.044000   -13.424000   7.497999  13.044000 
+ 16.376000  -8.956998  -9.712000    16.376000  -8.956998  -9.712000 
+ 14.665000 -17.513998  -7.530000    14.665000 -17.513998  -7.530000 
+ 22.953000 -13.138998 -14.743990    22.953000 -13.138998 -14.743990 
+ 17.405000 -22.340998  -9.246000    17.405000 -22.340998  -9.246000 
+  1.766000 -12.986000   2.602000     1.766000 -12.986000   2.602000 
+ -0.525000 -15.724000   4.751000    -0.525000 -15.724000   4.751000 
+  4.359000 -15.923999   0.812000     4.359000 -15.923999   0.812000 
+  5.563000 -19.728999   0.188000     5.563000 -19.728999   0.188000 
+ 15.914000   6.655002 -10.865000    15.914000   6.655002 -10.865000 
+ 17.993000   9.304002 -12.861000    17.993000   9.304002 -12.861000 
+ 20.873000  -0.126998 -14.194990    20.873000  -0.126998 -14.194990 
+ 23.988000   4.005002 -17.212990    23.988000   4.005002 -17.212990 
+-11.601000  14.432999  10.902000   -11.601000  14.432999  10.902000 
+ -9.450000  20.213999   8.588000    -9.450000  20.213999   8.588000 
+-14.718000  27.842999  12.121000   -14.718000  27.842999  12.121000 
+-17.276000  22.477999  14.763000   -17.276000  22.477999  14.763000 
+  5.857000   3.417001  -2.383000     5.857000   3.417001  -2.383000 
+  4.339000   8.854001  -1.662000     4.339000   8.854001  -1.662000 
+  8.772000   4.649001  -4.859000     8.772000   4.649001  -4.859000 
+  8.360000   8.372001  -4.886000     8.360000   8.372001  -4.886000 
+-15.731000 -11.738001  16.893000   -15.731000 -11.738001  16.893000 
+-17.520000  -1.853001  17.426000   -17.520000  -1.853001  17.426000 
+-21.610000  -8.939002  21.461000   -21.610000  -8.939002  21.461000 
+-22.457000   1.588998  21.117000   -22.457000   1.588998  21.117000 
+  6.409000  -3.081999  -2.173000     6.409000  -3.081999  -2.173000 
+  9.436000  -2.264999  -4.715000     9.436000  -2.264999  -4.715000 
+  6.754000  -7.849999  -1.944000     6.754000  -7.849999  -1.944000 
+ 10.565000  -6.275999  -5.199000    10.565000  -6.275999  -5.199000 
+  0.599000  18.065000   0.540000     0.599000  18.065000   0.540000 
+ 16.928000  -2.290998 -10.766000    16.928000  -2.290998 -10.766000 
+  0.548000  28.961000  -0.545000     0.548000  28.961000  -0.545000 
+ -6.742000  20.391000   6.391000    -6.742000  20.391000   6.391000 
+  9.282000 -23.198999  -2.544000     9.282000 -23.198999  -2.544000 
+ 25.306000  -6.258998 -17.293990    25.306000  -6.258998 -17.293990 
+ -7.335000  27.939000   6.084000    -7.335000  27.939000   6.084000 
+  1.698000   8.221000   0.583000     1.698000   8.221000   0.583000 
+-15.450000 -18.638001  17.374000   -15.450000 -18.638001  17.374000 
+ 10.405000 -16.567999  -4.118000    10.405000 -16.567999  -4.118000 
+ -1.587000 -19.355000   5.953000    -1.587000 -19.355000   5.953000 
+ 21.932000  13.551002 -16.578990    21.932000  13.551002 -16.578990 
+ 14.201000   0.082001  -8.820000    14.201000   0.082001  -8.820000 
+ 10.598000 -12.763999  -4.609000    10.598000 -12.763999  -4.609000 
+-14.233000  -1.540001  14.625000   -14.233000  -1.540001  14.625000 
+ -4.172000  -0.207000   6.240000    -4.172000  -0.207000   6.240000 
+  4.411000  14.454001  -2.249000     4.411000  14.454001  -2.249000 
+ -1.621000  -6.471000   4.735000    -1.621000  -6.471000   4.735000 
+ 15.004000  13.892002 -10.937000    15.004000  13.892002 -10.937000 
+ 11.609000   7.899001  -7.545000    11.609000   7.899001  -7.545000 
+  2.668000 -23.524999   2.897000     2.668000 -23.524999   2.897000 
+  0.553000 -25.316000   4.829000     0.553000 -25.316000   4.829000 
+  2.204000  -4.479000   1.463000     2.204000  -4.479000   1.463000 
+-12.346000 -10.125001  13.988000   -12.346000 -10.125001  13.988000 
+ 11.053000   0.669001  -6.337000    11.053000   0.669001  -6.337000 
+ -5.098000  15.611000   5.493000    -5.098000  15.611000   5.493000 
+  7.127000  14.225001  -4.490000     7.127000  14.225001  -4.490000 
+ -4.565000  28.110000   3.765000    -4.565000  28.110000   3.765000 
+  1.274000  -9.445000   2.676000     1.274000  -9.445000   2.676000 
+ 13.547000  -4.915999  -7.769000    13.547000  -4.915999  -7.769000 
+ -9.622000 -17.161001  12.349000    -9.622000 -17.161001  12.349000 
+-17.909000   6.512999  16.872000   -17.909000   6.512999  16.872000 
+-12.151000   2.918999  12.497000   -12.151000   2.918999  12.497000 
+ -0.690000  22.150000   1.217000    -0.690000  22.150000   1.217000 
+ -7.832000  10.178000   8.245000    -7.832000  10.178000   8.245000 
+ -1.600000  -2.874000   4.372000    -1.600000  -2.874000   4.372000 
+ 20.638000  -8.809998 -13.229990    20.638000  -8.809998 -13.229990 
+  5.087000   0.142001  -1.426000     5.087000   0.142001  -1.426000 
+ 17.253000  22.986002 -13.729000    17.253000  22.986002 -13.729000 
+ 12.800000  15.844001  -9.323000    12.800000  15.844001  -9.323000 
+ -6.775000  -0.505000   8.390000    -6.775000  -0.505000   8.390000 
+-22.109000  12.401998  19.760000   -22.109000  12.401998  19.760000 
+ -3.787000  -8.371000   6.684000    -3.787000  -8.371000   6.684000 
+ 11.747000 -24.136999  -4.447000    11.747000 -24.136999  -4.447000 
+-15.308000  13.486999  14.033000   -15.308000  13.486999  14.033000 
+  3.521000  -7.587999   0.661000     3.521000  -7.587999   0.661000 
+  7.113000 -11.375999  -1.853000     7.113000 -11.375999  -1.853000 
+ -2.401000  12.817000   3.540000    -2.401000  12.817000   3.540000 
 ]
 
 NORMAL_VECTOR HBA
@@ -126,102 +126,102 @@ ROTATION_MATRIX HBA
 ]
 
 HBA
-3 [ 4034101.512510000 487012.742089000 4900230.482 ]
+3 [ 4034100.754510000 487013.454089000 4900231.061 ]
 96 x 2 x 3 [
- 20.808010 -15.324998 -15.499000    20.808010 -15.324998 -15.499000 
- 21.305010 -10.285998 -16.398000    21.305010 -10.285998 -16.398000 
- 21.802010  -5.241998 -17.294000    21.802010  -5.241998 -17.294000 
+ 20.808010 -15.324999 -15.499000    20.808010 -15.324999 -15.499000 
+ 21.305010 -10.285999 -16.399000    21.305010 -10.285999 -16.399000 
+ 21.802010  -5.241998 -17.295000    21.802010  -5.241998 -17.295000 
  22.288010  -0.198998 -18.197000    22.288010  -0.198998 -18.197000 
  22.776010   4.841002 -19.096000    22.776010   4.841002 -19.096000 
  16.351010 -19.412999 -11.455000    16.351010 -19.412999 -11.455000 
  16.852010 -14.368999 -12.355000    16.852010 -14.368999 -12.355000 
- 17.343010  -9.320999 -13.254000    17.343010  -9.320999 -13.254000 
- 17.842010  -4.273999 -14.159000    17.842010  -4.273999 -14.159000 
+ 17.343010  -9.320999 -13.255000    17.343010  -9.320999 -13.255000 
+ 17.842010  -4.274999 -14.159000    17.842010  -4.274999 -14.159000 
  18.326010   0.760001 -15.063000    18.326010   0.760001 -15.063000 
  18.827010   5.786001 -15.955000    18.827010   5.786001 -15.955000 
  19.317000  10.839001 -16.858000    19.317000  10.839001 -16.858000 
  11.894010 -23.508999  -7.425000    11.894010 -23.508999  -7.425000 
  12.394010 -18.456999  -8.332000    12.394010 -18.456999  -8.332000 
- 12.898010 -13.395999  -9.235000    12.898010 -13.395999  -9.235000 
- 13.392010  -8.355999 -10.119000    13.392010  -8.355999 -10.119000 
+ 12.898010 -13.395999  -9.236000    12.898010 -13.395999  -9.236000 
+ 13.392010  -8.355999 -10.120000    13.392010  -8.355999 -10.120000 
  13.875010  -3.311999 -11.017000    13.875010  -3.311999 -11.017000 
- 14.359010   1.721001 -11.921000    14.359010   1.721001 -11.921000 
+ 14.359010   1.721001 -11.922000    14.359010   1.721001 -11.922000 
  14.855000   6.744001 -12.818000    14.855000   6.744001 -12.818000 
- 15.351000  11.786001 -13.719000    15.351000  11.786001 -13.719000 
+ 15.351000  11.786001 -13.720000    15.351000  11.786001 -13.720000 
  15.834000  16.807001 -14.645000    15.834000  16.807001 -14.645000 
   7.934010 -22.554000  -4.271000     7.934010 -22.554000  -4.271000 
-  8.437010 -17.503000  -5.176000     8.437010 -17.503000  -5.176000 
-  8.934010 -12.440999  -6.092000     8.934010 -12.440999  -6.092000 
-  9.440010  -7.394999  -6.980000     9.440010  -7.394999  -6.980000 
-  9.928010  -2.358999  -7.882000     9.928010  -2.358999  -7.882000 
- 10.417010   2.678001  -8.790000    10.417010   2.678001  -8.790000 
- 10.902000   7.690001  -9.671000    10.902000   7.690001  -9.671000 
- 11.384000  12.720001 -10.561000    11.384000  12.720001 -10.561000 
+  8.437010 -17.503000  -5.177000     8.437010 -17.503000  -5.177000 
+  8.934010 -12.441000  -6.092000     8.934010 -12.441000  -6.092000 
+  9.440010  -7.395000  -6.980000     9.440010  -7.395000  -6.980000 
+  9.928010  -2.358999  -7.883000     9.928010  -2.358999  -7.883000 
+ 10.417000   2.678001  -8.791000    10.417000   2.678001  -8.791000 
+ 10.902000   7.690001  -9.672000    10.902000   7.690001  -9.672000 
+ 11.384000  12.720001 -10.562000    11.384000  12.720001 -10.562000 
  11.888000  17.759001 -11.479000    11.888000  17.759001 -11.479000 
-  3.984010 -21.600000  -1.127000     3.984010 -21.600000  -1.127000 
-  4.470010 -16.550000  -2.015000     4.470010 -16.550000  -2.015000 
+  3.984010 -21.600000  -1.128000     3.984010 -21.600000  -1.128000 
+  4.470010 -16.550000  -2.016000     4.470010 -16.550000  -2.016000 
   4.963010 -11.472000  -2.928000     4.963010 -11.472000  -2.928000 
-  5.466010  -6.434000  -3.830000     5.466010  -6.434000  -3.830000 
+  5.466010  -6.434000  -3.831000     5.466010  -6.434000  -3.831000 
   5.965010  -1.413000  -4.735000     5.965010  -1.413000  -4.735000 
   6.449000   3.622000  -5.627000     6.449000   3.622000  -5.627000 
   6.933000   8.641000  -6.516000     6.933000   8.641000  -6.516000 
   7.425000  13.669000  -7.410000     7.425000  13.669000  -7.410000 
-  7.925000  18.716000  -8.322000     7.925000  18.716000  -8.322000 
-  0.024010 -20.662000   2.036000     0.024010 -20.662000   2.036000 
-  0.507010 -15.606000   1.134000     0.507010 -15.606000   1.134000 
-  1.002010 -10.535000   0.229000     1.002010 -10.535000   0.229000 
-  1.491010  -5.481000  -0.670000     1.491010  -5.481000  -0.670000 
-  1.978000  -0.461000  -1.574000     1.978000  -0.461000  -1.574000 
-  2.471000   4.571000  -2.468000     2.471000   4.571000  -2.468000 
+  7.925000  18.716000  -8.323000     7.925000  18.716000  -8.323000 
+  0.024010 -20.662000   2.035000     0.024010 -20.662000   2.035000 
+  0.506010 -15.606000   1.134000     0.506010 -15.606000   1.134000 
+  1.002010 -10.535000   0.228000     1.002010 -10.535000   0.228000 
+  1.491010  -5.481000  -0.671000     1.491010  -5.481000  -0.671000 
+  1.978000  -0.461000  -1.575000     1.978000  -0.461000  -1.575000 
+  2.471000   4.571000  -2.469000     2.471000   4.571000  -2.469000 
   2.950000   9.595000  -3.354000     2.950000   9.595000  -3.354000 
-  3.449000  14.629000  -4.253000     3.449000  14.629000  -4.253000 
+  3.449000  14.629000  -4.254000     3.449000  14.629000  -4.254000 
   3.950000  19.678000  -5.195000     3.950000  19.678000  -5.195000 
  -3.953990 -19.714001   5.204000    -3.953990 -19.714001   5.204000 
  -3.467990 -14.631001   4.296000    -3.467990 -14.631001   4.296000 
- -2.968990  -9.565000   3.368000    -2.968990  -9.565000   3.368000 
- -2.467000  -4.525000   2.461000    -2.467000  -4.525000   2.461000 
- -1.964000   0.492000   1.564000    -1.964000   0.492000   1.564000 
+ -2.968990  -9.565001   3.368000    -2.968990  -9.565001   3.368000 
+ -2.467000  -4.525001   2.461000    -2.467000  -4.525001   2.461000 
+ -1.964000   0.492000   1.563000    -1.964000   0.492000   1.563000 
  -1.471000   5.519000   0.663000    -1.471000   5.519000   0.663000 
  -0.986000  10.537000  -0.217000    -0.986000  10.537000  -0.217000 
- -0.515000  15.563000  -1.104000    -0.515000  15.563000  -1.104000 
- -0.049000  20.637000  -2.040000    -0.049000  20.637000  -2.040000 
- -7.911990 -18.767001   8.358000    -7.911990 -18.767001   8.358000 
- -7.427990 -13.702001   7.446000    -7.427990 -13.702001   7.446000 
- -6.936990  -8.614001   6.532000    -6.936990  -8.614001   6.532000 
- -6.432000  -3.568001   5.627000    -6.432000  -3.568001   5.627000 
- -5.944000   1.450999   4.725000    -5.944000   1.450999   4.725000 
- -5.457000   6.481999   3.828000    -5.457000   6.481999   3.828000 
- -4.967000  11.488999   2.937000    -4.967000  11.488999   2.937000 
+ -0.515000  15.563000  -1.105000    -0.515000  15.563000  -1.105000 
+ -0.049000  20.637000  -2.041000    -0.049000  20.637000  -2.041000 
+ -7.911990 -18.768001   8.358000    -7.911990 -18.768001   8.358000 
+ -7.427990 -13.703001   7.446000    -7.427990 -13.703001   7.446000 
+ -6.936990  -8.614001   6.531000    -6.936990  -8.614001   6.531000 
+ -6.432000  -3.568001   5.626000    -6.432000  -3.568001   5.626000 
+ -5.944000   1.450999   4.724000    -5.944000   1.450999   4.724000 
+ -5.457000   6.481999   3.827000    -5.457000   6.481999   3.827000 
+ -4.967000  11.488999   2.936000    -4.967000  11.488999   2.936000 
  -4.470000  16.523999   2.032000    -4.470000  16.523999   2.032000 
  -4.001000  21.586999   1.087000    -4.001000  21.586999   1.087000 
 -11.875990 -17.809001  11.486000   -11.875990 -17.809001  11.486000 
--11.392990 -12.773001  10.589000   -11.392990 -12.773001  10.589000 
--10.907000  -7.687001   9.687000   -10.907000  -7.687001   9.687000 
+-11.392990 -12.773001  10.588000   -11.392990 -12.773001  10.588000 
+-10.907000  -7.687001   9.686000   -10.907000  -7.687001   9.686000 
 -10.402000  -2.627001   8.776000   -10.402000  -2.627001   8.776000 
- -9.901000   2.407999   7.867000    -9.901000   2.407999   7.867000 
+ -9.901000   2.407999   7.866000    -9.901000   2.407999   7.866000 
  -9.417000   7.426999   6.978000    -9.417000   7.426999   6.978000 
  -8.935000  12.445999   6.080000    -8.935000  12.445999   6.080000 
- -8.438000  17.501999   5.160000    -8.438000  17.501999   5.160000 
- -7.962000  22.533999   4.231000    -7.962000  22.533999   4.231000 
+ -8.438000  17.501999   5.159000    -8.438000  17.501999   5.159000 
+ -7.962000  22.533999   4.230000    -7.962000  22.533999   4.230000 
 -15.837990 -16.854002  14.637000   -15.837990 -16.854002  14.637000 
 -15.353000 -11.833002  13.739000   -15.353000 -11.833002  13.739000 
--14.868000  -6.736001  12.820000   -14.868000  -6.736001  12.820000 
--14.369000  -1.665001  11.915000   -14.369000  -1.665001  11.915000 
+-14.868000  -6.736002  12.820000   -14.868000  -6.736002  12.820000 
+-14.369000  -1.665002  11.915000   -14.369000  -1.665002  11.915000 
 -13.872000   3.345999  11.016000   -13.872000   3.345999  11.016000 
 -13.397000   8.345999  10.136000   -13.397000   8.345999  10.136000 
 -12.905000  13.404999   9.225000   -12.905000  13.404999   9.225000 
 -12.395000  18.469999   8.290000   -12.395000  18.469999   8.290000 
 -11.899000  23.503999   7.375000   -11.899000  23.503999   7.375000 
--19.300000 -10.876002  16.866000   -19.300000 -10.876002  16.866000 
--18.820000  -5.811002  15.956000   -18.820000  -5.811002  15.956000 
+-19.301000 -10.876002  16.865000   -19.301000 -10.876002  16.865000 
+-18.821000  -5.811002  15.955000   -18.821000  -5.811002  15.955000 
 -18.337000  -0.727002  15.059000   -18.337000  -0.727002  15.059000 
 -17.845000   4.298998  14.166000   -17.845000   4.298998  14.166000 
 -17.352000   9.289998  13.271000   -17.352000   9.289998  13.271000 
--16.843000  14.360998  12.345000   -16.843000  14.360998  12.345000 
--16.365000  19.422998  11.405000   -16.365000  19.422998  11.405000 
--22.772000  -4.894002  19.096000   -22.772000  -4.894002  19.096000 
+-16.844000  14.360998  12.345000   -16.844000  14.360998  12.345000 
+-16.365000  19.422998  11.404000   -16.365000  19.422998  11.404000 
+-22.772000  -4.894002  19.095000   -22.772000  -4.894002  19.095000 
 -22.292000   0.195998  18.197000   -22.292000   0.195998  18.197000 
 -21.792000   5.231998  17.306000   -21.792000   5.231998  17.306000 
--21.304000  10.241998  16.409000   -21.304000  10.241998  16.409000 
--20.819000  15.293998  15.500000   -20.819000  15.293998  15.500000 
+-21.304000  10.241998  16.408000   -21.304000  10.241998  16.408000 
+-20.819000  15.293998  15.499000   -20.819000  15.293998  15.499000 
 ]
diff --git a/MAC/Deployment/data/StaticMetaData/AntennaFields/RS310-AntennaField.conf b/MAC/Deployment/data/StaticMetaData/AntennaFields/RS310-AntennaField.conf
deleted file mode 100644
index d3353ad01cab9c9ee00cdfa0d89127147ea11814..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/StaticMetaData/AntennaFields/RS310-AntennaField.conf
+++ /dev/null
@@ -1,179 +0,0 @@
-#
-# AntennaPositions for RS310
-# ITRF2005 target_date = 2012.5
-# Created: 2012-12-04 12:46:44
-#
-
-NORMAL_VECTOR LBA
-3 [   0.601869   0.064948   0.795949 ]
-
-ROTATION_MATRIX LBA
-3 x 3 [
- -0.1151010000  -0.7902560000   0.6018690000 
-  0.9933360000  -0.0952140000   0.0649480000 
-  0.0059810000   0.6053340000   0.7959490000 
-]
-
-LBA
-3 [ 3845433.051930000 413580.888254000 5054756.170 ]
-96 x 2 x 3 [
-  0.000000   0.000000   0.000000     0.000000   0.000000   0.000000 
- -2.015000  -0.243000   1.544000    -2.015000  -0.243000   1.544000 
- -1.326000   2.106000   0.831000    -1.326000   2.106000   0.831000 
-  0.808000   2.364000  -0.804000     0.808000   2.364000  -0.804000 
-  2.015000   0.243000  -1.544000     2.015000   0.243000  -1.544000 
-  1.326000  -2.106000  -0.831000     1.326000  -2.106000  -0.831000 
- -0.808000  -2.364000   0.804000    -0.808000  -2.364000   0.804000 
- -2.009000  -5.085000   1.934000    -2.009000  -5.085000   1.934000 
- -4.222000  -2.119000   3.365000    -4.222000  -2.119000   3.365000 
- -4.459000   1.839000   3.222000    -4.459000   1.839000   3.222000 
- -2.610000   4.936000   1.571000    -2.610000   4.936000   1.571000 
-  0.461000   5.724000  -0.816000     0.461000   5.724000  -0.816000 
-  3.316000   3.833000  -2.820000     3.316000   3.833000  -2.820000 
-  4.619000   0.149001  -3.505000     4.619000   0.149001  -3.505000 
-  3.761000  -3.605000  -2.550000     3.761000  -3.605000  -2.550000 
-  1.143000  -5.672000  -0.401000     1.143000  -5.672000  -0.401000 
-  1.200000  -9.248000  -0.153000     1.200000  -9.248000  -0.153000 
- -1.699000  -9.516000   2.062000    -1.699000  -9.516000   2.062000 
- -5.431000  -7.411000   4.712000    -5.431000  -7.411000   4.712000 
- -8.003000  -0.750001   6.113000    -8.003000  -0.750001   6.113000 
- -7.961000   2.463999   5.819000    -7.961000   2.463999   5.819000 
- -6.541000   6.272000   4.434000    -6.541000   6.272000   4.434000 
- -3.611000   8.250000   2.058000    -3.611000   8.250000   2.058000 
-  0.965000   8.813000  -1.449000     0.965000   8.813000  -1.449000 
-  4.713000   7.650001  -4.188000     4.713000   7.650001  -4.188000 
-  7.102000   4.309001  -5.722000     7.102000   4.309001  -5.722000 
-  7.407000   0.378001  -5.632000     7.407000   0.378001  -5.632000 
-  6.522000  -4.272999  -4.583000     6.522000  -4.272999  -4.583000 
-  4.210000  -7.777999  -2.549000     4.210000  -7.777999  -2.549000 
-  0.744000 -14.315000   0.606000     0.744000 -14.315000   0.606000 
- -2.301000 -14.315000   2.908000    -2.301000 -14.315000   2.908000 
- -4.487000 -12.677000   4.427000    -4.487000 -12.677000   4.427000 
- -8.850000  -6.596001   7.230000    -8.850000  -6.596001   7.230000 
--11.070000  -5.354001   8.808000   -11.070000  -5.354001   8.808000 
--10.576000   2.056999   7.829000   -10.576000   2.056999   7.829000 
- -9.229000   6.745999   6.428000    -9.229000   6.745999   6.428000 
- -8.022000  11.748999   5.107000    -8.022000  11.748999   5.107000 
- -5.361000  12.003000   3.075000    -5.361000  12.003000   3.075000 
- -1.682000  12.936000   0.216000    -1.682000  12.936000   0.216000 
-  3.893000  12.010000  -3.924000     3.893000  12.010000  -3.924000 
-  6.027000  11.087001  -5.462000     6.027000  11.087001  -5.462000 
-  8.778000   6.866001  -7.198000     8.778000   6.866001  -7.198000 
- 11.410000   4.185001  -8.969000    11.410000   4.185001  -8.969000 
- 10.845000  -4.588999  -7.826000    10.845000  -4.588999  -7.826000 
-  9.375000  -8.021999  -6.435000     9.375000  -8.021999  -6.435000 
-  6.696000 -12.180999  -4.069000     6.696000 -12.180999  -4.069000 
--31.677000 -36.015002  26.891000   -31.677000 -36.015002  26.891000 
--30.387010  41.368998  19.601990   -30.387010  41.368998  19.601990 
-  6.113000 -16.561999  -3.271000     6.113000 -16.561999  -3.271000 
-  5.285000 -19.394999  -2.414000     5.285000 -19.394999  -2.414000 
- -7.099000 -17.856000   6.825000    -7.099000 -17.856000   6.825000 
--15.142000  -4.824001  11.844000   -15.142000  -4.824001  11.844000 
--16.388000  -0.087001  12.399000   -16.388000  -0.087001  12.399000 
--12.312000  10.637999   8.442000   -12.312000  10.637999   8.442000 
- -3.521000  17.511000   1.234000    -3.521000  17.511000   1.234000 
-  2.412000  20.005000  -3.456000     2.412000  20.005000  -3.456000 
- 11.361000  10.402001  -9.440000    11.361000  10.402001  -9.440000 
- 15.409000   3.764001 -11.959000    15.409000   3.764001 -11.959000 
- 14.382000  -6.009999 -10.385000    14.382000  -6.009999 -10.385000 
- 17.099000 -13.603998 -11.820000    17.099000 -13.603998 -11.820000 
-  9.751000 -22.325999  -5.551000     9.751000 -22.325999  -5.551000 
- -0.126000 -25.290000   2.159000    -0.126000 -25.290000   2.159000 
- -5.113000 -24.395000   5.857000    -5.113000 -24.395000   5.857000 
--11.587000 -21.662001  10.529000   -11.587000 -21.662001  10.529000 
--18.311000  -5.805001  14.320000   -18.311000  -5.805001  14.320000 
--19.521000   2.074999  14.592000   -19.521000   2.074999  14.592000 
--17.400000  15.497999  11.893000   -17.400000  15.497999  11.893000 
- -8.267000  23.345999   4.346000    -8.267000  23.345999   4.346000 
- -1.254000  25.993000  -1.173000    -1.254000  25.993000  -1.173000 
-  7.760000  22.246001  -7.683000     7.760000  22.246001  -7.683000 
- 18.501000  12.734002 -15.029000    18.501000  12.734002 -15.029000 
- 21.408000  -4.751998 -15.800000    21.408000  -4.751998 -15.800000 
- 24.185000 -18.248998 -16.799000    24.185000 -18.248998 -16.799000 
- 14.542000 -26.364999  -8.845000    14.542000 -26.364999  -8.845000 
-  3.693000 -31.075000  -0.257000     3.693000 -31.075000  -0.257000 
- -2.580000 -32.236000   4.581000    -2.580000 -32.236000   4.581000 
--16.160000 -23.183001  14.111000   -16.160000 -23.183001  14.111000 
--25.861000  -9.282002  20.312000   -25.861000  -9.282002  20.312000 
--27.200000   2.937998  20.328000   -27.200000   2.937998  20.328000 
--22.875000  10.290998  16.457000   -22.875000  10.290998  16.457000 
--20.103000  24.307998  13.218000   -20.103000  24.307998  13.218000 
- -7.005000  33.096000   2.596000    -7.005000  33.096000   2.596000 
-  0.109000  33.680000  -2.831000     0.109000  33.680000  -2.831000 
- 12.635000  29.987001 -12.001000    12.635000  29.987001 -12.001000 
- 16.827000  23.414002 -14.635000    16.827000  23.414002 -14.635000 
- 25.929000   5.743002 -20.075000    25.929000   5.743002 -20.075000 
- 24.482000  -0.614998 -18.463000    24.482000  -0.614998 -18.463000 
- 29.341000  -2.457997 -21.986000    29.341000  -2.457997 -21.986000 
- 16.413000 -37.254998  -9.371000    16.413000 -37.254998  -9.371000 
- -3.898000 -39.343000   6.158000    -3.898000 -39.343000   6.158000 
--19.334000 -32.996001  17.312000   -19.334000 -32.996001  17.312000 
--27.199000 -19.839002  22.186000   -27.199000 -19.839002  22.186000 
--26.999000  25.067998  18.371000   -26.999000  25.067998  18.371000 
--11.138000  34.365999   5.618000   -11.138000  34.365999   5.618000 
-  0.421000  41.282000  -3.687000     0.421000  41.282000  -3.687000 
- 28.232000  14.158003 -22.504000    28.232000  14.158003 -22.504000 
-]
-
-NORMAL_VECTOR HBA
-3 [   0.601934   0.064739   0.795917 ]
-
-ROTATION_MATRIX HBA
-3 x 3 [
- -0.1149710000  -0.7902260000   0.6019340000 
-  0.9933500000  -0.0952100000   0.0647390000 
-  0.0061520000   0.6053740000   0.7959170000 
-]
-
-HBA
-3 [ 3845376.289920000 413616.564249000 5054796.341 ]
-48 x 2 x 3 [
--11.541000  13.915999   7.596000   -11.541000  13.915999   7.596000 
- -7.793000  15.798000   4.609000    -7.793000  15.798000   4.609000 
- -4.044000  17.680000   1.620000    -4.044000  17.680000   1.620000 
- -0.295000  19.561000  -1.368000    -0.295000  19.561000  -1.368000 
- -9.851000   9.134000   6.707000    -9.851000   9.134000   6.707000 
- -6.102000  11.015000   3.719000    -6.102000  11.015000   3.719000 
- -2.353000  12.897000   0.731000    -2.353000  12.897000   0.731000 
-  1.396000  14.779000  -2.258000     1.396000  14.779000  -2.258000 
--15.657000   0.587999  11.793000   -15.657000   0.587999  11.793000 
--11.909000   2.469999   8.805000   -11.909000   2.469999   8.805000 
- -8.159000   4.351000   5.817000    -8.159000   4.351000   5.817000 
- -4.411000   6.233000   2.829000    -4.411000   6.233000   2.829000 
- -0.662000   8.115000  -0.159000    -0.662000   8.115000  -0.159000 
-  3.086000   9.996001  -3.147000     3.086000   9.996001  -3.147000 
-  6.836000  11.878001  -6.136000     6.836000  11.878001  -6.136000 
- 10.584000  13.758001  -9.124000    10.584000  13.758001  -9.124000 
--13.967000  -4.194001  10.904000   -13.967000  -4.194001  10.904000 
--10.217000  -2.313001   7.915000   -10.217000  -2.313001   7.915000 
- -6.469000  -0.431000   4.927000    -6.469000  -0.431000   4.927000 
- -2.720000   1.450000   1.939000    -2.720000   1.450000   1.939000 
-  1.029000   3.332000  -1.049000     1.029000   3.332000  -1.049000 
-  4.778000   5.214001  -4.037000     4.778000   5.214001  -4.037000 
-  8.526000   7.095001  -7.025000     8.526000   7.095001  -7.025000 
- 12.275000   8.977001 -10.014000    12.275000   8.977001 -10.014000 
--12.275000  -8.977001  10.014000   -12.275000  -8.977001  10.014000 
- -8.526000  -7.095000   7.025000    -8.526000  -7.095000   7.025000 
- -4.778000  -5.214000   4.037000    -4.778000  -5.214000   4.037000 
- -1.029000  -3.332000   1.049000    -1.029000  -3.332000   1.049000 
-  2.720000  -1.449999  -1.939000     2.720000  -1.449999  -1.939000 
-  6.469000   0.431001  -4.927000     6.469000   0.431001  -4.927000 
- 10.217000   2.313001  -7.915000    10.217000   2.313001  -7.915000 
- 13.967000   4.194002 -10.904000    13.967000   4.194002 -10.904000 
--10.584000 -13.758001   9.124000   -10.584000 -13.758001   9.124000 
- -6.836000 -11.878000   6.136000    -6.836000 -11.878000   6.136000 
- -3.086000  -9.996000   3.147000    -3.086000  -9.996000   3.147000 
-  0.662000  -8.115000   0.159000     0.662000  -8.115000   0.159000 
-  4.411000  -6.232999  -2.829000     4.411000  -6.232999  -2.829000 
-  8.159000  -4.350999  -5.817000     8.159000  -4.350999  -5.817000 
- 11.909000  -2.469999  -8.805000    11.909000  -2.469999  -8.805000 
- 15.657000  -0.587998 -11.793000    15.657000  -0.587998 -11.793000 
- -1.395990 -14.779000   2.258000    -1.395990 -14.779000   2.258000 
-  2.353010 -12.896999  -0.731000     2.353010 -12.896999  -0.731000 
-  6.102010 -11.014999  -3.719000     6.102010 -11.014999  -3.719000 
-  9.851010  -9.133999  -6.707000     9.851010  -9.133999  -6.707000 
-  0.295010 -19.561000   1.368000     0.295010 -19.561000   1.368000 
-  4.044010 -17.679999  -1.620000     4.044010 -17.679999  -1.620000 
-  7.793010 -15.797999  -4.609000     7.793010 -15.797999  -4.609000 
- 11.541010 -13.915999  -7.596000    11.541010 -13.915999  -7.596000 
-]
diff --git a/MAC/Deployment/data/StaticMetaData/AntennaFields/RS407-AntennaField.conf b/MAC/Deployment/data/StaticMetaData/AntennaFields/RS407-AntennaField.conf
index bc304d6e61f13abf2dc8afc5fc0cff00262fd094..1b8b9cbf4f6bbe54dab924363c9dad2936cd95f1 100644
--- a/MAC/Deployment/data/StaticMetaData/AntennaFields/RS407-AntennaField.conf
+++ b/MAC/Deployment/data/StaticMetaData/AntennaFields/RS407-AntennaField.conf
@@ -1,7 +1,7 @@
 #
 # AntennaPositions for RS407
 # ITRF2005 target_date = 2012.5
-# Created: 2012-11-30 15:19:23
+# Created: 2012-11-08 20:42:21
 #
 
 NORMAL_VECTOR LBA
@@ -127,7 +127,7 @@ ROTATION_MATRIX HBA
 
 HBA
 3 [ 3811649.455090000 453459.894384000 5076728.952 ]
-48 x 2 x 3 [
+47 x 2 x 3 [
 -14.143000  -7.545002  11.298000   -14.143000  -7.545002  11.298000 
 -14.329010  -2.408002  10.973000   -14.329010  -2.408002  10.973000 
 -14.515010   2.727998  10.649000   -14.515010   2.727998  10.649000 
@@ -169,7 +169,6 @@ HBA
   5.714990  12.772000  -5.444000     5.714990  12.772000  -5.444000 
   5.528990  17.909000  -5.769000     5.528990  17.909000  -5.769000 
  10.581000  -7.817999  -7.235000    10.581000  -7.817999  -7.235000 
- 10.394000  -2.682999  -7.560000    10.394000  -2.682999  -7.560000 
  10.209000   2.454001  -7.885000    10.209000   2.454001  -7.885000 
  10.021990   7.590001  -8.209000    10.021990   7.590001  -8.209000 
  14.702000  -7.864999 -10.324000    14.702000  -7.864999 -10.324000 
diff --git a/MAC/Deployment/data/StaticMetaData/AntennaFields/RS409-AntennaField.conf b/MAC/Deployment/data/StaticMetaData/AntennaFields/RS409-AntennaField.conf
deleted file mode 100644
index b1af4d8519d19fef86201f8245954653330b0e2b..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/StaticMetaData/AntennaFields/RS409-AntennaField.conf
+++ /dev/null
@@ -1,179 +0,0 @@
-#
-# AntennaPositions for RS409
-# ITRF2005 target_date = 2012.5
-# Created: 2012-11-26 21:32:24
-#
-
-NORMAL_VECTOR LBA
-3 [   0.598753   0.072099   0.797682 ]
-
-ROTATION_MATRIX LBA
-3 x 3 [
- -0.1195950000  -0.7919540000   0.5987530000 
-  0.9928230000  -0.0954190000   0.0720990000 
-  0.0000330000   0.6030780000   0.7976820000 
-]
-
-LBA
-3 [ 3824755.852950000 426178.846504000 5069289.868 ]
-96 x 2 x 3 [
-  0.000000   0.000000   0.000000     0.000000   0.000000   0.000000 
- -2.019000  -0.243000   1.538000    -2.019000  -0.243000   1.538000 
- -1.338000   2.105000   0.814000    -1.338000   2.105000   0.814000 
-  0.800000   2.363000  -0.814000     0.800000   2.363000  -0.814000 
-  2.019000   0.243000  -1.538000     2.019000   0.243000  -1.538000 
-  1.338000  -2.105000  -0.814000     1.338000  -2.105000  -0.814000 
- -0.800000  -2.363000   0.814000    -0.800000  -2.363000   0.814000 
- -2.637000   4.933000   1.534000    -2.637000   4.933000   1.534000 
-  0.438000   5.721000  -0.846000     0.438000   5.721000  -0.846000 
-  3.308000   3.832000  -2.830000     3.308000   3.832000  -2.830000 
-  4.631000   0.150000  -3.489000     4.631000   0.150000  -3.489000 
-  3.786000  -3.602000  -2.516000     3.786000  -3.602000  -2.516000 
-  1.170000  -5.669000  -0.366000     1.170000  -5.669000  -0.366000 
- -1.993000  -5.083000   1.956000    -1.993000  -5.083000   1.956000 
- -4.224000  -2.119000   3.362000    -4.224000  -2.119000   3.362000 
- -4.479000   1.836000   3.196000    -4.479000   1.836000   3.196000 
- -7.000000   3.712999   4.919000    -7.000000   3.712999   4.919000 
- -5.871000   6.998999   3.774000    -5.871000   6.998999   3.774000 
- -2.707000   9.899000   1.137000    -2.707000   9.899000   1.137000 
-  3.111000   9.074000  -3.155000     3.111000   9.074000  -3.155000 
-  5.335000   7.287000  -4.663000     5.335000   7.287000  -4.663000 
-  7.349000   3.685001  -5.849000     7.349000   3.685001  -5.849000 
-  7.398000  -0.559999  -5.503000     7.398000  -0.559999  -5.503000 
-  5.713000  -5.823000  -3.762000     5.713000  -5.823000  -3.762000 
-  3.200000  -9.252000  -1.566000     3.200000  -9.252000  -1.566000 
- -0.217000 -10.029000   1.070000    -0.217000 -10.029000   1.070000 
- -3.100000  -8.228000   3.071000    -3.100000  -8.228000   3.071000 
- -5.945000  -4.747001   4.891000    -5.945000  -4.747001   4.891000 
- -7.341000  -0.344001   5.542000    -7.341000  -0.344001   5.542000 
--10.330000   6.953999   7.126000   -10.330000   6.953999   7.126000 
- -8.947000  10.251999   5.789000    -8.947000  10.251999   5.789000 
- -6.812000  11.731999   4.052000    -6.812000  11.731999   4.052000 
- -0.586000  13.159000  -0.750000    -0.586000  13.159000  -0.750000 
-  1.290000  14.892000  -2.314000     1.290000  14.892000  -2.314000 
-  6.239000  10.340000  -5.617000     6.239000  10.340000  -5.617000 
-  8.900000   6.339001  -7.254000     8.900000   6.339001  -7.254000 
- 11.844000   2.319001  -9.100000    11.844000   2.319001  -9.100000 
- 10.813000  -0.699999  -8.053000    10.813000  -0.699999  -8.053000 
-  9.793000  -5.190999  -6.882000     9.793000  -5.190999  -6.882000 
-  6.615000 -10.725999  -3.996000     6.615000 -10.725999  -3.996000 
-  5.003000 -12.538000  -2.622000     5.003000 -12.538000  -2.622000 
-  0.806000 -13.230000   0.591000     0.806000 -13.230000   0.591000 
- -2.261000 -14.626000   3.019000    -2.261000 -14.626000   3.019000 
- -8.129000  -9.259001   6.939000    -8.129000  -9.259001   6.939000 
- -9.857000  -5.806001   7.924000    -9.857000  -5.806001   7.924000 
--11.544000  -0.650001   8.724000   -11.544000  -0.650001   8.724000 
- 41.521000  17.848003 -32.780000    41.521000  17.848003 -32.780000 
- 15.332010 -51.001999  -6.899000    15.332010 -51.001999  -6.899000 
--14.337000   2.355999  10.549000   -14.337000   2.355999  10.549000 
--15.938000   4.788999  11.530000   -15.938000   4.788999  11.530000 
- -9.241000  17.366999   5.367000    -9.241000  17.366999   5.367000 
-  3.510000  19.015000  -4.353000     3.510000  19.015000  -4.353000 
-  7.382000  17.797001  -7.150000     7.382000  17.797001  -7.150000 
- 13.017000   7.568001 -10.455000    13.017000   7.568001 -10.455000 
- 13.822000  -5.677999  -9.862000    13.822000  -5.677999  -9.862000 
- 12.869000 -13.454999  -8.444000    12.869000 -13.454999  -8.444000 
-  2.101000 -17.944000   0.045000     2.101000 -17.944000   0.045000 
- -4.370000 -18.729000   4.973000    -4.370000 -18.729000   4.973000 
--10.726000 -12.320001   9.165000   -10.726000 -12.320001   9.165000 
--17.260000 -11.146001  13.963000   -17.260000 -11.146001  13.963000 
--20.012000   1.540998  14.882000   -20.012000   1.540998  14.882000 
--17.595000  13.845998  11.956000   -17.595000  13.845998  11.956000 
--14.706000  18.761999   9.343000   -14.706000  18.761999   9.343000 
- -9.858000  24.291999   5.204000    -9.858000  24.291999   5.204000 
-  4.264000  22.979000  -5.277000     4.264000  22.979000  -5.277000 
- 10.313000  20.018001  -9.550000    10.313000  20.018001  -9.550000 
- 18.720000  10.445002 -14.996000    18.720000  10.445002 -14.996000 
- 20.051000  -3.700998 -14.716000    20.051000  -3.700998 -14.716000 
- 18.714000 -12.731998 -12.896000    18.714000 -12.731998 -12.896000 
- 12.005000 -20.462999  -7.162000    12.005000 -20.462999  -7.162000 
-  0.488000 -26.941000   2.069000     0.488000 -26.941000   2.069000 
--13.039000 -20.611001  11.650000   -13.039000 -20.611001  11.650000 
--23.722000 -16.303002  19.279000   -23.722000 -16.303002  19.279000 
--25.008000  -1.459002  18.903000   -25.008000  -1.459002  18.903000 
--23.368000  12.843998  16.380000   -23.368000  12.843998  16.380000 
--21.331000  20.267998  14.179000   -21.331000  20.267998  14.179000 
- -8.844000  30.067999   3.920000    -8.844000  30.067999   3.920000 
-  5.264000  33.040000  -6.938000     5.264000  33.040000  -6.938000 
- 14.403000  27.867001 -13.330000    14.403000  27.867001 -13.330000 
- 17.571000  19.197001 -14.924000    17.571000  19.197001 -14.924000 
- 26.097000   8.596002 -20.366000    26.097000   8.596002 -20.366000 
- 26.283000 -10.351998 -18.792000    26.283000 -10.351998 -18.792000 
- 23.460000 -18.374998 -15.948000    23.460000 -18.374998 -15.948000 
- 15.195000 -29.938999  -8.699000    15.195000 -29.938999  -8.699000 
-  8.702000 -30.916999  -3.738000     8.702000 -30.916999  -3.738000 
- -7.766000 -31.196001   8.649000    -7.766000 -31.196001   8.649000 
--11.547000 -26.183001  11.034000   -11.547000 -26.183001  11.034000 
--15.040000 -30.447001  14.041000   -15.040000 -30.447001  14.041000 
--33.458000   2.417997  24.896000   -33.458000   2.417997  24.896000 
--25.693000  25.546998  16.976000   -25.693000  25.546998  16.976000 
--14.252000  38.825999   7.189000   -14.252000  38.825999   7.189000 
- -1.497000  40.212000  -2.511000    -1.497000  40.212000  -2.511000 
- 29.759000  15.655002 -23.752000    29.759000  15.655002 -23.752000 
- 29.046000  -6.564998 -21.209000    29.046000  -6.564998 -21.209000 
- 28.625000 -22.832998 -19.422000    28.625000 -22.832998 -19.422000 
- -2.938000 -38.252000   5.663000    -2.938000 -38.252000   5.663000 
-]
-
-NORMAL_VECTOR HBA
-3 [   0.598753   0.072099   0.797682 ]
-
-ROTATION_MATRIX HBA
-3 x 3 [
- -0.1195950000  -0.7919540000   0.5987530000 
-  0.9928230000  -0.0954190000   0.0720990000 
-  0.0000330000   0.6030780000   0.7976820000 
-]
-
-HBA
-3 [ 3824812.620960000 426130.329509000 5069251.754 ]
-48 x 2 x 3 [
--14.956000  -4.960001  11.674000   -14.956000  -4.960001  11.674000 
--14.567000   0.119999  10.924000   -14.567000   0.119999  10.924000 
--14.178000   5.199999  10.172000   -14.178000   5.199999  10.172000 
--13.789000  10.279999   9.421000   -13.789000  10.279999   9.421000 
--10.849000  -5.720001   8.661000   -10.849000  -5.720001   8.661000 
--10.461000  -0.640001   7.910000   -10.461000  -0.640001   7.910000 
--10.072000   4.439999   7.159000   -10.072000   4.439999   7.159000 
- -9.683000   9.519999   6.407000    -9.683000   9.519999   6.407000 
- -7.521000 -16.640001   7.150000    -7.521000 -16.640001   7.150000 
- -7.132000 -11.560001   6.398000    -7.132000 -11.560001   6.398000 
- -6.743000  -6.480001   5.647000    -6.743000  -6.480001   5.647000 
- -6.354000  -1.400001   4.896000    -6.354000  -1.400001   4.896000 
- -5.965000   3.679999   4.145000    -5.965000   3.679999   4.145000 
- -5.576000   8.759999   3.394000    -5.576000   8.759999   3.394000 
- -5.187000  13.839999   2.643000    -5.187000  13.839999   2.643000 
- -4.798000  18.919999   1.891000    -4.798000  18.919999   1.891000 
- -3.415000 -17.400000   4.136000    -3.415000 -17.400000   4.136000 
- -3.026000 -12.320000   3.385000    -3.026000 -12.320000   3.385000 
- -2.636000  -7.240000   2.633000    -2.636000  -7.240000   2.633000 
- -2.247000  -2.160000   1.882000    -2.247000  -2.160000   1.882000 
- -1.859000   2.920000   1.131000    -1.859000   2.920000   1.131000 
- -1.470000   8.000000   0.380000    -1.470000   8.000000   0.380000 
- -1.081000  13.081000  -0.371000    -1.081000  13.081000  -0.371000 
- -0.692000  18.161000  -1.122000    -0.692000  18.161000  -1.122000 
-  0.692000 -18.161000   1.122000     0.692000 -18.161000   1.122000 
-  1.081000 -13.081000   0.371000     1.081000 -13.081000   0.371000 
-  1.470000  -8.000000  -0.380000     1.470000  -8.000000  -0.380000 
-  1.859000  -2.920000  -1.131000     1.859000  -2.920000  -1.131000 
-  2.247000   2.160000  -1.882000     2.247000   2.160000  -1.882000 
-  2.636000   7.240000  -2.633000     2.636000   7.240000  -2.633000 
-  3.026000  12.320000  -3.385000     3.026000  12.320000  -3.385000 
-  3.415000  17.400000  -4.136000     3.415000  17.400000  -4.136000 
-  4.798000 -18.920000  -1.891000     4.798000 -18.920000  -1.891000 
-  5.187000 -13.840000  -2.643000     5.187000 -13.840000  -2.643000 
-  5.576000  -8.760000  -3.394000     5.576000  -8.760000  -3.394000 
-  5.965000  -3.680000  -4.145000     5.965000  -3.680000  -4.145000 
-  6.354000   1.400000  -4.896000     6.354000   1.400000  -4.896000 
-  6.743000   6.480000  -5.647000     6.743000   6.480000  -5.647000 
-  7.132000  11.560000  -6.398000     7.132000  11.560000  -6.398000 
-  7.521000  16.640000  -7.150000     7.521000  16.640000  -7.150000 
-  9.683000  -9.519999  -6.407000     9.683000  -9.519999  -6.407000 
- 10.072000  -4.439999  -7.159000    10.072000  -4.439999  -7.159000 
- 10.461000   0.640001  -7.910000    10.461000   0.640001  -7.910000 
- 10.849000   5.720001  -8.661000    10.849000   5.720001  -8.661000 
- 13.789000 -10.279999  -9.421000    13.789000 -10.279999  -9.421000 
- 14.178000  -5.199999 -10.172000    14.178000  -5.199999 -10.172000 
- 14.567000  -0.119999 -10.924000    14.567000  -0.119999 -10.924000 
- 14.956000   4.960001 -11.674000    14.956000   4.960001 -11.674000 
-]
diff --git a/MAC/Deployment/data/StaticMetaData/StationInfo.dat b/MAC/Deployment/data/StaticMetaData/StationInfo.dat
index 4f842649958033700a5942e45ab4ef8aed8d3276..71c301f53c9e39b6093c423b4935404fcea46660 100644
--- a/MAC/Deployment/data/StaticMetaData/StationInfo.dat
+++ b/MAC/Deployment/data/StaticMetaData/StationInfo.dat
@@ -134,7 +134,7 @@ RS405	165    R    0.0          0.0             0       12     6    96    48    N
 RS406	166    R    6.7505064    53.0183578      65.62   12     6    96    48    No       Yes
 RS407	167    R    6.7848725    53.0923619      49.64   12     6    96    48    No       Yes
 RS408	168    R    0.0          0.0             0       12     6    96    48    No       Yes
-RS409	169    R    6.3574842    52.9804722      59.65   12     6    96    48    No       Yes
+RS409	169    R    6.32235      53.01043        0       12     6    96    48    No       Yes
 RS410	170    R    5.83021      52.99421        0       12     6    96    48    No       Yes
 RS411   171    R    6.692146     53.040486       0       12     6    96    48    No       Yes
 RS412   172    R    0.0          0.0             0       12     6    96    48    No       Yes
diff --git a/MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf b/MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf
index adc93d8f04823a2db70d3562a8b8d24fcc8ed29b..2e78ea39982fabd9a7d9769ab248fabe5ad861c0 100644
--- a/MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf
+++ b/MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf
@@ -1,23 +1,23 @@
 #
 # HBADeltas for DE601
-# Created: 2012-11-22 13:33:45
+# Created: 2012-11-08 20:42:18
 #
 HBADeltas
 16 x 3 [
-    -1.263   2.184   0.816
-    -0.301   1.953   0.052
-     0.661   1.721  -0.712
      1.622   1.490  -1.477
-    -1.383   0.960   1.036
-    -0.421   0.728   0.272
-     0.541   0.497  -0.492
      1.503   0.265  -1.256
-    -1.503  -0.265   1.256
-    -0.541  -0.497   0.492
-     0.421  -0.728  -0.272
      1.383  -0.960  -1.036
-    -1.622  -1.490   1.477
-    -0.661  -1.721   0.712
-     0.301  -1.953  -0.052
      1.263  -2.184  -0.816
+     0.661   1.721  -0.712
+     0.541   0.497  -0.492
+     0.421  -0.728  -0.272
+     0.301  -1.953  -0.052
+    -0.301   1.953   0.052
+    -0.421   0.728   0.272
+    -0.541  -0.497   0.492
+    -0.661  -1.721   0.712
+    -1.263   2.184   0.816
+    -1.383   0.960   1.036
+    -1.503  -0.265   1.256
+    -1.622  -1.490   1.477
 ]
diff --git a/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS310-iHBADeltas.conf b/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS310-iHBADeltas.conf
deleted file mode 100644
index 888698403744914425666946336a0449fcdc456c..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS310-iHBADeltas.conf
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# HBADeltas for RS310
-# Created: 2012-12-04 12:46:44
-#
-HBADeltas
-16 x 3 [
-    -1.980   1.056   1.412
-    -1.071   1.513   0.687
-    -0.161   1.970  -0.039
-     0.749   2.426  -0.764
-    -1.570  -0.105   1.196
-    -0.660   0.352   0.471
-     0.250   0.809  -0.255
-     1.160   1.265  -0.980
-    -1.160  -1.265   0.980
-    -0.250  -0.809   0.255
-     0.660  -0.352  -0.471
-     1.570   0.105  -1.196
-    -0.749  -2.426   0.764
-     0.161  -1.970   0.039
-     1.071  -1.513  -0.687
-     1.980  -1.056  -1.412
-]
diff --git a/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS407-iHBADeltas.conf b/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS407-iHBADeltas.conf
index fd9699fa44caf99d141e895214550b05370daab9..0b28732355826f4f04287910cac6f14eca95906a 100644
--- a/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS407-iHBADeltas.conf
+++ b/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS407-iHBADeltas.conf
@@ -1,6 +1,6 @@
 #
 # HBADeltas for RS407
-# Created: 2012-11-30 15:19:23
+# Created: 2012-11-08 20:42:21
 #
 HBADeltas
 16 x 3 [
diff --git a/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS409-iHBADeltas.conf b/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS409-iHBADeltas.conf
deleted file mode 100644
index 10bc25b731bdb69efcf6788e7815d31e6b39c414..0000000000000000000000000000000000000000
--- a/MAC/Deployment/data/StaticMetaData/iHBADeltas/RS409-iHBADeltas.conf
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# HBADeltas for RS409
-# Created: 2012-11-26 21:32:24
-#
-HBADeltas
-16 x 3 [
-    -1.637  -1.573   1.371
-    -1.542  -0.340   1.188
-    -1.448   0.893   1.006
-    -1.353   2.126   0.824
-    -0.640  -1.757   0.639
-    -0.546  -0.524   0.457
-    -0.451   0.709   0.275
-    -0.357   1.942   0.092
-     0.357  -1.942  -0.092
-     0.451  -0.709  -0.275
-     0.546   0.524  -0.457
-     0.640   1.757  -0.639
-     1.353  -2.126  -0.824
-     1.448  -0.893  -1.006
-     1.542   0.340  -1.188
-     1.637   1.573  -1.371
-]
diff --git a/MAC/Navigator2/config/progs.ccu b/MAC/Navigator2/config/progs.ccu
index 7234d9dea2a73a5c3a59acb226f503d8e81fd8f1..50869e5d953b4344e9fe559b5d11a11f1635929c 100644
--- a/MAC/Navigator2/config/progs.ccu
+++ b/MAC/Navigator2/config/progs.ccu
@@ -14,9 +14,8 @@ PVSS00event      | always |      30 |        3 |        1 |
 PVSS00ctrl       | always |      30 |        3 |        1 |-f pvss_scripts.lst
 PVSS00sim        | always |      30 |        3 |        1 |
 PVSS00dist       | always |      30 |        3 |        1 |
-PVSS00ctrl       |   once |      30 |        2 |        2 |readStationBGPconnections.ctl
-PVSS00ctrl       | always |      30 |        2 |        2 |transferMPs.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |claim.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStateChanges.ctl
+PVSS00ctrl       |   once |      30 |        2 |        2 |readStationBGPconnections.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStateReset.ctl
 PVSS00ui         | manual |      30 |        2 |        2 |-m para
diff --git a/MAC/Navigator2/config/progs.dist.station b/MAC/Navigator2/config/progs.dist.station
index 1456b2e940ba8bf30ace0b3b81c8a6cbba66f3fa..0163de4f87f1d4d94307c4f43b9a98a461d2a205 100644
--- a/MAC/Navigator2/config/progs.dist.station
+++ b/MAC/Navigator2/config/progs.dist.station
@@ -10,9 +10,8 @@ PVSS00event      | always |      30 |        3 |        1 |
 PVSS00ctrl       | always |      30 |        3 |        1 |-f pvss_scripts.lst
 PVSS00sim        | always |      30 |        3 |        1 |
 PVSS00dist       | always |      30 |        3 |        1 |
-PVSS00ctrl       |   once |      30 |        2 |        2 |readStationConfigs.ctl
-PVSS00ctrl       | always |      30 |        2 |        2 |transferMPs.ctl
-PVSS00ctrl       | always |      30 |        2 |        2 |claim.ctl
+PVSS00ctrl       |   once |      30 |        2 |        2 |claim.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStateChanges.ctl
+PVSS00ctrl       |   once |      30 |        2 |        2 |readStationConfigs.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStateReset.ctl
 PVSS00ui         | manual |      30 |        2 |        2 |-m para -display localhost:10.0
diff --git a/MAC/Navigator2/config/progs.maincu b/MAC/Navigator2/config/progs.maincu
index 64677f23a81e96527ec599f4fae01817ae2b4576..af37c7aa87aff90c2e1ab592e136a54984df5ceb 100644
--- a/MAC/Navigator2/config/progs.maincu
+++ b/MAC/Navigator2/config/progs.maincu
@@ -10,7 +10,6 @@ PVSS00event      | always |      30 |        3 |        1 |
 PVSS00ctrl       | always |      30 |        3 |        1 |-f pvss_scripts.lst
 PVSS00sim        | always |      30 |        3 |        1 |
 PVSS00dist       | always |      30 |        3 |        1 |
-PVSS00ctrl       | always |      30 |        2 |        2 |transferMPs.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |claim.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStateChanges.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStateReset.ctl
diff --git a/MAC/Navigator2/config/progs.standalone.station b/MAC/Navigator2/config/progs.standalone.station
index 53bdf6f4b0e3e93a07645a75da5faa5eb7f83cc4..dfd4a6710abf356a7a6a7892207f4f1e241e6093 100644
--- a/MAC/Navigator2/config/progs.standalone.station
+++ b/MAC/Navigator2/config/progs.standalone.station
@@ -9,10 +9,9 @@ PVSS00valarch    | always |      30 |        3 |        1 |-num 2
 PVSS00event      | always |      30 |        3 |        1 |
 PVSS00ctrl       | always |      30 |        3 |        1 |-f pvss_scripts.lst
 PVSS00sim        | always |      30 |        3 |        1 |
-PVSS00ctrl       |   once |      30 |        2 |        2 |readStationConfigs.ctl
-PVSS00ctrl       | always |      30 |        2 |        2 |claim.ctl
-PVSS00ctrl       | always |      30 |        2 |        2 |transferMPs.ctl
+PVSS00ctrl       |   once |      30 |        2 |        2 |claim.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStateChanges.ctl
+PVSS00ctrl       |   once |      30 |        2 |        2 |readStationConfigs.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStateReset.ctl
 PVSS00ctrl       | always |      30 |        2 |        2 |monitorStationAlarms.ctl
 PVSS00ui         | manual |      30 |        2 |        2 |-m para -display localhost:10.0
diff --git a/MAC/Navigator2/panels/Processes/CEP_Processes.pnl b/MAC/Navigator2/panels/Processes/CEP_Processes.pnl
index 4a178dc17d85d6d0a70c86f161f53303646d233e..94cf82ae878db3def26dc8dd64f8f8acad7c252f 100644
--- a/MAC/Navigator2/panels/Processes/CEP_Processes.pnl
+++ b/MAC/Navigator2/panels/Processes/CEP_Processes.pnl
@@ -374,7 +374,7 @@ LANG:1 0
 3 41 "PANEL_REF42" -1
 "objects\\Processes\\controller_small.pnl" 0 280 T 55 1 0 1 0 15
 1
-"$name""Daemons_SoftwareMonitor"
+"$name""SoftwareMonitor"
 3 42 "PANEL_REF42" -1
 "objects\\Processes\\daemon_small.pnl" 0 40 T 55 1 0 1 0 20
 1
diff --git a/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl b/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl
index 54a1439643026c914129e00521b776d854122496..e0e6e35b6aeefb4c88f262014908a1a600d2bc30 100644
--- a/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl
+++ b/MAC/Navigator2/panels/Processes/MainCU_Processes.pnl
@@ -400,9 +400,9 @@ LANG:1 0
 1
 "$name""MACScheduler"
 3 20 "PANEL_REF21" -1
-"objects\\Processes\\controller_small.pnl" 0 280 T 35 1 0 1 0 -30
+"objects\\Processes\\controller_small.pnl" 0 280 T 35 1 0 1 0 -32
 1
-"$name""Daemons_SoftwareMonitor"
+"$name""SoftwareMonitor"
 3 21 "PANEL_REF22" -1
 "objects\\Processes\\daemon_small.pnl" 0 140 T 35 1 0 1 0 12
 1
diff --git a/MAC/Navigator2/panels/Processes/Station_Processes.pnl b/MAC/Navigator2/panels/Processes/Station_Processes.pnl
index 04e65629561017e2aa1075a4e1637f70f415974b..b2bd0c83af1a82cbd7e22058148d40fa48c21d62 100644
--- a/MAC/Navigator2/panels/Processes/Station_Processes.pnl
+++ b/MAC/Navigator2/panels/Processes/Station_Processes.pnl
@@ -524,5 +524,5 @@ LANG:1 0
 3 38 "PANEL_REF39" -1
 "objects\\Processes\\controller_small.pnl" 10 470 T 44 1 0 1 -10 14
 1
-"$name""Daemons_SoftwareMonitor"
-0
+"$name""SoftwareMonitor"
+0
\ No newline at end of file
diff --git a/MAC/Navigator2/panels/objects/Processes/SWControler_small.pnl b/MAC/Navigator2/panels/objects/Processes/SWControler_small.pnl
index 6f45caea2b8a35a38940d957d457afd60250c8b0..05fe78fa9d2516ba6f5c0e0ef0e9932cfe9754f0 100644
--- a/MAC/Navigator2/panels/objects/Processes/SWControler_small.pnl
+++ b/MAC/Navigator2/panels/objects/Processes/SWControler_small.pnl
@@ -22,10 +22,10 @@ PANEL,-1 -1 388 166 N "_3DFace" 2
     if (dpExists(\"MCU001:LOFAR_PermSW_MACScheduler.activeObservations\")) {
       if (dpConnect(\"observationChanged\", \"MCU001:LOFAR_PermSW_MACScheduler.activeObservations:_online.._value\",
                                           \"MCU001:LOFAR_PermSW_MACScheduler.activeObservations:_online.._invalid\") == -1) {
-        LOG_ERROR(\"SWController_small.pnl:main|Couldn't connect to: MCU001:LOFAR_PermSW_MACScheduler.activeObservations\");
+        LOG_ERROR(\"Observation_small.pnl:main|Couldn't connect to: MCU001:LOFAR_PermSW_MACScheduler.activeObservations\");
       }
     } else {
-      if (!isStandalone()) LOG_ERROR(\"SWController_small.pnl:main|Couldn't find DP to connect to: MCU001:LOFAR_PermSW_MACScheduler.activeObservations\");
+      if (!isStandalone()) LOG_ERROR(\"Observation_small.pnl:main|Couldn't find DP to connect to: MCU001:LOFAR_PermSW_MACScheduler.activeObservations\");
     }
   }	else {
     reload();
@@ -118,8 +118,7 @@ void dblClick() {
   if (dpExists(baseDP) ) {
     LOG_DEBUG(\"SWcontroller_small.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+baseDP);
     g_currentDatapoint=baseDP;
-    //we also have to set the tabctrl to think this was initiated from the ProcessesTab, otherwise we will get the wrong panel.
-    navPanel_setEvent(\"Processes\",\"ChangeTab\");
+    navPanel_setEvent(station,\"ChangePanel\");
   }
   
   // set delay to avoid click event will be triggered
diff --git a/MAC/Navigator2/panels/objects/Processes/daemon_big.pnl b/MAC/Navigator2/panels/objects/Processes/daemon_big.pnl
index 46d485e4b37b53bf3a5937bc11eafdc8f77a7449..eaa9901f02d2b0fa8cefc1cf076500b9c1077904 100644
--- a/MAC/Navigator2/panels/objects/Processes/daemon_big.pnl
+++ b/MAC/Navigator2/panels/objects/Processes/daemon_big.pnl
@@ -1,4 +1,4 @@
-V 11
+V 10
 1
 LANG:1 0 
 PANEL,-1 -1 1013 750 N "_3DFace" 1
@@ -45,6 +45,8 @@ PANEL,-1 -1 1013 750 N "_3DFace" 1
   showSelfState(baseDP);
   
   reload();
+
+  LOG_DEBUG($daemonName+\".pnl:main|HardwareTree found: \"+ result);  
 }
 
 updateStates(string dp1, string message, 
@@ -151,8 +153,9 @@ LANG:1 0
 
 0
 1
-LANG:1 33 MS Shell Dlg,-1,13,5,50,0,0,0,0,0
-0  28 168 992 462
+LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+ 28 168 992 462
 EE 1 0 1 5 1 "time" 12 1 0 "s" 1
 LANG:1 4 time
 E
@@ -188,8 +191,9 @@ LANG:1 0
 LANG:1 2 #1
 10 30
 1
-LANG:1 33 MS Shell Dlg,-1,13,5,50,0,0,0,0,0
-0 0 1 2 1 7
+LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-13-*-100-100-*-*-iso8859-1|-13,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+0 1 2 1 7
 1 0
 1 21 0 "" 1
 0
@@ -206,8 +210,9 @@ LANG:1 0
 
 0
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  138 48 991 69
+LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+ 138 48 991 69
 2 "0s" 0 0 0 0 0 -1  E E E
 2 3
 "TopLabel"
@@ -222,11 +227,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 480 10 677 30
+E E 0 1 1 2 1 E U  1 E 480 10 677 31
 0 2 2 "0s" 0 0 0 192 0 0  480 10 1
 1
-LANG:1 33 MS Shell Dlg,-1,16,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-16-*-100-100-*-*-iso8859-1|-16,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 22 Station: CTStartDaemon
 2 7
 "PRIMITIVE_TEXT2"
@@ -241,11 +247,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 34 84 115 97
+E E 0 1 1 2 1 E U  1 E 34 84 115 98
 0 2 2 "0s" 0 0 0 192 0 0  34 84 1
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 14 Current Action
 2 8
 "PRIMITIVE_TEXT3"
@@ -260,11 +267,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 34 51 128 64
+E E 0 1 1 2 1 E U  1 E 34 51 128 65
 0 2 2 "0s" 0 0 0 192 0 0  34 51 1
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 15 Status Message:
 14 9
 "processAction"
@@ -279,8 +287,9 @@ LANG:1 0
 
 0
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  138 78 432 99
+LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+ 138 78 432 99
 2 "0s" 0 0 0 0 0 -1  E E E
 2 10
 "PRIMITIVE_TEXT4"
@@ -295,11 +304,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 34 114 106 127
+E E 0 1 1 2 1 E U  1 E 34 114 106 128
 0 2 2 "0s" 0 0 0 192 0 0  34 114 1
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 13 Current Error
 14 11
 "processError"
@@ -314,8 +324,9 @@ LANG:1 0
 
 0
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  138 108 432 129
+LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+ 138 108 432 129
 2 "0s" 0 0 0 0 0 -1  E E E
 2 12
 "PRIMITIVE_TEXT5"
@@ -330,11 +341,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 34 150 119 163
+E E 0 1 1 2 1 E U  1 E 34 150 119 164
 0 2 2 "0s" 0 0 0 192 0 0  34 150 1
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 13 Log Messages:
 2 13
 "PRIMITIVE_TEXT6"
@@ -349,11 +361,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 32 472 124 485
+E E 0 1 1 2 1 E U  1 E 32 472 124 486
 0 2 2 "0s" 0 0 0 192 0 0  32 472 1
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 14 Daemon Values:
 2 15
 "PRIMITIVE_TEXT7"
@@ -368,11 +381,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 462 84 516 97
+E E 0 1 1 2 1 E U  1 E 462 84 516 98
 0 2 2 "0s" 0 0 0 192 0 0  462 84 1
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 9 StartTime
 2 16
 "PRIMITIVE_TEXT8"
@@ -387,11 +401,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 462 114 515 127
+E E 0 1 1 2 1 E U  1 E 462 114 515 128
 0 2 2 "0s" 0 0 0 192 0 0  462 114 1
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 8 StopTime
 14 17
 "processStartTime"
@@ -406,8 +421,9 @@ LANG:1 0
 
 0
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  530 78 824 99
+LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+ 530 78 824 99
 2 "0s" 0 0 0 0 0 -1  E E E
 14 18
 "processStopTime"
@@ -422,8 +438,9 @@ LANG:1 0
 
 0
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  530 108 824 129
+LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+ 530 108 824 129
 2 "0s" 0 0 0 0 0 -1  E E E
 2 19
 "PRIMITIVE_TEXT9"
@@ -438,11 +455,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E E 0 1 1 2 1 E U  1 E 852 84 869 97
+E E 0 1 1 2 1 E U  1 E 852 84 869 98
 0 2 2 "0s" 0 0 0 192 0 0  852 84 1
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,75,0,0,0,0,0
-0 1
+LANG:1 101 -*-MS Shell Dlg-bold-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,758,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+1
 LANG:1 3 ID:
 14 20
 "processID"
@@ -457,8 +475,9 @@ LANG:1 0
 
 0
 1
-LANG:1 33 MS Shell Dlg,-1,11,5,50,0,0,0,0,0
-0  870 78 990 99
+LANG:1 98 -*-MS Shell Dlg-*-r-normal-*-11-*-100-100-*-*-iso8859-1|-11,0,0,0,505,0,0,0,0,0,0,0,0,MS Shell Dlg
+0 ""
+ 870 78 990 99
 2 "0s" 0 0 0 0 0 -1  E E E
 0
 LAYER, 1 
@@ -489,7 +508,7 @@ LAYER, 7
 1
 LANG:1 0 
 0
-3 0 "selfState" -1
+3 0 "selfState"
 "objects\\lofar_self_state.pnl" 9.500000000000011 10.5 T 1 1 0 1 0.499999999999993 2.5
 0
-0
+0
\ No newline at end of file
diff --git a/MAC/Navigator2/panels/objects/Processes/stationSWLevelView.pnl b/MAC/Navigator2/panels/objects/Processes/stationSWLevelView.pnl
index c38abba4a042ebb95737e7d3d41f8cf8ba3b5523..932c6f11710c0c24af609fa6287edca8a8c40ce2 100644
--- a/MAC/Navigator2/panels/objects/Processes/stationSWLevelView.pnl
+++ b/MAC/Navigator2/panels/objects/Processes/stationSWLevelView.pnl
@@ -103,7 +103,7 @@ LANG:1 0
 3 1 "PANEL_REF1" -1
 "objects\\Processes\\SWControler_small.pnl" 0 0 T 18 U 
 2
-"$name""PermSW_Daemons_SoftwareMonitor"
+"$name""PermSW_SoftwareMonitor"
 "$station""$station"
 3 2 "PANEL_REF2" -1
 "objects\\Processes\\SWControler_small.pnl" 20 0 T 19 1 0 1 -4 0
diff --git a/MAC/Navigator2/panels/objects/swlevel.pnl b/MAC/Navigator2/panels/objects/swlevel.pnl
index a88023126f034dd3a4a857f2634977bfb6b8106f..c2b4d265795bcd1b89b8c505829619d967690bfa 100644
--- a/MAC/Navigator2/panels/objects/swlevel.pnl
+++ b/MAC/Navigator2/panels/objects/swlevel.pnl
@@ -10,7 +10,7 @@ PANEL,-1 -1 251 88 N "_3DFace" 1
   station = $station;
   station_text.text = station;
   
-  baseDP = station+\":LOFAR_PermSW_Daemons_SoftwareMonitor\";
+  baseDP = station+\":LOFAR_PermSW_SoftwareMonitor\";
   
   if (dpExists(baseDP)) {
     showLevels();
@@ -19,56 +19,14 @@ PANEL,-1 -1 251 88 N "_3DFace" 1
   }
 }
 " 0
- E "main(int x, int y)
-{
-  click();
-}" 0
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
- 1 -1 -1 0  0 0
+ E E E E 1 -1 -1 0  0 0
 ""0  1
 E "#uses \"navPanel.ctl\"
 string station = \"\";
 string baseDP=\"\";
-bool bDoubleClicked  = false;
 
 int filled=0;
 
-// routine for single mouse click
-void click() {
-  // set delay in case double click was meant
-  delay(0, 100); 
-  if (!bDoubleClicked) {
-    navPanel_setEvent(station,\"EventClick\");
-  }
-}
-
-// routine for double mouse click
-void dblClick() {
-  // indicate this is a doubleClick
-  bDoubleClicked = true;   
-
-  if (dpExists(baseDP) ) {
-    LOG_DEBUG(\"swlevel.pnl:DoubleClick|Setting currentDatapoint from : \"+g_currentDatapoint+\" to \"+baseDP);
-    g_currentDatapoint=baseDP;
-    navPanel_setEvent(station,\"ChangePanel\");
-  }
-  
-  // set delay to avoid click event will be triggered
-  delay(0, 500);
-  bDoubleClicked = false;  
-}                       
-
-// routine for right mouse click
-void rClick() {
-
-}                       
 
 // ****************************************
 // Name: showLogging   
@@ -197,15 +155,7 @@ LANG:1 0
 "level1_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 0 0 0 0 0 0
 E E E
 0
@@ -214,24 +164,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -180 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -180 -140 1 E 230 150 234 159
 2 1
 "station_text"
 ""
 1 10 9 E E E 1 E 1 E N "_WindowText" E N "_Transparent" E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 1 0 0 0 0 0
 E E E
 0
@@ -240,11 +178,7 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E U  0 E 10 9 38 22
+E E 0 1 1 2 1 E U  0 E 10 9 38 22
 0 2 2 "0s" 0 0 0 192 0 0  10 9 1
 1
 LANG:1 34 MS Shell Dlg 2,8,-1,5,50,0,0,0,0,0
@@ -254,15 +188,7 @@ LANG:1 5 cs001
 "level2_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 2 0 0 0 0 0
 E E E
 0
@@ -271,24 +197,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -175 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -175 -140 1 E 230 150 234 159
 6 3
 "level3_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 3 0 0 0 0 0
 E E E
 0
@@ -297,24 +211,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -170 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -170 -140 1 E 230 150 234 159
 6 4
 "level4_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 4 0 0 0 0 0
 E E E
 0
@@ -323,24 +225,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -165 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -165 -140 1 E 230 150 234 159
 6 5
 "level5_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 5 0 0 0 0 0
 E E E
 0
@@ -349,24 +239,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -160 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -160 -140 1 E 230 150 234 159
 6 6
 "level6_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 6 0 0 0 0 0
 E E E
 0
@@ -375,24 +253,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -155 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -155 -140 1 E 230 150 234 159
 6 7
 "level7_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 7 0 0 0 0 0
 E E E
 0
@@ -401,24 +267,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -150 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -150 -140 1 E 230 150 234 159
 6 8
 "level8_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 8 0 0 0 0 0
 E E E
 0
@@ -427,24 +281,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -145 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -145 -140 1 E 230 150 234 159
 6 9
 "level9_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 9 0 0 0 0 0
 E E E
 0
@@ -453,24 +295,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -140 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -140 -140 1 E 230 150 234 159
 6 10
 "level10_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 10 0 0 0 0 0
 E E E
 0
@@ -479,24 +309,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -135 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -135 -140 1 E 230 150 234 159
 6 11
 "level11_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 11 0 0 0 0 0
 E E E
 0
@@ -505,24 +323,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -130 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -130 -140 1 E 230 150 234 159
 6 12
 "level12_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 12 0 0 0 0 0
 E E E
 0
@@ -531,24 +337,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -125 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -125 -140 1 E 230 150 234 159
 6 13
 "level13_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 13 0 0 0 0 0
 E E E
 0
@@ -557,24 +351,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -120 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -120 -140 1 E 230 150 234 159
 6 14
 "level14_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 14 0 0 0 0 0
 E E E
 0
@@ -583,24 +365,12 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -115 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -115 -140 1 E 230 150 234 159
 6 15
 "level15_text"
 ""
 1 230 150 E E E 1 E 1 E N {0,0,0} E N {255,255,255} E E
- "main()
-{
-  rClick();
-}" 0
- "main(int x, int y)
-{
-  dblClick();
-}" 0
-
+ E E
 15 0 0 0 0 0
 E E E
 0
@@ -609,11 +379,7 @@ LANG:1 0
 
 1
 "dashclr"N "_Transparent"
-E "main(int x, int y)
-{
-  click();
-}" 0
- 0 1 1 2 1 E 1 0 1 -110 -140 1 E 230 150 234 159
+E E 0 1 1 2 1 E 1 0 1 -110 -140 1 E 230 150 234 159
 0
 LAYER, 1 
 1
diff --git a/MAC/Navigator2/scripts/transferMPs.ctl b/MAC/Navigator2/scripts/transferMPs.ctl
deleted file mode 100644
index df3585c138e95c0c3b66906f9f6587ad801625db..0000000000000000000000000000000000000000
--- a/MAC/Navigator2/scripts/transferMPs.ctl
+++ /dev/null
@@ -1,121 +0,0 @@
-#uses "da.ctl"
-
-// To copy all _mp defined functionality (archives , dp_fct etc to the real DP's
-// we use this script after setup (or each time that the scriptInfo.paramDone is set to false)
-// we run this script
-bool bDebug=false;
-
-void main()
-{
-  // connect to debugflag to be able to switch debug on/off during run
-    if (dpExists("scriptInfo.transferMPs.debug")) {
-    dpConnect("debugCB",true,"scriptInfo.transferMPs.debug");
-  } else {
-    DebugTN("transferMPs.ctl:main|scriptInfo.transferMPs.runDone point not found in Database");  
-    exit();
-  } 
-
-  if (dpExists("scriptInfo.transferMPs.runDone")) {
-    dpConnect("startTransferMP",true,"scriptInfo.transferMPs.runDone");
-  } else {
-    DebugTN("transferMPs.ctl:main|scriptInfo.transferMPs.runDone point not found in Database");  
-    exit();
-  } 
-}
-
-private void debugCB(string dp1, bool debug) {
-  if (bDebug != debug) bDebug=debug;
-}
-
-// Transfer all _mp_settings to all DP's
-private void startTransferMP(string dp1, bool done ) {
-  int        i, j, k, l, ll, l1, iError;
-  dyn_float  df;
-  dyn_string dsConfigs, ds;
-  string     sDestinationDPE;
-  
-  if (done) return;
-  
-  DebugTN("transferMPs.ctl:main|start transfer of MPconfigs to all DP's");     
-
-    
-  string query="SELECT '_original.._value' FROM '_mp_*'";
-  dyn_dyn_anytype tab;
-  dyn_string dps;
-  dpQuery(query,tab);
-  string olddp="";
-  for(int z=2;z<=dynlen(tab);z++) {
-    string dp = dpSubStr(tab[z][1],DPSUB_DP);
-    if (olddp != dp) {
-      olddp=dp;
-      if (!skipDP(dp)) {
-        dynAppend(dps,dp);
-      }
-    }
-  }
-
-  for (k=1;k <= dynlen(dps); k++) {
-    string dpstr = dps[k];
-    dyn_string dsDpes = dpNames( dpstr + ".**"),
-               dsDps = dpNames("*",dpTypeName(dpstr));
-  
-    // no datapoints found
-    if ( dynlen(dsDps) > 1 ) {
-    
-      l = dynlen(dsDpes);
-      l1 = dynlen(dsDps);
-      ll = l * (l1 - 1);
-      // !!! dynlen(dsDpes) * dynlen(dsDps) verwenden mit der 2-Sek-Verzögerung
-
-      for ( i = 1; i <= l; i++ ) {
-        if ( strpos(dsDpes[i],".") < 1 ) dsDpes[i] += ".";
-        dsConfigs = dpNames( dsDpes[i] + ":*" );
-        for ( j = dynlen(dsConfigs); j > 0; j--) {
-          strreplace(dsConfigs[j], dsDpes[i] + ":", "");
-        }
-        if ( dynlen(dsConfigs) < 1 ) continue;
-    
-        for ( j = 1; j <= dynlen(dsDps); j++ ) {
-
-          if ( dpSubStr(dsDps[j],DPSUB_DP) == dpSubStr(dsDpes[i],DPSUB_DP) ) {
-            continue;
-          }
-          sDestinationDPE = dsDpes[i];
-          strreplace( sDestinationDPE, dpSubStr(dsDpes[i], DPSUB_DP), dpSubStr(dsDps[j], DPSUB_DP));
-          daCheckDPE(sDestinationDPE);
-
-          dpCopyConfig(dsDpes[i], sDestinationDPE, dsConfigs, iError);
-        }
-      }
-    }
-  }
-  dpSet("scriptInfo.transferMPs.runDone",true);
-  DebugTN("MPTransfer Done.");
-}
-
-bool skipDP(string dp) {
-// We only want to look at our own DB points that have a _mp_ sadly enough PVSS 
-// keeps some of their own datapoints in the database, and there is no way to 
-// determine what are theirs and what are or own points, other then a hard compare.
-  if (strpos(dp,"_mp__") > -1) return true;
-  if (strpos(dp,"WH_SC_SUB") > -1) return true;
-  if (strpos(dp,"WH_SC1") > -1) return true;
-  if (strpos(dp,"ANALOG1") > -1) return true;
-  if (strpos(dp,"ANALOG2") > -1) return true;
-  if (strpos(dp,"DRIVE1") > -1) return true;
-  if (strpos(dp,"DRIVE2") > -1) return true;
-  if (strpos(dp,"SETPOINT") > -1) return true;
-  if (strpos(dp,"SLIDE_VALVE1") > -1) return true;
-  if (strpos(dp,"SLIDE_VALVE2") > -1) return true;
-  if (strpos(dp,"PUMP2") > -1) return true;
-  if (strpos(dp,"PUMP1") > -1) return true;
-  if (strpos(dp,"BIT_CONDITION") > -1) return true;
-  if (strpos(dp,"COUNTER1") > -1) return true;
-  if (strpos(dp,"COUNTER_SUB") > -1) return true;
-  if (strpos(dp,"LABOR_ANALOG") > -1) return true;
-  if (strpos(dp,"LABOR_COUNTER") > -1) return true;
-  if (strpos(dp,"SLIDE_VALVE_HAND1") > -1) return true;
-  if (strpos(dp,"WH_SC_SERVICE") > -1) return true;
-  if (strpos(dp,"MODE_CMD") > -1) return true;
-  return false;
-}
diff --git a/RTCP/CMakeLists.txt b/RTCP/CMakeLists.txt
index 4e00a553ddabd32bee372a1543f1d47e931ea5f5..8e2e58a08747b8d7b636a982c74e0962e6f740db 100644
--- a/RTCP/CMakeLists.txt
+++ b/RTCP/CMakeLists.txt
@@ -4,7 +4,6 @@ lofar_add_package(Interface) # Interfaces between RTCP product components
 lofar_add_package(FCNP)      # BlueGene: Fast Collective Network Protocol
 lofar_add_package(CNProc)    # BlueGene: Compute-Node Processing applications 
 lofar_add_package(IONProc)   # BlueGene: I/O Node Processing applications 
-lofar_add_package(InputProc) # GPU cluster: Station Input Retrieval and Redistribution applications 
 lofar_add_package(Storage)   # Stores correlator output in MeasurmentSets
 lofar_add_package(Run)       # Run scripts to start RTCP components
 lofar_add_package(LofarStMan)# Storage Manager for the main table of a LOFAR MS
diff --git a/RTCP/IONProc/src/Job.cc b/RTCP/IONProc/src/Job.cc
index 53b6d736996811ffa4a48b76b37d223544da87b0..57e64552bd7a4567fe9a5f5162872bd71c236c49 100644
--- a/RTCP/IONProc/src/Job.cc
+++ b/RTCP/IONProc/src/Job.cc
@@ -326,7 +326,7 @@ void Job::StorageProcess::controlThread()
 
 void Job::forwardFinalMetaData()
 {
-  struct timespec deadline = { time(0) + 240, 0 };
+  struct timespec deadline = { time(0) + 60, 0 };
 
   Thread thread(this, &Job::finalMetaDataThread, itsLogPrefix + "[FinalMetaDataThread] ", 65536);
 
@@ -594,8 +594,6 @@ void Job::jobThread()
       barrier();
 
       // PLC: RELEASE phase
-      itsIsRunning = false;
-      jobQueue.itsReevaluate.broadcast();
 
       if (myPsetNumber == 0) {
         forwardFinalMetaData();
diff --git a/RTCP/IONProc/src/OutputSection.cc b/RTCP/IONProc/src/OutputSection.cc
index 342141bb7cb6daad4a2aa5dc319dc47610c271d0..a5fc54bcda15eebf5d0e2faa72b47d383488c8d6 100644
--- a/RTCP/IONProc/src/OutputSection.cc
+++ b/RTCP/IONProc/src/OutputSection.cc
@@ -246,7 +246,7 @@ void OutputSection::mainLoop()
     // core (to stay in sync with other psets).
     for (unsigned i = 0; i < itsNrCoresPerIteration; i ++) {
       if (i < itsNrStreams) {
-        //LOG_DEBUG_STR(itsLogPrefix << "] Reading data from core " << itsCurrentComputeCore);
+        LOG_DEBUG_STR(itsLogPrefix << "] Reading data from core " << itsCurrentComputeCore);
         
         if (lastTime) {
           if (itsIsRealTime && itsOutputThreads[i]->itsFreeQueue.empty()) {
diff --git a/RTCP/IONProc/src/RSP.h b/RTCP/IONProc/src/RSP.h
index b76634ba3beb6ae598a4ef31310b3b73260199da..adaf9e013f629cb09b4a4d20746ffc56b5d500de 100644
--- a/RTCP/IONProc/src/RSP.h
+++ b/RTCP/IONProc/src/RSP.h
@@ -24,7 +24,6 @@
 #define LOFAR_IONPROC_RSP_H
 
 #include <Common/LofarTypes.h>
-#include <complex>
 
 namespace LOFAR {
 namespace RTCP {
@@ -32,158 +31,21 @@ namespace RTCP {
 #include <cstddef>
 
 
-// WARNING: All data is in Little Endian format!
-//
-// Note that C++ bit fields are implementation dependent,
-// so we cannot use them.
-
-/* A structure fit for the maximum payload size. When reading UDP,
- * just read them straight into this struct, and ::read() will return
- * the size of the packet.
- *
- * When reading packets from file, make sure you read the right number
- * of bytes (see packetSize()).
- */
+// All data is in Little Endian format!
 
 struct RSP {
-  // ----------------------------------------------------------------------
-  // Header and payload, in little endian!
-  // ----------------------------------------------------------------------
-
   struct Header {
-    // 2: Beamlet Data Interface 5.0
-    // 3: Beamlet Data Interface 6.0 (8- and 4-bit mode support)
     uint8  version;
-
-    // bit (0=LSB)
-    //
-    // 4:0    RSP board number
-    // 5      (reserved, set to 0)
-    // 6      0: payload ok, 1: payload has data errors
-    // 7      0: 160 MHz     1: 200 MHz
-    uint8  sourceInfo1;
-    
-    // bit (0=LSB)
-    //
-    // 1:0    0: 16-bit      1: 8-bit       2: 4-bit
-    // 7:2    (reserved, set to 0)
-    uint8  sourceInfo2;
-
-    // identifiers
-    uint8  configuration;
+    uint8  sourceInfo;
+    uint16 configuration;
     uint16 station;
-
-    // number of beamlets, typically at maximum:
-    //   16-bit: 61
-    //    8-bit: 122
-    //    4-bit: 244
     uint8  nrBeamlets;
-
-    // number of Xr+Xi+Yr+Yi samples per beamlet, typically 16
     uint8  nrBlocks;
-
-    // UNIX timestamp in UTC (= # seconds since 1970-01-01 00:00:00)
-    // 0xFFFFFFFF = clock not initialised
     uint32 timestamp;
-
-    // Sample offset within the timestamp.
-    //
-    // 160 MHz: 160M/1024 = 156250 samples/second.
-    //
-    // 200 MHz: 200M/1024 = 195212.5 samples/second.
-    //                      Even seconds have 195213 samples,
-    //                      odd seconds have 195212 samples.
     uint32 blockSequenceNumber;
   } header;
 
-  // Payload, allocated for maximum size.
-  union {
-    char data[8130];
-
-    // samples are structured as samples[nrBlocks][nrBeamlets],
-    // so first all blocks of the first beamlet, then all blocks of the second
-    // beamlet, etc.
-    //
-    // for 4-bit mode:
-    //  low octet: real      (2's complement)
-    // high octet: imaginary (2's complement)
-
-    struct { int16 Xr, Xi, Yr, Yi; } samples16bit[61 * 16];
-    struct { int8  Xr, Xi, Yr, Yi; } samples8bit[122 * 16];
-    struct { int8  X, Y;           } samples4bit[244 * 16];
-  } payload;
-
-
-  // ----------------------------------------------------------------------
-  // Helper functions
-  // ----------------------------------------------------------------------
-
-  unsigned rspBoard() const {
-    return header.sourceInfo1 & 0x1F;
-  }
-
-  bool payloadError() const {
-    return header.sourceInfo1 & 0x40;
-  }
-
-  unsigned clockMHz() const {
-    return header.sourceInfo1 & 0x80 ? 200 : 160;
-  }
-
-  unsigned bitMode() const {
-    switch (header.sourceInfo2 & 0x3) {
-      default:
-      case 0x0: return 16;
-      case 0x1: return 8;
-      case 0x2: return 4;
-    }
-  }
-
-  size_t packetSize() const {
-    return sizeof(RSP::Header) + header.nrBlocks * header.nrBeamlets * 2 * 2 * bitMode() / 8;
-  }
-
-
-  // ----------------------------------------------------------------------
-  // Payload decoding (for debug purposes, assumes data is converted to native
-  // endianness)
-  // ----------------------------------------------------------------------
-  std::complex<int> sample( unsigned beamlet, unsigned block, char polarisation /* 'X' or 'Y' */) const {
-    const unsigned offset = beamlet * header.nrBlocks + block;
-
-    switch( bitMode() ) {
-      default:
-      case 16:
-        return polarisation == 'X' ? std::complex<int>(payload.samples16bit[offset].Xr,
-                                                       payload.samples16bit[offset].Xi)
-                                   : std::complex<int>(payload.samples16bit[offset].Yr,
-                                                       payload.samples16bit[offset].Yi);
-
-      case 8:
-        return polarisation == 'X' ? std::complex<int>(payload.samples8bit[offset].Xr,
-                                                       payload.samples8bit[offset].Xi)
-                                   : std::complex<int>(payload.samples8bit[offset].Yr,
-                                                       payload.samples8bit[offset].Yi);
-
-      case 4:
-        return polarisation == 'X' ? decode4bit(payload.samples4bit[offset].X)
-                                   : decode4bit(payload.samples4bit[offset].Y);
-    }
-  }
-
-private:
-
-  // decode the 4-bit complex type.
-  static std::complex<int> decode4bit( int8 sample ) {
-    int8 re = (sample << 4) >> 4; // preserve sign
-    int8 im = (sample     ) >> 4; // preserve sign
-
-    // balance range to [-7..7], subject to change!
-    if (re == -8) re = -7;
-    if (im == -8) im = -7;
-
-    return std::complex<int>(re, im);
-  }
+  char       data[8130];
 };
 
 } // namespace RTCP
diff --git a/RTCP/IONProc/src/SSH.cc b/RTCP/IONProc/src/SSH.cc
index 81cad86e2fbe24cf236560e436100dd48d0444f9..799c656aae522d5771947b66d354773cbd294f43 100644
--- a/RTCP/IONProc/src/SSH.cc
+++ b/RTCP/IONProc/src/SSH.cc
@@ -59,36 +59,6 @@ namespace RTCP {
 Mutex coutMutex;
 #endif
 
-void free_session( LIBSSH2_SESSION *session )
-{
-  ScopedDelayCancellation dc;
-
-  if (!session)
-    return;
-
-  libssh2_session_free(session);
-}
-
-void free_channel( LIBSSH2_CHANNEL *channel )
-{
-  ScopedDelayCancellation dc;
-
-  if (!channel)
-    return;
-
-  libssh2_channel_free(channel);
-}
-
-typedef SmartPtr<LIBSSH2_SESSION, SmartPtrFreeFunc<LIBSSH2_SESSION, free_session> > session_t;
-typedef SmartPtr<LIBSSH2_CHANNEL, SmartPtrFreeFunc<LIBSSH2_CHANNEL, free_channel> > channel_t;
-
-/*
- * Make sure we ScopedDelayCancellation around calls to libssh2 because
- * it is an external library.
- *
- * Note that waitsocket() is a forced cancellation point.
- */
-
 SSHconnection::SSHconnection(const string &logPrefix, const string &hostname, const string &commandline, const string &username, const string &sshkey, bool captureStdout)
 :
   itsLogPrefix(logPrefix),
@@ -155,15 +125,30 @@ std::string SSHconnection::stdoutBuffer() const
   return itsStdoutBuffer.str();
 }
 
-LIBSSH2_SESSION *SSHconnection::open_session( FileDescriptorBasedStream &sock )
+void SSHconnection::free_session( LIBSSH2_SESSION *session )
 {
-  ScopedDelayCancellation dc;
+  if (!session)
+    return;
 
+  libssh2_session_disconnect(session, "Normal Shutdown, Thank you for playing");
+  libssh2_session_free(session);
+}
+
+void SSHconnection::free_channel( LIBSSH2_CHANNEL *channel )
+{
+  if (!channel)
+    return;
+
+  libssh2_channel_free(channel);
+}
+
+bool SSHconnection::open_session( FileDescriptorBasedStream &sock )
+{
   int rc;
 
   /* Create a session instance */
-  session_t session = libssh2_session_init();
-  if (!session.get()) {
+  session = libssh2_session_init();
+  if (!session) {
     LOG_ERROR_STR( itsLogPrefix << "Cannot create SSH session object" );
     return false;
   }
@@ -176,14 +161,12 @@ LIBSSH2_SESSION *SSHconnection::open_session( FileDescriptorBasedStream &sock )
    */
   while ((rc = libssh2_session_handshake(session, sock.fd)) ==
          LIBSSH2_ERROR_EAGAIN) {
-    waitsocket(session, sock);
+    waitsocket(sock);
   }
 
-  /* NOTE: libssh2 now holds a copy of sock.fd, so don't invalidate it! */
-
   if (rc) {
-    LOG_ERROR_STR( itsLogPrefix << "Failure establishing SSH session: " << rc << " (" << explainLibSSH2Error(rc) << ")");
-    return NULL;
+    LOG_ERROR_STR( itsLogPrefix << "Failure establishing SSH session: " << rc);
+    return false;
   }
 
   /* Authenticate by public key */
@@ -194,86 +177,54 @@ LIBSSH2_SESSION *SSHconnection::open_session( FileDescriptorBasedStream &sock )
                       NULL                 // password
                       )) ==
          LIBSSH2_ERROR_EAGAIN) {
-    waitsocket(session, sock);
+    waitsocket(sock);
   }
 
   if (rc) {
-    LOG_ERROR_STR( itsLogPrefix << "Authentication by public key failed: " << rc << " (" << explainLibSSH2Error(rc) << ")");
+    LOG_ERROR_STR( itsLogPrefix << "Authentication by public key failed: " << rc);
 
     // unrecoverable errors
     if (rc == LIBSSH2_ERROR_FILE)
       THROW(SSHException, "Error reading read key file " << itsSSHKey);
 
-    return NULL;
-  }
-
-  return session.release();
-}
-
-void SSHconnection::close_session( LIBSSH2_SESSION *session, FileDescriptorBasedStream &sock )
-{
-  ScopedDelayCancellation dc;
-
-  int rc;
-
-  while ((rc = libssh2_session_disconnect(session, "Normal Shutdown, Thank you for playing")) ==
-         LIBSSH2_ERROR_EAGAIN) {
-    waitsocket(session, sock);
+    return false;
   }
 
-  if (rc)
-  {
-    LOG_ERROR_STR( itsLogPrefix << "Failure closing session: " << rc << " (" << explainLibSSH2Error(rc) << ")");
-    return;
-  }
+  return true;
 }
 
-LIBSSH2_CHANNEL *SSHconnection::open_channel( LIBSSH2_SESSION *session, FileDescriptorBasedStream &sock )
+bool SSHconnection::open_channel( FileDescriptorBasedStream &sock )
 {
-  ScopedDelayCancellation dc;
-
-  channel_t channel;
-
   /* Exec non-blocking on the remote host */
   while( (channel = libssh2_channel_open_session(session)) == NULL &&
          libssh2_session_last_error(session,NULL,NULL,0) ==
          LIBSSH2_ERROR_EAGAIN )
   {
-    waitsocket(session, sock);
+    waitsocket(sock);
   }
 
-  if (!channel.get())
+  if (!channel)
   {
     LOG_ERROR_STR( itsLogPrefix << "Could not set up SSH channel" );
-    return NULL;
+    return false;
   }
 
-  return channel.release();
+  return true;
 }
 
-void SSHconnection::close_channel( LIBSSH2_SESSION *session, LIBSSH2_CHANNEL *channel, FileDescriptorBasedStream &sock )
+bool SSHconnection::close_channel( FileDescriptorBasedStream &sock )
 {
-  ScopedDelayCancellation dc;
-
   int rc;
 
   while( (rc = libssh2_channel_close(channel)) == LIBSSH2_ERROR_EAGAIN ) {
-    waitsocket(session, sock);
+    waitsocket(sock);
   }
 
-  if (rc)
-  {
-    LOG_ERROR_STR( itsLogPrefix << "Failure closing channel: " << rc << " (" << explainLibSSH2Error(rc) << ")");
-    return;
-  }
+  return true;
 }
 
-bool SSHconnection::waitsocket( LIBSSH2_SESSION *session, FileDescriptorBasedStream &sock )
+bool SSHconnection::waitsocket( FileDescriptorBasedStream &sock )
 {
-  // we manually control the cancellation points, so make sure
-  // cancellation is actually disabled.
-  ScopedDelayCancellation dc;
-
   struct timeval timeout;
   int rc;
   fd_set fd;
@@ -320,18 +271,7 @@ void SSHconnection::commThread()
   int rc;
   int exitcode;
   char *exitsignal = 0;
-
-  // WARNING: Make sure sock stays alive while a session is active, because the session
-  // will retain a copy of sock.fd so we can't invalidate it. We don't want to
-  // (for example) send a libssh2_session_disconnect to a sock.fd that has been
-  // reused by the system!
- 
-  // Declaring sock before session will cause ~sock to be called after
-  // ~session.
-
   SmartPtr<SocketStream> sock;
-  session_t session;
-  channel_t channel;
 
   for(;;) {
     // keep trying to connect
@@ -346,21 +286,11 @@ void SSHconnection::commThread()
 
       Cancellation::point();
 
-      // TODO: add a delay if opening session or channel fails
-
-      session = open_session(*sock);
-
-      if (!session.get())
+      if (!open_session(*sock))
         continue;
 
-      channel = open_channel(session, *sock);
-
-      if (!channel.get()) {
-        close_session(session, *sock);
-
-        session = 0;
+      if (!open_channel(*sock))
         continue;
-      }
     }
 
     break;
@@ -371,12 +301,12 @@ void SSHconnection::commThread()
   while( (rc = libssh2_channel_exec(channel, itsCommandLine.c_str())) ==
          LIBSSH2_ERROR_EAGAIN )
   {
-    waitsocket(session, *sock);
+    waitsocket(*sock);
   }
 
   if (rc)
   {
-    LOG_ERROR_STR( itsLogPrefix << "Failure starting remote command: " << rc << " (" << explainLibSSH2Error(rc) << ")");
+    LOG_ERROR_STR( itsLogPrefix << "Failure starting remote command: " << rc);
     return;
   }
 
@@ -411,7 +341,7 @@ void SSHconnection::commThread()
 
       /* loop until we block */
       do {
-        rc = libssh2_channel_read_ex(channel, s, data[s], sizeof data[s]);
+        rc = libssh2_channel_read_ex( channel, s, data[s], sizeof data[s] );
         if( rc > 0 )
         {
           if (s == 0 && itsCaptureStdout) {
@@ -439,7 +369,7 @@ void SSHconnection::commThread()
               if (!buffer.good()) {
                 // 'line' now holds the remnant
 
-                if (line[s].size() > 10240) {
+                if (line[s].size() > 1024) {
                   LOG_ERROR_STR( itsLogPrefix << "Line too long (" << line[s].size() << "); truncated: " << line[s] );
                   line[s] = "";
                 }
@@ -460,7 +390,7 @@ void SSHconnection::commThread()
         } else {
           if( rc < 0 && rc != LIBSSH2_ERROR_EAGAIN ) {
             /* no need to output this for the EAGAIN case */
-            LOG_ERROR_STR( itsLogPrefix << "libssh2_channel_read_ex returned " << rc << " (" << explainLibSSH2Error(rc) << ") for channel " << s);
+            LOG_ERROR_STR( itsLogPrefix << "libssh2_channel_read_ex returned " << rc << " for channel " << s);
           }   
         }
       } while( rc > 0 );
@@ -475,24 +405,22 @@ void SSHconnection::commThread()
     }
 
     if (nrOpenStreams > 0)
-      waitsocket(session, *sock);
+      waitsocket(*sock);
   }
 
   LOG_DEBUG_STR( itsLogPrefix << "Disconnecting" );
 
-  close_channel(session, channel, *sock);
+  close_channel(*sock);
 
   if (rc == 0)
   {
-    exitcode = libssh2_channel_get_exit_status(channel);
+    exitcode = libssh2_channel_get_exit_status( channel );
     libssh2_channel_get_exit_signal(channel, &exitsignal,
                                     NULL, NULL, NULL, NULL, NULL);
   } else {
     exitcode = 127;
   }
 
-  close_session(session, *sock);
-
   if (exitsignal) {
     LOG_ERROR_STR(itsLogPrefix << "SSH was killed by signal " << exitsignal);
   } else if(exitcode > 0) {
@@ -501,70 +429,6 @@ void SSHconnection::commThread()
     LOG_INFO_STR(itsLogPrefix << "Terminated normally");
   }
 }
-
-
-const char *explainLibSSH2Error( int error )
-{
-  const char *explanation;
-
-  switch(error) {
-    default:
-      explanation = "??";
-      break;
-
-      case LIBSSH2_ERROR_NONE:			        explanation ="LIBSSH2_ERROR_NONE"; break;
-      case LIBSSH2_ERROR_SOCKET_NONE:			explanation ="LIBSSH2_ERROR_SOCKET_NONE"; break;
-      case LIBSSH2_ERROR_BANNER_RECV:			explanation ="LIBSSH2_ERROR_BANNER_RECV"; break;
-      case LIBSSH2_ERROR_BANNER_SEND:			explanation ="LIBSSH2_ERROR_BANNER_SEND"; break;
-      case LIBSSH2_ERROR_INVALID_MAC:			explanation ="LIBSSH2_ERROR_INVALID_MAC"; break;
-      case LIBSSH2_ERROR_KEX_FAILURE:			explanation ="LIBSSH2_ERROR_KEX_FAILURE"; break;
-      case LIBSSH2_ERROR_ALLOC:			        explanation ="LIBSSH2_ERROR_ALLOC"; break;
-      case LIBSSH2_ERROR_SOCKET_SEND:			explanation ="LIBSSH2_ERROR_SOCKET_SEND"; break;
-      case LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE:		explanation ="LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE"; break;
-      case LIBSSH2_ERROR_TIMEOUT:			explanation ="LIBSSH2_ERROR_TIMEOUT"; break;
-      case LIBSSH2_ERROR_HOSTKEY_INIT:			explanation ="LIBSSH2_ERROR_HOSTKEY_INIT"; break;
-      case LIBSSH2_ERROR_HOSTKEY_SIGN:			explanation ="LIBSSH2_ERROR_HOSTKEY_SIGN"; break;
-      case LIBSSH2_ERROR_DECRYPT:			explanation ="LIBSSH2_ERROR_DECRYPT"; break;
-      case LIBSSH2_ERROR_SOCKET_DISCONNECT:		explanation ="LIBSSH2_ERROR_SOCKET_DISCONNECT"; break;
-      case LIBSSH2_ERROR_PROTO:			        explanation ="LIBSSH2_ERROR_PROTO"; break;
-      case LIBSSH2_ERROR_PASSWORD_EXPIRED:		explanation ="LIBSSH2_ERROR_PASSWORD_EXPIRED"; break;
-      case LIBSSH2_ERROR_FILE:			        explanation ="LIBSSH2_ERROR_FILE"; break;
-      case LIBSSH2_ERROR_METHOD_NONE:			explanation ="LIBSSH2_ERROR_METHOD_NONE"; break;
-      case LIBSSH2_ERROR_AUTHENTICATION_FAILED:		explanation ="LIBSSH2_ERROR_AUTHENTICATION_FAILED"; break;
-      //case LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED:	explanation ="LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED"; break;
-      case LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED:		explanation ="LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED"; break;
-      case LIBSSH2_ERROR_CHANNEL_OUTOFORDER:		explanation ="LIBSSH2_ERROR_CHANNEL_OUTOFORDER"; break;
-      case LIBSSH2_ERROR_CHANNEL_FAILURE:		explanation ="LIBSSH2_ERROR_CHANNEL_FAILURE"; break;
-      case LIBSSH2_ERROR_CHANNEL_REQUEST_DENIED:	explanation ="LIBSSH2_ERROR_CHANNEL_REQUEST_DENIED"; break;
-      case LIBSSH2_ERROR_CHANNEL_UNKNOWN:		explanation ="LIBSSH2_ERROR_CHANNEL_UNKNOWN"; break;
-      case LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED:	explanation ="LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED"; break;
-      case LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED:	explanation ="LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED"; break;
-      case LIBSSH2_ERROR_CHANNEL_CLOSED:		explanation ="LIBSSH2_ERROR_CHANNEL_CLOSED"; break;
-      case LIBSSH2_ERROR_CHANNEL_EOF_SENT:		explanation ="LIBSSH2_ERROR_CHANNEL_EOF_SENT"; break;
-      case LIBSSH2_ERROR_SCP_PROTOCOL:			explanation ="LIBSSH2_ERROR_SCP_PROTOCOL"; break;
-      case LIBSSH2_ERROR_ZLIB:			        explanation ="LIBSSH2_ERROR_ZLIB"; break;
-      case LIBSSH2_ERROR_SOCKET_TIMEOUT:		explanation ="LIBSSH2_ERROR_SOCKET_TIMEOUT"; break;
-      case LIBSSH2_ERROR_SFTP_PROTOCOL:			explanation ="LIBSSH2_ERROR_SFTP_PROTOCOL"; break;
-      case LIBSSH2_ERROR_REQUEST_DENIED:		explanation ="LIBSSH2_ERROR_REQUEST_DENIED"; break;
-      case LIBSSH2_ERROR_METHOD_NOT_SUPPORTED:		explanation ="LIBSSH2_ERROR_METHOD_NOT_SUPPORTED"; break;
-      case LIBSSH2_ERROR_INVAL:			        explanation ="LIBSSH2_ERROR_INVAL"; break;
-      case LIBSSH2_ERROR_INVALID_POLL_TYPE:		explanation ="LIBSSH2_ERROR_INVALID_POLL_TYPE"; break;
-      case LIBSSH2_ERROR_PUBLICKEY_PROTOCOL:		explanation ="LIBSSH2_ERROR_PUBLICKEY_PROTOCOL"; break;
-      case LIBSSH2_ERROR_EAGAIN:			explanation ="LIBSSH2_ERROR_EAGAIN"; break;
-      case LIBSSH2_ERROR_BUFFER_TOO_SMALL:		explanation ="LIBSSH2_ERROR_BUFFER_TOO_SMALL"; break;
-      case LIBSSH2_ERROR_BAD_USE:			explanation ="LIBSSH2_ERROR_BAD_USE"; break;
-      case LIBSSH2_ERROR_COMPRESS:			explanation ="LIBSSH2_ERROR_COMPRESS"; break;
-      case LIBSSH2_ERROR_OUT_OF_BOUNDARY:		explanation ="LIBSSH2_ERROR_OUT_OF_BOUNDARY"; break;
-      case LIBSSH2_ERROR_AGENT_PROTOCOL:		explanation ="LIBSSH2_ERROR_AGENT_PROTOCOL"; break;
-      case LIBSSH2_ERROR_SOCKET_RECV:			explanation ="LIBSSH2_ERROR_SOCKET_RECV"; break;
-      case LIBSSH2_ERROR_ENCRYPT:			explanation ="LIBSSH2_ERROR_ENCRYPT"; break;
-      case LIBSSH2_ERROR_BAD_SOCKET:			explanation ="LIBSSH2_ERROR_BAD_SOCKET"; break;
-      case LIBSSH2_ERROR_KNOWN_HOSTS:			explanation ="LIBSSH2_ERROR_KNOWN_HOSTS"; break;
-      //case LIBSSH2_ERROR_BANNER_NONE:			explanation ="LIBSSH2_ERROR_BANNER_NONE"; break;
-  }
-
-  return explanation;
-}
  
 std::vector< SmartPtr<Mutex> > openssl_mutexes;
 
diff --git a/RTCP/IONProc/src/SSH.h b/RTCP/IONProc/src/SSH.h
index db69c12429d4098f140fc6fc5c71a19dacb84a05..e9bf02c471de229fd5c669bfa5eca0b3cbf5046a 100644
--- a/RTCP/IONProc/src/SSH.h
+++ b/RTCP/IONProc/src/SSH.h
@@ -50,7 +50,7 @@ class SSHconnection {
 public:
   EXCEPTION_CLASS(SSHException, LOFAR::Exception);
 
-  SSHconnection(const std::string &logPrefix, const std::string &hostname, const std::string &commandline, const std::string &username, const std::string &sshkey, bool captureStdout = false);
+  SSHconnection(const string &logPrefix, const string &hostname, const string &commandline, const string &username, const string &sshkey, bool captureStdout = false);
 
   ~SSHconnection();
 
@@ -61,7 +61,7 @@ public:
 
   bool isDone();
 
-  std::string stdoutBuffer() const;
+  string stdoutBuffer() const;
 
 private:
   const string itsLogPrefix;
@@ -72,20 +72,23 @@ private:
 
   SmartPtr<Thread> itsThread;
   const bool itsCaptureStdout;
-  std::stringstream itsStdoutBuffer;
+  stringstream itsStdoutBuffer;
 
-  bool waitsocket( LIBSSH2_SESSION *session, FileDescriptorBasedStream &sock );
+  static void free_session( LIBSSH2_SESSION *session );
+  static void free_channel( LIBSSH2_CHANNEL *channel );
 
-  LIBSSH2_SESSION *open_session( FileDescriptorBasedStream &sock );
-  void close_session( LIBSSH2_SESSION *session, FileDescriptorBasedStream &sock );
-  LIBSSH2_CHANNEL *open_channel( LIBSSH2_SESSION *session, FileDescriptorBasedStream &sock );
-  void close_channel( LIBSSH2_SESSION *session, LIBSSH2_CHANNEL *channel, FileDescriptorBasedStream &sock );
+  SmartPtr<LIBSSH2_SESSION, SmartPtrFreeFunc<LIBSSH2_SESSION, free_session> > session;
+  SmartPtr<LIBSSH2_CHANNEL, SmartPtrFreeFunc<LIBSSH2_CHANNEL, free_channel> > channel;
+
+  bool waitsocket( FileDescriptorBasedStream &sock );
+
+  bool open_session( FileDescriptorBasedStream &sock );
+  bool open_channel( FileDescriptorBasedStream &sock );
+  bool close_channel( FileDescriptorBasedStream &sock );
 
   void commThread();
 };
 
-const char *explainLibSSH2Error( int error );
-
 #endif
 
 pid_t forkSSH(const std::string &logPrefix, const char *hostName, const char * const extraParams[], const char *userName, const char *sshKey);
diff --git a/RTCP/IONProc/test/CMakeLists.txt b/RTCP/IONProc/test/CMakeLists.txt
index 917cf3720ba83b0ca48d678a8a92033271ab4dfe..0cc60d5c9d04f625bc12a0b35cb34b9ccde424ed 100644
--- a/RTCP/IONProc/test/CMakeLists.txt
+++ b/RTCP/IONProc/test/CMakeLists.txt
@@ -6,6 +6,7 @@ include(LofarCTest)
 include_directories(${PACKAGE_SOURCE_DIR}/src)
 
 lofar_add_test(tDelayCompensation tDelayCompensation.cc)
-lofar_add_test(tRSP tRSP.cc)
 lofar_add_test(tSSH tSSH.cc)
 #lofar_add_test(tRSPTimeStamp tRSPTimeStamp.cc)
+
+#add_subdirectory(newInputSection)
diff --git a/RTCP/IONProc/test/newInputSection/CMakeLists.txt b/RTCP/IONProc/test/newInputSection/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..875538d004f36d4ac28e6b09cbd702a0ddf0324f
--- /dev/null
+++ b/RTCP/IONProc/test/newInputSection/CMakeLists.txt
@@ -0,0 +1 @@
+lofar_add_test(newInputSection newInputSection.cc)
diff --git a/RTCP/InputProc/src/OMPThread.h b/RTCP/IONProc/test/newInputSection/OMPThread.h
similarity index 68%
rename from RTCP/InputProc/src/OMPThread.h
rename to RTCP/IONProc/test/newInputSection/OMPThread.h
index 0325860fb1de89ce7dd5bfd5813647702b68ece0..014478942387a75afbf3552fda81c8a07de21d52 100644
--- a/RTCP/InputProc/src/OMPThread.h
+++ b/RTCP/IONProc/test/newInputSection/OMPThread.h
@@ -9,18 +9,6 @@
 
 namespace LOFAR {
 
-/*
- * Represents an OpenMP thread. To use,
- * call start() and stop() at the beginning and end
- * of an OpenMP thread. The kill() command can then
- * be used by another thread to kill the OpenMP thread.
- *
- * The thread is killed by sending SIGHUP to it until
- * stop() is called by the thread.
- *
- * To be able to use this class properly, please call
- * OMPThread::init() to clear the SIGHUP handler.
- */
 class OMPThread {
 public:
   OMPThread(): id(0), stopped(false) {}
@@ -68,20 +56,9 @@ public:
     OMPThread &thread;
   };
 
-  static void init() {
-    signal(SIGHUP, sighandler);
-    siginterrupt(SIGHUP, 1);
-  }
-
 private:
   volatile pthread_t id;
   volatile bool stopped;
-
-  static void sighandler(int) {
-    /* no-op. We use SIGHUP only
-     * to interrupt system calls.
-     */
-  }
 };
 
 }
diff --git a/RTCP/InputProc/src/obsolete/Poll.h b/RTCP/IONProc/test/newInputSection/Poll.h
similarity index 100%
rename from RTCP/InputProc/src/obsolete/Poll.h
rename to RTCP/IONProc/test/newInputSection/Poll.h
diff --git a/RTCP/InputProc/src/Ranges.cc b/RTCP/IONProc/test/newInputSection/Ranges.h
similarity index 62%
rename from RTCP/InputProc/src/Ranges.cc
rename to RTCP/IONProc/test/newInputSection/Ranges.h
index 1f7ff3de732ac77313c3cb76f39925b26e4ba1f3..48d3e669918a3d09a419b546a9ee4c9fa5166f0e 100644
--- a/RTCP/InputProc/src/Ranges.cc
+++ b/RTCP/IONProc/test/newInputSection/Ranges.h
@@ -1,10 +1,66 @@
-#include <lofar_config.h>
-#include "Ranges.h"
+#ifndef RANGES
+#define RANGES
+
+#include <Interface/SparseSet.h>
 #include <Common/LofarLogger.h>
+#include <Common/LofarTypes.h>
+
+#include <ostream>
 
 namespace LOFAR {
 namespace RTCP {
 
+//
+// Thread-safe set of int64 [from,to) ranges.
+//
+class Ranges {
+public:
+  Ranges();
+  Ranges( void *data, size_t numBytes, int64 minHistory, bool create );
+  ~Ranges();
+
+  // remove [0,to)
+  void excludeBefore( int64 to );
+
+  // add a range [from,to), and return whether the addition
+  // was succesful.
+  bool include( int64 from, int64 to );
+
+  // returns whether there is anything set in [first, last)
+  bool anythingBetween( int64 first, int64 last ) const;
+
+  SparseSet<int64> sparseSet( int64 first, int64 last ) const;
+
+private:
+  struct Range {
+    // Write'from' before 'to' to allow the following invariant:
+    //
+    // from <  to   : a valid range
+    // from >= to   : invalid range (being written)
+    // from = to = 0: an unused range
+    volatile int64 from, to;
+
+    Range(): from(0), to(0) {}
+  };
+
+  size_t len;
+  Range * ranges;
+  Range * begin;
+  Range * end;
+  Range *head;
+
+  // minimal history to maintain (samples newer than this
+  // will be maintained in favour of newly added ranges)
+  int64 minHistory;
+
+public:
+  static size_t size(size_t numElements) {
+    return numElements * sizeof(struct Range);
+  }
+
+  friend std::ostream& operator<<( std::ostream &str, const Ranges &r );
+};
+
 std::ostream& operator<<( std::ostream &str, const Ranges &r )
 {
   
@@ -17,7 +73,6 @@ std::ostream& operator<<( std::ostream &str, const Ranges &r )
 
 Ranges::Ranges()
 :
-  create(false),
   len(0),
   ranges(0),
   begin(0),
@@ -29,7 +84,6 @@ Ranges::Ranges()
 
 Ranges::Ranges( void *data, size_t numBytes, int64 minHistory, bool create )
 :
-  create(create),
   len(numBytes / sizeof *ranges),
   ranges(create ? new(data)Range[len] : static_cast<Range*>(data)),
   begin(&ranges[0]),
@@ -42,9 +96,8 @@ Ranges::Ranges( void *data, size_t numBytes, int64 minHistory, bool create )
 
 Ranges::~Ranges()
 {
-  if (create)
-    for (struct Range *i = begin; i != end; ++i)
-      i->~Range();
+  for (struct Range *i = begin; i != end; ++i)
+    i->~Range();
 }
 
 void Ranges::excludeBefore( int64 to )
@@ -57,7 +110,7 @@ void Ranges::excludeBefore( int64 to )
       continue;
     }
 
-    if (i->from < to) {
+    if (i->from > to) {
       // shorten
       i->from = to;
     }
@@ -70,7 +123,7 @@ bool Ranges::include( int64 from, int64 to )
   ASSERTSTR( from >= head->to, from << " >= " << head->to );
 
   if (head->to == 0) {
-    // *head is unused, set 'from' first!
+    // *head is unused
     head->from = from;
     head->to   = to;
     return true;
@@ -85,8 +138,8 @@ bool Ranges::include( int64 from, int64 to )
   // new range is needed
   struct Range * const next = head + 1 == end ? begin : head + 1;
 
-  if (next->to == 0 || next->to < to - minHistory) {
-    // range at 'next' is either unused or old enough to toss away
+  if (next->to < to - minHistory) {
+    // range at 'next' is old enough to toss away
     next->from = from;
     next->to   = to;
 
@@ -159,3 +212,6 @@ SparseSet<int64> Ranges::sparseSet( int64 first, int64 last ) const
 
 }
 }
+
+#endif
+
diff --git a/RTCP/InputProc/src/SampleBuffer.h b/RTCP/IONProc/test/newInputSection/SampleBuffer.h
similarity index 64%
rename from RTCP/InputProc/src/SampleBuffer.h
rename to RTCP/IONProc/test/newInputSection/SampleBuffer.h
index 33ebf5930b0ebbe936b11e13b8531167e352a3ec..73ca26e778227358ebf80e5902278f7d29cad3de 100644
--- a/RTCP/InputProc/src/SampleBuffer.h
+++ b/RTCP/IONProc/test/newInputSection/SampleBuffer.h
@@ -2,65 +2,69 @@
 #define __SAMPLEBUFFER__
 
 #include <Common/LofarLogger.h>
+#include <Common/LofarConstants.h>
 #include <Interface/MultiDimArray.h>
 #include <Interface/Allocator.h>
-#include "BufferSettings.h"
+#include "StationSettings.h"
 #include "SharedMemory.h"
 #include "Ranges.h"
-#include "SampleType.h"
 #include <string>
-#include <vector>
-#include <boost/format.hpp>
+#include <complex>
 
 namespace LOFAR {
 namespace RTCP {
 
-
 template<typename T> class SampleBuffer {
 public:
-  SampleBuffer( const struct BufferSettings &settings, bool create );
+  SampleBuffer( const struct StationSettings &settings, bool create );
+
+  struct SampleType {
+    std::complex<T> x;
+    std::complex<T> y;
+  };
 
 private:
   const std::string logPrefix;
   SharedMemoryArena data;
   SparseSetAllocator allocator;
 
-  struct BufferSettings *initSettings( const struct BufferSettings &localSettings, bool create );
+  struct StationSettings *initSettings( const struct StationSettings &localSettings, bool create );
 
-  static size_t dataSize( const struct BufferSettings &settings ) {
+  static size_t dataSize( const struct StationSettings &settings ) {
     return sizeof settings
-         + settings.nrBoards * (Ranges::size(settings.nrFlagRanges) + 8)
+         + NR_RSPBOARDS * (Ranges::size(settings.nrFlagRanges) + 8)
          + settings.nrBeamlets * (settings.nrSamples * sizeof(T) + 128);
   }
 
 public:
-  struct BufferSettings *settings;
+  struct StationSettings *settings;
 
   const size_t nrBeamlets;
   const size_t nrSamples;
-  const size_t nrBoards;
-  const size_t nrFlagRanges; // width of each flag range
+  const size_t nrFlagRanges;
 
   MultiDimArray<T,2>  beamlets; // [subband][sample]
   std::vector<Ranges> flags;    // [rspboard]
 };
 
 
-template<typename T> SampleBuffer<T>::SampleBuffer( const struct BufferSettings &_settings, bool create )
+template<typename T> SampleBuffer<T>::SampleBuffer( const struct StationSettings &_settings, bool create )
 :
-  logPrefix(str(boost::format("[station %s %s board] [SampleBuffer] ") % _settings.station.stationName % _settings.station.antennaField)),
+  logPrefix(str(boost::format("[station %s %s board] [SampleBuffer] ") % _settings.station.stationName % _settings.station.antennaSet)),
   data(_settings.dataKey, dataSize(_settings), create ? SharedMemoryArena::CREATE_EXCL : SharedMemoryArena::READ),
   allocator(data),
   settings(initSettings(_settings, create)),
 
   nrBeamlets(settings->nrBeamlets),
   nrSamples(settings->nrSamples),
-  nrBoards(settings->nrBoards),
   nrFlagRanges(settings->nrFlagRanges),
 
   beamlets(boost::extents[nrBeamlets][nrSamples], 128, allocator, false, false),
-  flags(nrBoards)
+  flags(settings->nrBoards)
 {
+  // bitmode must coincide with our template
+  ASSERT( sizeof(T) == N_POL * 2 * settings->station.bitmode / 8 );
+
   for (size_t f = 0; f < flags.size(); f++) {
     size_t numBytes = Ranges::size(nrFlagRanges);
 
@@ -70,9 +74,10 @@ template<typename T> SampleBuffer<T>::SampleBuffer( const struct BufferSettings
   LOG_INFO_STR( logPrefix << "Initialised" );
 }
 
-template<typename T> struct BufferSettings *SampleBuffer<T>::initSettings( const struct BufferSettings &localSettings, bool create )
+template<typename T> struct StationSettings *SampleBuffer<T>::initSettings( const struct StationSettings &localSettings, bool create )
 {
-  struct BufferSettings *sharedSettings = allocator.allocateTyped();
+  //struct StationSettings *sharedSettings = allocator.allocateTyped<struct StationSettings>();
+  struct StationSettings *sharedSettings = allocator.allocateTyped();
 
   if (create) {
     // register settings
diff --git a/RTCP/InputProc/src/SharedMemory.cc b/RTCP/IONProc/test/newInputSection/SharedMemory.h
similarity index 64%
rename from RTCP/InputProc/src/SharedMemory.cc
rename to RTCP/IONProc/test/newInputSection/SharedMemory.h
index feb114537ceb466c1e427210d893f86c0415097c..4de23a0a141b7d740a468010995e8c3a665552fd 100644
--- a/RTCP/InputProc/src/SharedMemory.cc
+++ b/RTCP/IONProc/test/newInputSection/SharedMemory.h
@@ -1,8 +1,10 @@
-#include <lofar_config.h>
-#include "SharedMemory.h"
+#ifndef SHARED_MEMORY
+#define SHARED_MEMORY
+
 #include <Common/Exception.h>
 #include <Common/SystemCallException.h>
 #include <Common/LofarLogger.h>
+#include <Interface/Allocator.h>
 
 #include <sys/ipc.h>
 #include <sys/shm.h>
@@ -13,6 +15,48 @@
 namespace LOFAR {
 namespace RTCP {
 
+class SharedMemoryArena: public FixedArena {
+public:
+  EXCEPTION_CLASS(TimeOutException, LOFAR::Exception);
+
+  enum Mode {
+    CREATE,
+    CREATE_EXCL,
+    READ,
+    READWRITE
+  };
+
+  SharedMemoryArena( key_t key, size_t size, Mode mode = CREATE, time_t timeout = 60 );
+  ~SharedMemoryArena();
+
+  template <typename T> T* ptr( size_t offset = 0 ) const {
+    return reinterpret_cast<T*>(reinterpret_cast<char*>(itsBegin) + offset);
+  }
+
+private:
+  const key_t key;
+  const Mode mode;
+  int shmid;
+};
+
+template<typename T> class SharedStruct {
+public:
+  SharedStruct( key_t key, bool create = false, time_t timeout = 60 );
+
+  T &get() {
+    return *data.ptr<T>();
+  }
+
+  T &get() const {
+    return *data.ptr<T>();
+  }
+
+private:
+  SharedMemoryArena data;
+
+  SharedStruct( const SharedStruct & );
+  SharedStruct &operator=( const SharedStruct & );
+};
 
 SharedMemoryArena::SharedMemoryArena( key_t key, size_t size, Mode mode, time_t timeout )
 :
@@ -92,6 +136,14 @@ SharedMemoryArena::~SharedMemoryArena()
   }
 }
 
+template<typename T> SharedStruct<T>::SharedStruct( key_t key, bool create, time_t timeout )
+:
+  data(key, sizeof(T), create ? SharedMemoryArena::CREATE : SharedMemoryArena::READWRITE, timeout)
+{
+}
 
 }
 }
+
+#endif
+
diff --git a/RTCP/IONProc/test/newInputSection/StationData.h b/RTCP/IONProc/test/newInputSection/StationData.h
new file mode 100644
index 0000000000000000000000000000000000000000..1dd93434314ba4e715aa4a32a3563e4efa1d5c23
--- /dev/null
+++ b/RTCP/IONProc/test/newInputSection/StationData.h
@@ -0,0 +1,390 @@
+#ifndef __STATIONDATA__
+#define __STATIONDATA__
+
+#include <Common/LofarLogger.h>
+#include <Stream/Stream.h>
+#include <Interface/RSPTimeStamp.h>
+#include <Interface/SmartPtr.h>
+#include <RSP.h>
+#include <WallClockTime.h>
+#include "SampleBuffer.h"
+#include "Ranges.h"
+#include "StationSettings.h"
+#include <string>
+#include <cstring>
+#include <omp.h>
+
+namespace LOFAR {
+namespace RTCP {
+
+template<typename T> class RSPBoard {
+public:
+  RSPBoard( Stream &inputStream, SampleBuffer<T> &buffer, unsigned boardNr, const struct StationSettings &settings );
+
+  const unsigned nr;
+
+  bool readPacket();
+  void writePacket();
+
+  static size_t packetSize( struct RSP &packet ) {
+    return sizeof(struct RSP::Header) + packet.header.nrBeamlets * packet.header.nrBlocks * sizeof(T);
+  }
+  
+private:
+  const std::string logPrefix;
+
+  Stream &inputStream;
+  const bool supportPartialReads;
+  struct RSP packet;
+  TimeStamp last_timestamp;
+  TimeStamp last_logtimestamp;
+
+  SampleBuffer<T> &buffer;
+  Ranges &flags;
+  const struct StationSettings settings;
+  const size_t firstBeamlet;
+
+  size_t nrReceived, nrBadSize, nrBadTime, nrOutOfOrder;
+
+  void logStatistics();
+};
+
+template<typename T> RSPBoard<T>::RSPBoard( Stream &inputStream, SampleBuffer<T> &buffer, unsigned boardNr, const struct StationSettings &settings )
+:
+  nr(boardNr),
+  logPrefix(str(boost::format("[station %s %s board %u] [RSPBoard] ") % settings.station.stationName % settings.station.antennaSet % nr)),
+  inputStream(inputStream),
+  supportPartialReads(dynamic_cast<SocketStream *>(&inputStream) == 0 || dynamic_cast<SocketStream &>(inputStream).protocol != SocketStream::UDP),
+
+  buffer(buffer),
+  flags(buffer.flags[boardNr]),
+  settings(settings),
+  firstBeamlet(settings.nrBeamlets / settings.nrBoards * boardNr),
+
+  nrReceived(0),
+  nrBadSize(0),
+  nrBadTime(0),
+  nrOutOfOrder(0)
+{
+}
+
+template<typename T> void RSPBoard<T>::writePacket()
+{
+  const uint8 &nrBeamlets  = packet.header.nrBeamlets;
+  const uint8 &nrTimeslots = packet.header.nrBlocks;
+
+  // the timestamp is of the last read packet by definition
+  const TimeStamp &timestamp = last_timestamp;
+
+  const size_t from_offset = (int64)timestamp % settings.nrSamples;
+  size_t to_offset = ((int64)timestamp + nrTimeslots) % settings.nrSamples;
+
+  if (to_offset == 0)
+    to_offset = settings.nrSamples;
+
+  const size_t wrap = from_offset < to_offset ? 0 : settings.nrSamples - from_offset;
+
+  const T *beamlets = reinterpret_cast<const T*>(&packet.data);
+
+  ASSERT( nrBeamlets <= settings.nrBeamlets / settings.nrBoards );
+
+  // mark data we overwrite as invalid
+  flags.excludeBefore(timestamp + nrTimeslots - settings.nrSamples);
+
+  // transpose
+  for (uint8 b = 0; b < nrBeamlets; ++b) {
+    T *dst1 = &buffer.beamlets[firstBeamlet + b][from_offset];
+
+    if (wrap > 0) {
+      T *dst2 = &buffer.beamlets[firstBeamlet + b][0];
+
+      memcpy(dst1, beamlets, wrap        * sizeof(T));
+      memcpy(dst2, beamlets, to_offset   * sizeof(T));
+    } else {
+      memcpy(dst1, beamlets, nrTimeslots * sizeof(T));
+    }
+
+    beamlets += nrTimeslots;
+  }
+
+  // mark as valid
+  flags.include(timestamp, timestamp + nrTimeslots);
+}
+
+template<typename T> bool RSPBoard<T>::readPacket()
+{
+  if (supportPartialReads) {
+    // read header first
+    inputStream.read(&packet, sizeof(struct RSP::Header));
+
+    // read rest of packet
+    inputStream.read(&packet.data, packetSize(packet) - sizeof(struct RSP::Header));
+
+    ++nrReceived;
+  } else {
+    // read full packet at once -- numbytes will tell us how much we've actually read
+    size_t numbytes = inputStream.tryRead(&packet, sizeof packet);
+
+    ++nrReceived;
+
+    if( numbytes < sizeof(struct RSP::Header)
+     || numbytes != packetSize(packet) ) {
+      LOG_WARN_STR( logPrefix << "Packet is " << numbytes << " bytes, but should be " << packetSize(packet) << " bytes" );
+
+      ++nrBadSize;
+      return false;
+    }
+  }
+
+  // check sanity of packet
+
+  // detect bad timestamp
+  if (packet.header.timestamp == ~0U) {
+    ++nrBadTime;
+    return false;
+  }
+
+  const TimeStamp timestamp(packet.header.timestamp, packet.header.blockSequenceNumber, settings.station.clock);
+
+  // detect out-of-order data
+  if (timestamp < last_timestamp) {
+    ++nrOutOfOrder;
+    return false;
+  }
+
+  // don't accept big jumps (>10s) in timestamp
+  const int64 oneSecond = settings.station.clock / 1024;
+
+  if (last_timestamp && packet.header.timestamp > last_timestamp + 10 * oneSecond) {
+    ++nrBadTime;
+    return false;
+  }
+
+  // packet was read and is sane
+
+  last_timestamp = timestamp;
+
+  if (timestamp > last_logtimestamp + oneSecond) {
+    logStatistics();
+
+    last_logtimestamp = timestamp;
+  }
+
+  return true;
+}
+
+
+template<typename T> void RSPBoard<T>::logStatistics()
+{
+  LOG_INFO_STR( logPrefix << "Received " << nrReceived << " packets: " << nrOutOfOrder << " out of order, " << nrBadTime << " bad timestamps, " << nrBadSize << " bad sizes" );
+
+  nrReceived = 0;
+  nrOutOfOrder = 0;
+  nrBadTime = 0;
+  nrBadSize = 0;
+}
+
+
+class StationStreams {
+public:
+  StationStreams( const std::string &logPrefix, const StationSettings &settings, const std::vector<std::string> &streamDescriptors );
+
+  void process();
+
+  void stop();
+
+protected:
+  const std::string logPrefix;
+  const StationSettings settings;
+  const std::vector<std::string> streamDescriptors;
+  const size_t nrBoards;
+
+  WallClockTime waiter;
+
+  virtual void processBoard( size_t nr ) = 0;
+};
+
+StationStreams::StationStreams( const std::string &logPrefix, const StationSettings &settings, const std::vector<std::string> &streamDescriptors )
+:
+  logPrefix(logPrefix),
+  settings(settings),
+  streamDescriptors(streamDescriptors),
+  nrBoards(streamDescriptors.size())
+{
+}
+
+void StationStreams::process()
+{
+  std::vector<OMPThread> threads(nrBoards);
+
+  ASSERT(nrBoards > 0);
+
+  LOG_INFO_STR( logPrefix << "Start" );
+
+  #pragma omp parallel sections num_threads(2)
+  {
+    #pragma omp section
+    {
+      // start all boards
+      LOG_INFO_STR( logPrefix << "Starting all boards" );
+      #pragma omp parallel for num_threads(nrBoards)
+      for (size_t i = 0; i < nrBoards; ++i) {
+        OMPThread::ScopedRun sr(threads[i]);
+  
+        processBoard(i);
+      }
+    }
+
+    #pragma omp section
+    {
+      // wait until we have to stop
+      LOG_INFO_STR( logPrefix << "Waiting for stop signal" );
+      waiter.waitForever();     
+
+      // kill all boards
+      LOG_INFO_STR( logPrefix << "Stopping all boards" );
+      #pragma omp parallel for num_threads(nrBoards)
+      for (size_t i = 0; i < nrBoards; ++i)
+        threads[i].kill();
+    }
+  }
+
+  LOG_INFO_STR( logPrefix << "End" );
+}
+
+void StationStreams::stop()
+{
+  waiter.cancelWait();
+}
+
+
+template<typename T> class Station: public StationStreams {
+public:
+  Station( const StationSettings &settings, const std::vector<std::string> &streamDescriptors );
+
+protected:
+  SampleBuffer<T> buffer;
+
+  virtual void processBoard( size_t nr );
+};
+
+template<typename T> Station<T>::Station( const StationSettings &settings, const std::vector<std::string> &streamDescriptors )
+:
+  StationStreams(str(boost::format("[station %s %s] [Station] ") % settings.station.stationName % settings.station.antennaSet), settings, streamDescriptors),
+
+  buffer(settings, true)
+{
+  LOG_INFO_STR( logPrefix << "Initialised" );
+}
+
+template<typename T> void Station<T>::processBoard( size_t nr )
+{
+  const std::string logPrefix(str(boost::format("[station %s %s board %u] [Station] ") % settings.station.stationName % settings.station.antennaSet % nr));
+
+  try {
+    LOG_INFO_STR( logPrefix << "Connecting to " << streamDescriptors[nr] );
+    SmartPtr<Stream> s = createStream(streamDescriptors[nr], true);
+
+    LOG_INFO_STR( logPrefix << "Connecting to shared memory buffer 0x" << std::hex << settings.dataKey );
+    RSPBoard<T> board(*s, buffer, nr, settings);
+
+    LOG_INFO_STR( logPrefix << "Start" );
+
+    for(;;)
+      if (board.readPacket())
+        board.writePacket();
+
+  } catch (Stream::EndOfStreamException &ex) {
+    LOG_INFO_STR( logPrefix << "End of stream");
+  } catch (SystemCallException &ex) {
+    if (ex.error == EINTR)
+      LOG_INFO_STR( logPrefix << "Aborted: " << ex.what());
+    else
+      LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex);
+  } catch (Exception &ex) {
+    LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex);
+  }
+
+  LOG_INFO_STR( logPrefix << "End");
+}
+
+
+template<typename T> class Generator: public StationStreams {
+public:
+  Generator( const StationSettings &settings, const std::vector<std::string> &streamDescriptors );
+
+protected:
+  void processBoard( size_t nr );
+
+  virtual void makePacket( struct RSP &header, const TimeStamp &timestamp );
+};
+
+template<typename T> Generator<T>::Generator( const StationSettings &settings, const std::vector<std::string> &streamDescriptors )
+:
+  StationStreams(str(boost::format("[station %s %s] [Generator] ") % settings.station.stationName % settings.station.antennaSet), settings, streamDescriptors)
+{
+  LOG_INFO_STR( logPrefix << "Initialised" );
+}
+
+template<typename T> void Generator<T>::makePacket( struct RSP &packet, const TimeStamp &timestamp )
+{
+  packet.header.nrBeamlets = settings.nrBeamlets / settings.nrBoards;
+  packet.header.nrBlocks = 16;
+
+  packet.header.timestamp = timestamp.getSeqId();
+  packet.header.blockSequenceNumber = timestamp.getBlockId();
+
+  int64 data = timestamp;
+
+  memset(packet.data, data & 0xFF, sizeof packet.data);
+}
+
+template<typename T> void Generator<T>::processBoard( size_t nr )
+{
+  const std::string logPrefix(str(boost::format("[station %s %s board %u] [Generator] ") % settings.station.stationName % settings.station.antennaSet % nr));
+
+  try {
+    LOG_INFO_STR( logPrefix << "Connecting to " << streamDescriptors[nr] );
+    SmartPtr<Stream> s = createStream(streamDescriptors[nr], false);
+
+    LOG_INFO_STR( logPrefix << "Start" );
+
+    TimeStamp current(time(0L) + 1, 0, settings.station.clock);
+    for(;;) {
+      struct RSP packet;
+
+      makePacket( packet, current );
+
+      ASSERT(RSPBoard<T>::packetSize(packet) <= sizeof packet);
+     
+      if (!waiter.waitUntil(current))
+        break;
+
+      try {
+        s->write(&packet, RSPBoard<T>::packetSize(packet));
+      } catch (SystemCallException &ex) {
+        // UDP can return ECONNREFUSED or EINVAL if server does not have its port open
+        if (ex.error != ECONNREFUSED && ex.error != EINVAL)
+          throw;
+      }
+
+      current += packet.header.nrBlocks;
+    }
+  } catch (Stream::EndOfStreamException &ex) {
+    LOG_INFO_STR( logPrefix << "End of stream");
+  } catch (SystemCallException &ex) {
+    if (ex.error == EINTR)
+      LOG_INFO_STR( logPrefix << "Aborted: " << ex.what());
+    else
+      LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex);
+  } catch (Exception &ex) {
+    LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex);
+  }
+
+  LOG_INFO_STR( logPrefix << "End");
+}
+
+}
+}
+
+#endif
diff --git a/RTCP/IONProc/test/newInputSection/StationID.h b/RTCP/IONProc/test/newInputSection/StationID.h
new file mode 100644
index 0000000000000000000000000000000000000000..d4fcafed0e307200581ac752f2aec199ef56c9cb
--- /dev/null
+++ b/RTCP/IONProc/test/newInputSection/StationID.h
@@ -0,0 +1,82 @@
+#ifndef __STATIONID__
+#define __STATIONID__
+
+#include <Common/LofarLogger.h>
+#include <ostream>
+#include <cstdio>
+#include <string>
+
+namespace LOFAR {
+namespace RTCP {
+
+struct StationID {
+  char stationName[64];
+  char antennaSet[64];
+
+  unsigned clock;
+  unsigned bitmode;
+
+  StationID( const std::string &stationName = "", const std::string &antennaSet = "", unsigned clock = 200 * 1000 * 1000, unsigned bitmode = 16)
+  :
+    clock(clock),
+    bitmode(bitmode)
+  {
+    snprintf(this->stationName, sizeof this->stationName, "%s", stationName.c_str());
+    snprintf(this->antennaSet, sizeof this->antennaSet, "%s", antennaSet.c_str());
+  }
+
+  bool operator==(const struct StationID &other) const {
+    return !strncmp(stationName, other.stationName, sizeof stationName)
+        && !strncmp(antennaSet, other.antennaSet, sizeof antennaSet)
+        && clock == other.clock
+        && bitmode == other.bitmode;
+  }
+
+  bool operator!=(const struct StationID &other) const {
+    return !(*this == other);
+  }
+
+  uint32 hash() const {
+    // convert to 32 bit value (human-readable in hexadecimal)
+    uint32 stationNr = 0;
+
+    const std::string stationNameStr(stationName);
+    const std::string antennaSetStr(antennaSet);
+
+    for(std::string::const_iterator c = stationNameStr.begin(); c != stationNameStr.end(); ++c)
+      if(*c >= '0' && *c <= '9')
+        stationNr = stationNr * 16 + (*c - '0');
+
+    uint32 antennaSetNr = 0;
+
+    if (antennaSetStr == "HBA_ONE" || antennaSetStr == "HBA1" )
+      antennaSetNr = 1;
+    else
+      antennaSetNr = 0;
+
+    ASSERT( stationNr    < (1L << 16) );
+    ASSERT( antennaSetNr < (1L << 4)  );
+
+    ASSERT( clock/1000000 == 200 || clock/1000000 == 160 );
+    ASSERT( bitmode == 4 || bitmode == 8 || bitmode == 16 );
+
+    unsigned clockNr = clock/1000000 == 200 ? 0x20 : 0x16;
+    unsigned bitmodeNr = bitmode == 16 ? 0xF : bitmode;
+
+    return (stationNr << 16) + (antennaSetNr << 12) + (clockNr << 4) + bitmodeNr;
+  }
+
+};
+
+std::ostream& operator<<( std::ostream &str, const struct StationID &s ) {
+  str << "station " << s.stationName << " antennaset " << s.antennaSet << " clock " << s.clock/1000000 << " bitmode " << s.bitmode;
+
+  return str;
+}
+
+}
+}
+
+
+#endif
+
diff --git a/RTCP/IONProc/test/newInputSection/StationSettings.h b/RTCP/IONProc/test/newInputSection/StationSettings.h
new file mode 100644
index 0000000000000000000000000000000000000000..171db9b02c906bd5b5c798961cbfdb7b6135c8dd
--- /dev/null
+++ b/RTCP/IONProc/test/newInputSection/StationSettings.h
@@ -0,0 +1,79 @@
+#ifndef __STATIONSETTINGS__
+#define __STATIONSETTINGS__
+
+#include <Common/LofarLogger.h>
+#include "StationID.h"
+#include <ostream>
+
+namespace LOFAR {
+namespace RTCP {
+
+#define NR_RSPBOARDS 4
+
+struct StationSettings {
+private:
+  static const unsigned currentVersion = 1;
+
+  unsigned version;
+
+  bool valid() const { return version == currentVersion; }
+
+public:
+  struct StationID station;
+
+  unsigned nrBeamlets;
+
+  size_t   nrSamples;
+
+  unsigned nrBoards;
+  size_t   nrFlagRanges;
+
+  key_t    dataKey;
+
+  StationSettings();
+
+  // read settings from shared memory, using the given stationID
+  StationSettings(struct StationID station);
+
+  bool operator==(const struct StationSettings &other) const {
+    return station == other.station
+        && nrBeamlets == other.nrBeamlets 
+        && nrSamples == other.nrSamples
+        && nrBoards == other.nrBoards
+        && nrFlagRanges == other.nrFlagRanges
+        && dataKey == other.dataKey;
+  }
+
+};
+
+StationSettings::StationSettings()
+:
+  version(currentVersion)
+{
+}
+
+StationSettings::StationSettings(struct StationID station)
+:
+  version(currentVersion),
+  station(station)
+{
+  do {
+    SharedStruct<struct StationSettings> shm(station.hash(), false);
+
+    *this = shm.get();
+  } while (!valid());  
+
+  ASSERT( valid() );
+}
+
+std::ostream& operator<<( std::ostream &str, const struct StationSettings &s ) {
+  str << s.station << " beamlets: " << s.nrBeamlets << " buffer: " << (1.0 * s.nrSamples / s.station.clock * 1024) << "s";
+
+  return str;
+}
+
+}
+}
+
+#endif
+
diff --git a/RTCP/InputProc/src/obsolete/TimeSync.h b/RTCP/IONProc/test/newInputSection/TimeSync.h
similarity index 100%
rename from RTCP/InputProc/src/obsolete/TimeSync.h
rename to RTCP/IONProc/test/newInputSection/TimeSync.h
diff --git a/RTCP/IONProc/test/newInputSection/foo.cc b/RTCP/IONProc/test/newInputSection/foo.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3c814527f1069141787cc319c74a2cf31dbf4de0
--- /dev/null
+++ b/RTCP/IONProc/test/newInputSection/foo.cc
@@ -0,0 +1,457 @@
+#include <lofar_config.h>
+#include <Common/LofarLogger.h>
+#include <Common/LofarConstants.h>
+#include <Stream/Stream.h>
+#include <Stream/SocketStream.h>
+#include <RSP.h>
+#include <Interface/RSPTimeStamp.h>
+#include <Interface/MultiDimArray.h>
+#include <Interface/SmartPtr.h>
+#include <Interface/Stream.h>
+#include <WallClockTime.h>
+#include "SharedMemory.h"
+#include "Ranges.h"
+#include "OMPThread.h"
+#include "mpi.h"
+
+#include <vector>
+#include <omp.h>
+#include <map>
+#include <string>
+#include <ostream>
+#include <cstring>
+#include <boost/format.hpp>
+
+#define NR_RSPBOARDS 4
+
+using namespace LOFAR;
+using namespace RTCP;
+
+template<typename T> struct SampleType {
+  std::complex<T> x;
+  std::complex<T> y;
+};
+
+struct StationID {
+  char stationName[64];
+  char antennaSet[64];
+
+  unsigned clock;
+  unsigned bitmode;
+
+  StationID( const std::string &stationName = "", const std::string &antennaSet = "", unsigned clock = 200 * 1000000, unsigned bitmode = 16)
+  :
+    clock(clock),
+    bitmode(bitmode)
+  {
+    snprintf(this->stationName, sizeof this->stationName, "%s", stationName.c_str());
+    snprintf(this->antennaSet, sizeof this->antennaSet, "%s", antennaSet.c_str());
+  }
+
+  bool operator==(const struct StationID &other) const {
+    return !strncmp(stationName, other.stationName, sizeof stationName)
+        && !strncmp(antennaSet, other.antennaSet, sizeof antennaSet)
+        && clock == other.clock
+        && bitmode == other.bitmode;
+  }
+
+  bool operator!=(const struct StationID &other) const {
+    return !(*this == other);
+  }
+
+  uint32 hash() const {
+    // convert to 32 bit value (human-readable in hexadecimal)
+    uint32 stationNr = 0;
+
+    const std::string stationNameStr(stationName);
+    const std::string antennaSetStr(antennaSet);
+
+    for(std::string::const_iterator c = stationNameStr.begin(); c != stationNameStr.end(); ++c)
+      if(*c >= '0' && *c <= '9')
+        stationNr = stationNr * 16 + (*c - '0');
+
+    uint32 antennaSetNr = 0;
+
+    if (antennaSetStr == "HBA_ONE" || antennaSetStr == "HBA1" )
+      antennaSetNr = 1;
+    else
+      antennaSetNr = 0;
+
+    ASSERT( stationNr    < (1L << 16) );
+    ASSERT( antennaSetNr < (1L << 4)  );
+
+    ASSERT( clock/1000000 == 200 || clock/1000000 == 160 );
+    ASSERT( bitmode == 4 || bitmode == 8 || bitmode == 16 );
+
+    unsigned clockNr = clock/1000000 == 200 ? 0x20 : 0x16;
+    unsigned bitmodeNr = bitmode == 16 ? 0xF : bitmode;
+
+    return (stationNr << 16) + (antennaSetNr << 12) + (clockNr << 4) + bitmodeNr;
+  }
+
+};
+
+std::ostream& operator<<( std::ostream &str, const struct StationID &s ) {
+  str << "station " << s.stationName << " antennaset " << s.antennaSet << " clock " << s.clock/1000000 << " bitmode " << s.bitmode;
+
+  return str;
+}
+
+struct StationSettings {
+private:
+  static const unsigned currentVersion = 1;
+
+  unsigned version;
+
+  bool valid() const { return version == currentVersion; }
+
+public:
+  struct StationID station;
+
+  unsigned nrBeamlets;
+
+  size_t   nrSamples;
+
+  unsigned nrBoards;
+  size_t   nrFlagRanges;
+
+  key_t    dataKey;
+
+  StationSettings();
+
+  // read settings from shared memory, using the given stationID
+  StationSettings(struct StationID station);
+
+  bool operator==(const struct StationSettings &other) const {
+    return station == other.station
+        && nrBeamlets == other.nrBeamlets 
+        && nrSamples == other.nrSamples
+        && nrBoards == other.nrBoards
+        && nrFlagRanges == other.nrFlagRanges
+        && dataKey == other.dataKey;
+  }
+
+};
+
+std::ostream& operator<<( std::ostream &str, const struct StationSettings &s ) {
+  str << s.station << " beamlets: " << s.nrBeamlets << " buffer: " << (1.0 * s.nrSamples / s.station.clock * 1024) << "s";
+
+  return str;
+}
+
+StationSettings::StationSettings()
+:
+  version(currentVersion)
+{
+}
+
+
+StationSettings::StationSettings(struct StationID station)
+:
+  version(currentVersion),
+  station(station)
+{
+  SharedStruct<struct StationSettings> shm(station.hash(), false);
+
+  *this = shm.get();
+
+  ASSERT( valid() );
+}
+
+
+template<typename T> class SampleBuffer {
+public:
+  SampleBuffer( const struct StationSettings &settings, bool create );
+
+private:
+  const std::string logPrefix;
+  SharedMemoryArena data;
+  SparseSetAllocator allocator;
+
+  struct StationSettings *initSettings( const struct StationSettings &localSettings, bool create );
+
+  static size_t dataSize( const struct StationSettings &settings ) {
+    return sizeof settings
+         + NR_RSPBOARDS * (Ranges::size(settings.nrFlagRanges) + 8)
+         + settings.nrBeamlets * (settings.nrSamples * N_POL * 2 * settings.station.bitmode / 8 + 128);
+  }
+
+public:
+  struct StationSettings *settings;
+
+  const size_t nrBeamlets;
+  const size_t nrSamples;
+  const size_t nrFlagRanges;
+
+  MultiDimArray<T,2>  beamlets; // [subband][sample]
+  std::vector<Ranges> flags;    // [rspboard]
+};
+
+
+template<typename T> SampleBuffer<T>::SampleBuffer( const struct StationSettings &_settings, bool create )
+:
+  logPrefix(str(boost::format("[station %s %s board] [SampleBuffer] ") % _settings.station.stationName % _settings.station.antennaSet)),
+  data(_settings.dataKey, dataSize(_settings), create ? SharedMemoryArena::CREATE_EXCL : SharedMemoryArena::READ),
+  allocator(data),
+  settings(initSettings(_settings, create)),
+
+  nrBeamlets(settings->nrBeamlets),
+  nrSamples(settings->nrSamples),
+  nrFlagRanges(settings->nrFlagRanges),
+
+  beamlets(boost::extents[nrBeamlets][nrSamples], 128, allocator, false, create),
+  flags(settings->nrBoards)
+{
+  // bitmode must coincide with our template
+  ASSERT( sizeof(T) == N_POL * 2 * settings->station.bitmode / 8 );
+
+  // typical #slots/packet
+  ASSERT( settings->nrSamples % 16 == 0 );
+
+  for (size_t f = 0; f < flags.size(); f++) {
+    size_t numBytes = Ranges::size(nrFlagRanges);
+
+    flags[f] = Ranges(static_cast<int64*>(allocator.allocate(numBytes, 8)), numBytes, nrSamples, create);
+  }
+
+  LOG_INFO_STR( logPrefix << "Initialised" );
+}
+
+template<typename T> struct StationSettings *SampleBuffer<T>::initSettings( const struct StationSettings &localSettings, bool create )
+{
+  //struct StationSettings *sharedSettings = allocator.allocateTyped<struct StationSettings>();
+  struct StationSettings *sharedSettings = allocator.allocateTyped();
+
+  if (create) {
+    // register settings
+    LOG_INFO_STR( logPrefix << "Registering " << localSettings.station );
+    *sharedSettings = localSettings;
+  } else {
+    // verify settings
+    ASSERT( *sharedSettings == localSettings );
+    LOG_INFO_STR( logPrefix << "Connected to " << localSettings.station );
+  }
+
+  return sharedSettings;
+}
+
+template<typename T> class RSPBoard {
+public:
+  RSPBoard( Stream &inputStream, SampleBuffer<T> &buffer, unsigned boardNr, const struct StationSettings &settings );
+
+  const unsigned nr;
+
+  bool readPacket();
+  void writePacket();
+
+  static size_t packetSize( struct RSP &packet ) {
+    return sizeof(struct RSP::Header) + packet.header.nrBeamlets * packet.header.nrBlocks * sizeof(T);
+  }
+  
+private:
+  const std::string logPrefix;
+
+  Stream &inputStream;
+  const bool supportPartialReads;
+  struct RSP packet;
+  TimeStamp last_timestamp;
+  TimeStamp last_logtimestamp;
+
+  SampleBuffer<T> &buffer;
+  Ranges &flags;
+  const struct StationSettings settings;
+  const size_t firstBeamlet;
+
+  size_t nrReceived, nrBadSize, nrBadTime, nrOutOfOrder;
+
+  void logStatistics();
+};
+
+template<typename T> RSPBoard<T>::RSPBoard( Stream &inputStream, SampleBuffer<T> &buffer, unsigned boardNr, const struct StationSettings &settings )
+:
+  nr(boardNr),
+  logPrefix(str(boost::format("[station %s %s board %u] [RSPBoard] ") % settings.station.stationName % settings.station.antennaSet % nr)),
+  inputStream(inputStream),
+  supportPartialReads(dynamic_cast<SocketStream *>(&inputStream) == 0 || dynamic_cast<SocketStream &>(inputStream).protocol != SocketStream::UDP),
+
+  buffer(buffer),
+  flags(buffer.flags[boardNr]),
+  settings(settings),
+  firstBeamlet(settings.nrBeamlets / settings.nrBoards * boardNr),
+
+  nrReceived(0),
+  nrBadSize(0),
+  nrBadTime(0),
+  nrOutOfOrder(0)
+{
+}
+
+template<typename T> void RSPBoard<T>::writePacket()
+{
+  const uint8 &nrBeamlets  = packet.header.nrBeamlets;
+  const uint8 &nrTimeslots = packet.header.nrBlocks;
+
+  ASSERT( settings.nrSamples % nrTimeslots == 0 );
+
+  // the timestamp is of the last read packet by definition
+  const TimeStamp &timestamp = last_timestamp;
+
+  const size_t bufferOffset = (int64)timestamp % settings.nrSamples;
+
+  const T *beamlets = reinterpret_cast<const T*>(&packet.data);
+
+  ASSERT( nrBeamlets <= settings.nrBeamlets / settings.nrBoards );
+
+  // mark data we overwrite as invalid
+  flags.excludeBefore(timestamp + nrTimeslots - settings.nrSamples);
+
+  // transpose
+  for (uint8 b = 0; b < nrBeamlets; ++b) {
+    T *dst = &buffer.beamlets[firstBeamlet + b][bufferOffset];
+
+    memcpy(dst, beamlets, nrTimeslots * sizeof(T));
+
+    beamlets += nrTimeslots;
+  }
+
+  // mark as valid
+  flags.include(timestamp, timestamp + nrTimeslots);
+}
+
+template<typename T> bool RSPBoard<T>::readPacket()
+{
+  if (supportPartialReads) {
+    // read header first
+    inputStream.read(&packet, sizeof(struct RSP::Header));
+
+    // read rest of packet
+    inputStream.read(&packet.data, packetSize(packet) - sizeof(struct RSP::Header));
+
+    ++nrReceived;
+  } else {
+    // read full packet at once -- numbytes will tell us how much we've actually read
+    size_t numbytes = inputStream.tryRead(&packet, sizeof packet);
+
+    ++nrReceived;
+
+    if( numbytes < sizeof(struct RSP::Header)
+     || numbytes != packetSize(packet) ) {
+      LOG_WARN_STR( logPrefix << "Packet is " << numbytes << " bytes, but should be " << packetSize(packet) << " bytes" );
+
+      ++nrBadSize;
+      return false;
+    }
+  }
+
+  // check sanity of packet
+
+  // detect bad timestamp
+  if (packet.header.timestamp == ~0U) {
+    ++nrBadTime;
+    return false;
+  }
+
+  const TimeStamp timestamp(packet.header.timestamp, packet.header.blockSequenceNumber, settings.station.clock);
+
+  // detect out-of-order data
+  if (timestamp < last_timestamp) {
+    ++nrOutOfOrder;
+    return false;
+  }
+
+  // don't accept big jumps (>10s) in timestamp
+  const int64 oneSecond = settings.station.clock / 1024;
+
+  if (last_timestamp && packet.header.timestamp > last_timestamp + 10 * oneSecond) {
+    ++nrBadTime;
+    return false;
+  }
+
+  // packet was read and is sane
+
+  last_timestamp = timestamp;
+
+  if (timestamp > last_logtimestamp + oneSecond) {
+    logStatistics();
+
+    last_logtimestamp = timestamp;
+  }
+
+  return true;
+}
+
+
+template<typename T> void RSPBoard<T>::logStatistics()
+{
+  LOG_INFO_STR( logPrefix << "Received " << nrReceived << " packets: " << nrOutOfOrder << " out of order, " << nrBadTime << " bad timestamps, " << nrBadSize << " bad sizes" );
+
+  nrReceived = 0;
+  nrOutOfOrder = 0;
+  nrBadTime = 0;
+  nrBadSize = 0;
+}
+
+
+
+
+
+
+class StationStreams {
+public:
+  StationStreams( const std::string &logPrefix, const StationSettings &settings, const std::vector<std::string> &streamDescriptors );
+
+  void process();
+
+  void stop();
+
+protected:
+  const std::string logPrefix;
+  const StationSettings settings;
+  const std::vector<std::string> streamDescriptors;
+  const size_t nrBoards;
+
+  WallClockTime waiter;
+
+  virtual void processBoard( size_t nr ) = 0;
+};
+
+StationStreams::StationStreams( const std::string &logPrefix, const StationSettings &settings, const std::vector<std::string> &streamDescriptors )
+:
+  logPrefix(logPrefix),
+  settings(settings),
+  streamDescriptors(streamDescriptors),
+  nrBoards(streamDescriptors.size())
+{
+}
+
+void StationStreams::process()
+{
+  std::vector<OMPThread> threads(nrBoards);
+
+  ASSERT(nrBoards > 0);
+
+  LOG_INFO_STR( logPrefix << "Start" );
+
+  #pragma omp parallel sections num_threads(2)
+  {
+    #pragma omp section
+    {
+      // start all boards
+      LOG_INFO_STR( logPrefix << "Starting all boards" );
+      #pragma omp parallel for num_threads(nrBoards)
+      for (size_t i = 0; i < nrBoards; ++i) {
+        OMPThread::ScopedRun sr(threads[i]);
+  
+        processBoard(i);
+      }
+    }
+
+    #pragma omp section
+    {
+      // wait until we have to stop
+      LOG_INFO_STR( logPrefix << "Waiting for stop signal" );
+      waiter.waitForever();     
+
+      // kill all boards
+      LOG_INFO_STR( logPrefix << "Stopping all boards" );
+      #pragma omp parallel for num_threads(nrBo
\ No newline at end of file
diff --git a/RTCP/InputProc/src/newInputSection.cc b/RTCP/IONProc/test/newInputSection/newInputSection.cc
similarity index 76%
rename from RTCP/InputProc/src/newInputSection.cc
rename to RTCP/IONProc/test/newInputSection/newInputSection.cc
index 5038fe1f29b989ed103a8e32bef0c92492cdb6f5..112cb940c3b13309d18802b08e215bf59139842d 100644
--- a/RTCP/InputProc/src/newInputSection.cc
+++ b/RTCP/IONProc/test/newInputSection/newInputSection.cc
@@ -5,17 +5,14 @@
 #include <Stream/SocketStream.h>
 #include <Interface/MultiDimArray.h>
 #include <Interface/Stream.h>
-#include <IONProc/WallClockTime.h>
+#include <WallClockTime.h>
 #include "SharedMemory.h"
 #include "Ranges.h"
 #include "OMPThread.h"
 #include "StationID.h"
-#include "BufferSettings.h"
-#include "SampleType.h"
+#include "StationSettings.h"
 #include "SampleBuffer.h"
-#include "SampleBufferReader.h"
-#include "Generator.h"
-#include "PacketsToBuffer.h"
+#include "StationData.h"
 #include "mpi.h"
 
 #include <vector>
@@ -30,6 +27,161 @@
 using namespace LOFAR;
 using namespace RTCP;
 
+template<typename T> class SampleBufferReader {
+public:
+  SampleBufferReader( const StationSettings &settings, const std::vector<size_t> beamlets, const TimeStamp &from, const TimeStamp &to, size_t blockSize );
+
+  void process( double maxDelay );
+
+protected:
+  const StationSettings settings;
+  SampleBuffer<T> buffer;
+
+  const std::vector<size_t> beamlets;
+  const TimeStamp from, to;
+  const size_t blockSize;
+
+  virtual void copyNothing( const TimeStamp &from, const TimeStamp &to ) { (void)from, (void)to; }
+
+  virtual void copyBeamlet( unsigned beamlet, unsigned transfer, const TimeStamp &from_ts, const T* from, size_t nrSamples ) = 0;
+  virtual void copyStart( const TimeStamp &from, const TimeStamp &to, size_t wrap ) { (void)from, (void)to, (void)wrap; }
+
+  virtual void copyFlags  ( unsigned transfer, const SparseSet<int64> &flags ) = 0;
+  virtual void copyEnd() {}
+
+  void copy( const TimeStamp &from, const TimeStamp &to );
+
+private:
+  WallClockTime waiter;
+};
+
+
+template<typename T> SampleBufferReader<T>::SampleBufferReader( const StationSettings &settings, const std::vector<size_t> beamlets, const TimeStamp &from, const TimeStamp &to, size_t blockSize )
+:
+  settings(settings),
+  buffer(settings, false),
+
+  beamlets(beamlets),
+  from(from),
+  to(to),
+  blockSize(blockSize)
+{
+  for (size_t i = 0; i < beamlets.size(); ++i)
+    ASSERT( beamlets[i] < buffer.nrBeamlets );
+
+  ASSERT( blockSize > 0 );
+  ASSERT( blockSize < settings.nrSamples );
+  ASSERT( from < to );
+}
+
+
+template<typename T> void SampleBufferReader<T>::process( double maxDelay )
+{
+  /*const TimeStamp maxDelay_ts(static_cast<int64>(maxDelay * settings.station.clock / 1024) + blockSize, settings.station.clock);
+
+  const TimeStamp current(from);
+
+  for (TimeStamp current = from; current < to; current += blockSize) {
+    // wait
+    LOG_INFO_STR("Waiting until " << (current + maxDelay_ts) << " for " << current);
+    waiter.waitUntil( current + maxDelay_ts );
+
+    // read
+    LOG_INFO_STR("Reading from " << current << " to " << (current + blockSize));
+    copy(current, current + blockSize);
+  }
+
+  LOG_INFO("Done reading data");*/
+  const TimeStamp maxDelay_ts(static_cast<int64>(maxDelay * settings.station.clock / 1024) + blockSize, settings.station.clock);
+
+  const TimeStamp current(from);
+
+  double totalwait = 0.0;
+  unsigned totalnr = 0;
+
+  double lastreport = MPI_Wtime();
+
+  for (TimeStamp current = from; current < to; current += blockSize) {
+    // wait
+    waiter.waitUntil( current + maxDelay_ts );
+
+    // read
+    double bs = MPI_Wtime();
+
+    copy(current, current + blockSize);
+
+    totalwait += MPI_Wtime() - bs;
+    totalnr++;
+
+    if (bs - lastreport > 1.0) {
+      double mbps = (sizeof(T) * blockSize * beamlets.size() * 8) / (totalwait/totalnr) / 1e6;
+      lastreport = bs;
+      totalwait = 0.0;
+      totalnr = 0;
+
+      LOG_INFO_STR("Reading speed: " << mbps << " Mbit/s");
+    }
+  }
+
+  LOG_INFO("Done reading data");
+}
+
+template<typename T> void SampleBufferReader<T>::copy( const TimeStamp &from, const TimeStamp &to )
+{
+  ASSERT( from < to );
+  ASSERT( to - from < (int64)buffer.nrSamples );
+
+  const unsigned nrBoards = buffer.flags.size();
+
+#if 0
+  // check whether there is any data at all
+  bool data = false;
+
+  for (unsigned b = 0; b < nrBoards; ++b)
+    if (buffer.flags[b].anythingBetween(from, to)) {
+      data = true;
+      break;
+    }
+
+  if (!data) {
+    copyNothing(from, to);
+    return;
+  }
+#endif
+
+  // copy the beamlets
+
+  size_t from_offset = (int64)from % buffer.nrSamples;
+  size_t to_offset   = (int64)to % buffer.nrSamples;
+
+  if (to_offset == 0)
+    to_offset = buffer.nrSamples;
+
+  // wrap > 0 if we need to wrap around the end of the buffer
+  size_t wrap         = from_offset < to_offset ? 0 : buffer.nrSamples - from_offset;
+
+  copyStart(from, to, wrap);
+
+  for (size_t i = 0; i < beamlets.size(); ++i) {
+    unsigned nr = beamlets[i];
+    const T* origin = &buffer.beamlets[nr][0];
+
+    if (wrap > 0) {
+      copyBeamlet( nr, 0, from, origin + from_offset, wrap );
+      copyBeamlet( nr, 1, from, origin,               to_offset );
+    } else {
+      copyBeamlet( nr, 0, from, origin + from_offset, to_offset - from_offset );
+    }
+  }
+
+  // copy the flags
+
+  for (unsigned b = 0; b < nrBoards; ++b)
+    copyFlags( b, buffer.flags[b].sparseSet(from, to).invert(from, to) );
+
+  copyEnd();
+}
+
 Mutex MPIMutex;
 
 //#define USE_RMA
@@ -40,7 +192,7 @@ Mutex MPIMutex;
 
 template<typename T> class MPISharedBuffer: public SampleBuffer<T> {
 public:
-  MPISharedBuffer( const struct BufferSettings &settings );
+  MPISharedBuffer( const struct StationSettings &settings );
 
   ~MPISharedBuffer();
 
@@ -52,7 +204,7 @@ private:
 #endif
 };
 
-template<typename T> MPISharedBuffer<T>::MPISharedBuffer( const struct BufferSettings &settings )
+template<typename T> MPISharedBuffer<T>::MPISharedBuffer( const struct StationSettings &settings )
 :
   SampleBuffer<T>(settings, false)
 #ifdef MULTIPLE_WINDOWS
@@ -89,14 +241,14 @@ template<typename T> MPISharedBuffer<T>::~MPISharedBuffer()
 
 template<typename T> class MPISharedBufferReader {
 public:
-  MPISharedBufferReader( const std::vector<struct BufferSettings> &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets );
+  MPISharedBufferReader( const std::vector<struct StationSettings> &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets );
 
   ~MPISharedBufferReader();
 
   void process( double maxDelay );
 
 private:
-  const std::vector<struct BufferSettings> settings;
+  const std::vector<struct StationSettings> settings;
   const TimeStamp from, to;
   const size_t blockSize;
   const std::vector<size_t> beamlets;
@@ -114,7 +266,7 @@ private:
   void copy( const TimeStamp &from, const TimeStamp &to );
 };
 
-template<typename T> MPISharedBufferReader<T>::MPISharedBufferReader( const std::vector<struct BufferSettings> &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets )
+template<typename T> MPISharedBufferReader<T>::MPISharedBufferReader( const std::vector<struct StationSettings> &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets )
 :
   settings(settings),
   from(from),
@@ -223,7 +375,7 @@ template<typename T> void MPISharedBufferReader<T>::copy( const TimeStamp &from,
 #endif
 
     //LOG_INFO_STR("Copying from station " << s);
-    const struct BufferSettings settings = this->settings[s];
+    const struct StationSettings settings = this->settings[s];
 
     size_t from_offset = (int64)from % settings.nrSamples;
     size_t to_offset   = (int64)to % settings.nrSamples;
@@ -291,7 +443,7 @@ template<typename T> void MPISharedBufferReader<T>::copy( const TimeStamp &from,
 
 template<typename T> class MPISendStation: public SampleBufferReader<T> {
 public:
-  MPISendStation( const struct BufferSettings &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets, unsigned destRank );
+  MPISendStation( const struct StationSettings &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets, unsigned destRank );
 
   struct Header {
     StationID station;
@@ -341,7 +493,7 @@ protected:
 };
 
 
-template<typename T> MPISendStation<T>::MPISendStation( const struct BufferSettings &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets, unsigned destRank )
+template<typename T> MPISendStation<T>::MPISendStation( const struct StationSettings &settings, const TimeStamp &from, const TimeStamp &to, size_t blockSize, const std::vector<size_t> &beamlets, unsigned destRank )
 :
   SampleBufferReader<T>(settings, beamlets, from, to, blockSize),
   destRank(destRank),
@@ -474,12 +626,12 @@ template<typename T> void MPISendStation<T>::copyEnd()
 
 template<typename T> class MPIReceiveStation {
 public:
-  MPIReceiveStation( const struct BufferSettings &settings, const std::vector<int> stationRanks, const std::vector<size_t> &beamlets, size_t blockSize );
+  MPIReceiveStation( const struct StationSettings &settings, const std::vector<int> stationRanks, const std::vector<size_t> &beamlets, size_t blockSize );
 
   void receiveBlock();
 
 private:
-  const struct BufferSettings settings;
+  const struct StationSettings settings;
   const std::vector<int> stationRanks;
 
 public:
@@ -489,7 +641,7 @@ public:
   Matrix< SparseSet<int64> > flags;  // [station][board]
 };
 
-template<typename T> MPIReceiveStation<T>::MPIReceiveStation( const struct BufferSettings &settings, const std::vector<int> stationRanks, const std::vector<size_t> &beamlets, size_t blockSize )
+template<typename T> MPIReceiveStation<T>::MPIReceiveStation( const struct StationSettings &settings, const std::vector<int> stationRanks, const std::vector<size_t> &beamlets, size_t blockSize )
 :
   settings(settings),
   stationRanks(stationRanks),
@@ -618,19 +770,23 @@ template<typename T> void MPIReceiveStation<T>::receiveBlock()
 }
 #endif
 
+void sighandler(int)
+{
+  /* no-op */
+}
 
 int main( int argc, char **argv )
 {
   size_t clock = 200*1000*1000;
 
-  typedef SampleType<i16complex> SampleT;
+  typedef SampleBuffer<int16>::SampleType SampleT;
   const TimeStamp from(time(0L) + 1, 0, clock);
   const TimeStamp to(time(0L) + 1 + DURATION, 0, clock);
   const size_t blockSize = BLOCKSIZE * clock / 1024;
   std::map<unsigned, std::vector<size_t> > beamlets;
 
   struct StationID stationID("RS106", "LBA", clock, 16);
-  struct BufferSettings settings;
+  struct StationSettings settings;
 
   settings.station = stationID;
   settings.nrBeamlets = 244;
@@ -667,7 +823,7 @@ int main( int argc, char **argv )
     LOG_INFO_STR("Receiver " << rank << " starts, handling " << beamlets[rank].size() << " subbands from " << nrStations << " stations." );
 
 #ifdef USE_RMA
-    std::vector<struct BufferSettings> stations(nrStations, settings);
+    std::vector<struct StationSettings> stations(nrStations, settings);
 
     {
       MPISharedBufferReader<SampleT> receiver(stations, from, to, blockSize, beamlets[rank]);
@@ -698,7 +854,9 @@ int main( int argc, char **argv )
 
   omp_set_nested(true);
   omp_set_num_threads(32);
-  OMPThread::init();
+
+  signal(SIGHUP, sighandler);
+  siginterrupt(SIGHUP, 1);
 
   std::vector<std::string> inputStreams(4);
   inputStreams[0] = "udp:127.0.0.1:4346";
@@ -707,8 +865,8 @@ int main( int argc, char **argv )
   inputStreams[3] = "udp:127.0.0.1:4349";
 
   if(rank == 0) {
-    PacketsToBuffer< SampleT > station( settings, inputStreams );
-    Generator generator( settings, inputStreams );
+    Station< SampleT > station( settings, inputStreams );
+    Generator< SampleT > generator( settings, inputStreams );
 
     #pragma omp parallel sections num_threads(4)
     {
@@ -724,7 +882,7 @@ int main( int argc, char **argv )
       #pragma omp section
       {
         struct StationID lookup("RS106", "HBA0");
-        struct BufferSettings s(stationID);
+        struct StationSettings s(stationID);
 
         LOG_INFO_STR("Detected " << s);
 #ifdef USE_RMA
@@ -743,7 +901,7 @@ int main( int argc, char **argv )
     }
   } else {
       struct StationID lookup("RS106", "HBA0");
-      struct BufferSettings s(stationID);
+      struct StationSettings s(stationID);
 
       LOG_INFO_STR("Detected " << s);
 #ifdef USE_RMA
diff --git a/RTCP/IONProc/test/newInputSection/newInputSection_old.cc b/RTCP/IONProc/test/newInputSection/newInputSection_old.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6aeb5221ab289cec77026cd775a193843d4df31c
--- /dev/null
+++ b/RTCP/IONProc/test/newInputSection/newInputSection_old.cc
@@ -0,0 +1,706 @@
+#include <lofar_config.h>
+
+#include <Common/Thread/Mutex.h>
+#include <Common/LofarLogger.h>
+#include <Stream/SocketStream.h>
+#include "TimeSync.h"
+
+#include <RSP.h>
+#include <Interface/RSPTimeStamp.h>
+
+#include <iostream>
+#include <vector>
+
+using namespace std;
+using namespace LOFAR;
+using namespace RTCP;
+
+const unsigned nrInputs  = 10;
+const unsigned nrOutputs = 10;
+
+const float sampleClock = 8 * 1e6;
+const float subbandWidth = sampleClock / 1024;
+const size_t samplesPerBlock = subbandWidth * 0.05;
+
+const size_t packetSize = 9000;
+
+class Consumer;
+
+/*
+ * Lock-free buffer for RSP packets, including
+ * producer primitives. Supports a single producer.
+ */
+class PacketBuffer {
+public:
+  struct Item {
+    // the converted timestamp for this packet,
+    // or 0 if this packet is being written.
+    volatile int64 timestamp;
+
+    // the timestamp of the previous packet,
+    // or 0 for the first packet.
+    volatile int64 prev_timestamp;
+
+    // the payload
+    struct RSP packet;
+
+    Item(): timestamp(0), prev_timestamp(0) {}
+  };
+
+  class CircularPtr {
+  public:
+    CircularPtr( PacketBuffer &buffer, struct Item *item ): item(item), buffer(buffer) {}
+
+    struct Item *item;
+
+    void operator++() {
+      if (++item == buffer.end)
+        item = buffer.begin;
+    }
+
+    void operator--() {
+      if (--item == buffer.begin)
+        item = buffer.end - 1;
+    }
+
+  private:
+    PacketBuffer &buffer;
+  };
+
+private:
+  vector<struct Item> packets;
+  struct Item * const begin;
+  struct Item * const end;
+
+  vector<Consumer *> consumers;
+  Mutex consumersMutex;
+
+  // points to where input will be written
+  CircularPtr head;
+
+  // points to the packet at or right after head
+  CircularPtr next;
+
+  // last recorded timestamp
+  int64 prev_timestamp;
+
+public:
+  PacketBuffer( size_t bufsize, unsigned sampleClock, unsigned timesPerSlot, bool realtime );
+
+  // timestamp of the last written packet (exclusive,
+  // so actually points to one timestamp beyond the youngest
+  // packet).
+  //
+  // (or 0 if no data has been written yet)
+  volatile int64 youngest;
+
+  // timestamp of the oldest slot in the buffer (or 0 if
+  // the buffer has not been fully filled yet)
+  volatile int64 oldest;
+  struct Item * volatile oldest_item;
+
+  // call before starting to write at head
+  void startWrite();
+
+  // pointer to the head packet
+  struct RSP &writePtr();
+
+  // call after completing a write at head
+  void stopWrite();
+
+  // call when data stream ends
+  void noMoreData();
+
+  // add/remove consumers
+  void registerConsumer( Consumer &consumer );
+  void unregisterConsumer( Consumer &consumer );
+
+  // configuration parameters
+  const unsigned sampleClock;
+  const bool realtime;
+  const size_t timesPerSlot;
+};
+
+/*
+ * An abstract class describing a data processor.
+ */
+class PacketSink {
+public:
+  virtual void processPacket( Consumer *consumer, const int64 &timestamp, struct RSP &packet ) = 0;
+  virtual void missingData( Consumer *consumer, const int64 &from, const int64 to ) = 0;
+};
+
+class Consumer {
+public:
+  Consumer( PacketBuffer &buffer, PacketSink &sink );
+
+  void wait( int64 to, struct timespec &timeout );
+  void read( int64 from, int64 to );
+
+private:
+  PacketBuffer &buffer;
+  PacketSink &sink;
+  const bool realtime;
+
+  PacketBuffer::CircularPtr tail;
+
+  // needed for synchronisation
+  TimeSync needFrom, haveUntil;
+  friend class PacketBuffer;
+};
+
+PacketBuffer::PacketBuffer( size_t bufsize, unsigned sampleClock, unsigned timesPerSlot, bool realtime )
+:
+  packets(bufsize),
+  begin(&packets[0]),
+  end(&packets[bufsize]),
+  head(*this, begin),
+  next(*this, begin),
+  prev_timestamp(0),
+
+  youngest(0),
+  oldest(0),
+  oldest_item(0),
+
+  sampleClock(sampleClock),
+  realtime(realtime),
+  timesPerSlot(timesPerSlot)
+{
+  // head and next are distinct (once data is read)
+  ASSERT( bufsize >= 2 );
+}
+
+void PacketBuffer::startWrite()
+{
+  if (!realtime) {
+    // make sure that our consumers do not need the head.item
+    // that we're about to overwrite
+
+    const int64 headTime = head.item->timestamp;
+
+    if (headTime != 0) {
+      ScopedLock sl(consumersMutex);
+
+      for (vector<Consumer *>::const_iterator i = consumers.begin(); i != consumers.end(); ++i)
+        (*i)->needFrom.wait( headTime + timesPerSlot );
+    }
+  }
+
+  // keep next pointed at the oldest packet
+  ++ next;
+
+  // if we overwrite data because we wrapped around,
+  // we have to update oldest.
+  if (next.item->timestamp != 0) {
+    oldest_item = next.item;
+    oldest = next.item->timestamp;
+  }
+
+  // invalidate head
+  head.item->timestamp = 0;
+}
+
+struct RSP &PacketBuffer::writePtr()
+{
+  return head.item->packet;
+}
+
+void PacketBuffer::stopWrite()
+{
+  // complete our bookkeeping on head
+  const struct RSP &packet = head.item->packet;
+  const int64 timestamp = TimeStamp(packet.header.timestamp, packet.header.blockSequenceNumber, sampleClock);
+
+  head.item->prev_timestamp = prev_timestamp;
+  prev_timestamp = timestamp;
+
+  // make head valid again
+  head.item->timestamp = timestamp;
+
+  ++ head;
+
+  // the very first packet initialises oldest
+  if (!oldest) {
+    oldest_item = head.item;
+    oldest = timestamp;
+  }
+
+  youngest = timestamp + timesPerSlot;
+
+  {
+    // readers could be waiting for this data both in realtime and in non-realtime modes
+
+    // The consumersMutex only blocks if consumers are added or removed.
+    ScopedLock sl(consumersMutex);
+
+    // make sure that our consumers unlock once we've written data they need
+    for (vector<Consumer *>::const_iterator i = consumers.begin(); i != consumers.end(); ++i) {
+      // These TimeSync locks block only if the consumer is about to wait
+      // for data. This is still cheaper than letting the consumers actively
+      // poll `youngest'.
+      (*i)->haveUntil.set( youngest );
+    }
+  }
+}
+
+void PacketBuffer::noMoreData()
+{
+  ScopedLock sl(consumersMutex);
+
+  // make sure that our consumers unlock
+  for (vector<Consumer *>::const_iterator i = consumers.begin(); i != consumers.end(); ++i)
+    (*i)->haveUntil.noMoreData();
+}
+
+Consumer::Consumer( PacketBuffer &buffer, PacketSink &sink )
+:
+  buffer(buffer),
+  sink(sink),
+  realtime(buffer.realtime),
+  tail(buffer, 0)
+{
+}
+
+void Consumer::wait( int64 to, struct timespec &timeout )
+{
+  if (!realtime) {
+    // sync will occur in read()
+    return;
+  }
+
+  if (!haveUntil.wait( to, timeout )) {
+    LOG_WARN_STR( "Data arrived too late for " << to );
+  } else {
+    LOG_DEBUG_STR( "Data arrived on time for " << to );
+  }
+}
+
+void Consumer::read( int64 from, int64 to )
+{
+   /*
+    * Read data from the circular buffer, lock free
+    * under the following conditions:
+    *   - running in real-time mode
+    *   - no logging anywhere
+    *
+    * This means that any information we retrieve
+    * from `buffer' can already be outdated at the next
+    * memory access. So we often store a local copy. Also, we
+    * let the buffer cache the following info, and update it
+    * atomically:
+    *
+    * youngest:    timestamp of the latest packet that was written
+    * oldest:      timestamp of the oldest packet still in the buffer
+    * oldest_item: pointer to the oldest item
+    *
+    * Each item has the following properties:
+    *
+    * timestamp:   timestamp of the first sample, or 0 if this packet
+    *              is either not used yet or being overwritten.
+    * prev_timestamp:
+    *              timestamp of the previous received packet, needed
+    *              to detect some forms of packet loss.
+    * item:        pointer to the payload.
+    *
+    * Note that even dereferencing multiple properties of the same
+    * item might yield results from different packets, if the
+    * writer passed by in between reads.
+    *
+    * In the cases that multiple properties are needed, make sure
+    * that the code functions correctly if a second property comes
+    * from a later packet than the first property.
+    */
+   ASSERT(from < to);
+
+   /*
+    * Sync with writer if needed
+    */
+
+   if (!realtime) {
+     // reserve all data since from
+     needFrom.set( from );
+
+     // make sure all data (that exists)
+     // until to is available.
+     haveUntil.wait( to );
+   }
+
+   const int64 youngest = buffer.youngest;
+
+   /*
+    * We will exit once we encounter data up to 'to'
+    * or later. So we have to make sure that exists,
+    * as we cannot count on more data to arrive.
+    */ 
+
+   if (youngest <= from) {
+     // no data available -- don't look for it
+     LOG_DEBUG_STR( "Data loss because no data is available" );
+     sink.missingData( this, from, to );
+     return;
+   }
+
+   if (youngest < to) {
+     // partial data available -- only look for what might exist
+     LOG_DEBUG_STR( "Data loss because end is not available" );
+     sink.missingData( this, youngest, to );
+
+     to = youngest;
+   }
+
+   /*
+    * Make an initial guess where to start looking.
+    * We just have to make sure that we do not jump
+    * between [from, to) as we'd be forced to consider
+    * anything before `tail' as a loss.
+    */ 
+
+   if (!tail.item) {
+     // We'll need to scan -- start at the oldest data
+     tail.item = buffer.oldest_item;
+   } else {
+     // We'll continue from the last read()
+     //
+     // Rewind if needed. Note that prev_timestamp is only 0
+     // if there was no previous packet.
+     while( tail.item->prev_timestamp >= from ) {
+       LOG_DEBUG_STR("Rewinding, am " << (tail.item->prev_timestamp - from) << " ahead");
+       -- tail;
+     }
+   }
+
+   /*
+    * Locate any data we can find and process it.
+    *
+    * We drop out of the loop when we either:
+    *    - have all our data (from == to)
+    *    - notice that the rest of the data is lost
+    */
+ 
+   while( from < to ) {
+     const int64 tailTime = tail.item->timestamp;
+
+     if (tailTime == 0) {
+       // invalid or no data
+
+       // prevent infinite loops if we run in lock-step with the writer
+       if (buffer.oldest >= to)
+         break;
+
+       ++ tail;
+       continue;
+     }
+
+     if (tailTime < from) {
+       // data is not useful to us
+       ++ tail;
+       continue;
+     }
+
+     if (tailTime >= to) {
+       // Two possibilities:
+       //   1. Genuine data loss beyond the end of the packet.
+       //   2. Writer gained on us and wrote a new packet here.
+
+       if (tail.item->prev_timestamp < from) {
+         // 1: this packet belongs here, so the loss
+         // spans across the end of the packet.
+         break;
+       }
+
+       // 2: We're somewhere we should not be, most likely
+       // because the writer overwrote these packets.
+
+       ASSERT(realtime);
+
+       if (buffer.oldest >= to) {
+         // there is no data for us anymore
+         break;
+       }
+
+       // valid data after head
+       LOG_DEBUG_STR( "Sync with head" );
+       tail.item = buffer.oldest_item;
+       continue;
+     }
+
+     if (tailTime != from) {
+       // data loss
+       LOG_DEBUG_STR( "Data loss within packet" );
+       sink.missingData( this, from, tailTime );
+     }
+
+     // a packet!
+     sink.processPacket( this, tailTime, tail.item->packet );
+
+     /*
+      * If the writer did *anything* with this packet, the
+      * timestamp will have been changed.
+      */ 
+
+     if (tailTime != tail.item->timestamp) {
+       // we got interrupted
+       ASSERT(realtime);
+
+       // mark packet as missing
+       LOG_DEBUG_STR( "Data loss due to read/write conflict" );
+       sink.missingData( this, tailTime, tailTime + buffer.timesPerSlot );
+     }
+
+     // look for the next packet
+     from = tailTime + buffer.timesPerSlot;
+
+     // no need to reconsider this packet
+     ++ tail;
+   }
+
+   if (from < to) {
+     LOG_DEBUG_STR( "Data loss at end of packet" );
+     sink.missingData( this, from, to );
+   }
+}
+
+void PacketBuffer::registerConsumer( Consumer &consumer )
+{
+  ScopedLock sl(consumersMutex);
+
+  consumers.push_back(&consumer);
+}
+
+void PacketBuffer::unregisterConsumer( Consumer &consumer )
+{
+  ScopedLock sl(consumersMutex);
+
+  for (vector<Consumer*>::iterator i = consumers.begin(); i != consumers.end(); ++i) {
+    if (*i == &consumer) {
+      consumers.erase(i);
+      break;
+    }
+  }
+}
+
+#if 0
+/*
+ * Input from one RSP board
+ */
+class RSPBoardInput {
+public:
+  RSPBoardInput( FileDescriptorBasedStream &inputStream, unsigned subbandsPerPacket, unsigned timesPerSlot, unsigned nrPolarizations, unsigned sampleSize );
+
+  void read();
+
+  PacketBuffer buffer;
+
+private:
+  FileDescriptorBasedStream &inputStream;
+
+  const unsigned subbandsPerPacket;
+  const unsigned timesPerSlot;
+  const unsigned nrPolarizations;
+  const unsigned sampleSize;
+
+  const size_t subbandSize;
+  const size_t packetSize;
+};
+
+RSPBoardInput::RSPBoardInput( FileDescriptorBasedStream &inputStream, unsigned subbandsPerPacket, unsigned timesPerSlot, unsigned nrPolarizations, unsigned sampleSize )
+:
+  buffer(100),
+  inputStream(inputStream),
+  packetReadOffset(0),
+
+  subbandsPerPacket(subbandsPerPacket),
+  timesPerSlot(timesPerSlot),
+  nrPolarizations(nrPolarizations),
+  sampleSize(sampleSize),
+
+  subbandSize(timesPerSlot * nrPolarizations * sampleSize),
+  packetSize(sizeof(struct RSP::Header) + subbandsPerPacket * subbandSize)
+{
+  ASSERT(packetSize <= sizeof(struct RSP));
+}
+
+void RSPBoardInput::read()
+{
+  /*
+   * Read packets until we block.
+   */
+  for(;;) {
+    struct RSP &packet = buffer.head.item->packet;
+
+    void *dstPtr = reinterpret_cast<char*>(packet) + packetReadOffset;
+    size_t bytesLeft = packetSize - packetReadOffset;
+    size_t numbytes;
+
+    if (packetReadOffset == 0) {
+      // new packet
+      buffer.startWrite();
+    }
+
+    try {
+      numbytes = s.tryRead(dstPtr, bytesLeft);
+    } catch(...) {
+      buffer.noMoreData();
+
+      throw;
+    }
+
+    if (numbytes == bytesLeft) {
+      // finished reading packet
+      buffer.stopWrite();
+
+      packetReadOffset = 0;
+    } else {
+      // packet partially read
+      packetReadOffset += numbytes;
+    }
+  }
+}
+
+/*
+ *  Generates output from data generated by multiple RSP boards.
+ */
+class OutputGenerator {
+public:
+  OutputGenerator( const vector< RSPBoardInput * > &inputs, const int64 &startTime, size_t blocksize );
+
+  int64 next_block_start;
+  size_t blocksize;
+
+  void write();
+
+private:
+  const vector< RSPboardInput * > &inputs;
+  vector< PacketBuffer::Consumer * > consumers;
+};
+
+OutputGenerator::OutputGenerator( const vector< RSPBoardInput * > &inputs, const int64 &startTime, size_t blocksize )
+:
+  next_block_start(startTime),
+  blocksize(blocksize),
+  inputs(inputs),
+  consumers(inputs.size(),0)
+{
+  for( size_t i = 0; i < inputs.size(); i++ )
+    consumers[i] = new PacketBuffer::Consumer(inputs[i]->buffer);
+}
+
+void OutputGenerator::processPacket( const RSPBoardInput &input, const int64 &timestamp, struct RSP *packet )
+{
+/*
+  char *srcPtr = packet->data;
+
+  for (size_t sb = 0; sb < subbandsPerPacket; sb++) {
+    // copy full subband
+    memcpy( dstPtr, srcPtr, subbandSize );
+    srcPtr += subbandSize;
+  }
+*/
+}
+
+void OutputGenerator::missingData( const RSPBoardInput &input, const int64 &from, const int64 to )
+{
+}
+
+void OutputGenerator::write()
+{
+  /* todo: wait for T = next_block_start + max_wait_time */
+
+  for( size_t i = 0; i < consumers.size(); i++ ) {
+    RSPBoardInput &input = *inputs[i];
+    PacketBuffer &buffer = input.buffer;
+    PacketBuffer::Consumer &consumer = consumers[i];
+    unsigned timesPerSlot = input.timesPerSlot;
+  }
+}
+
+
+/*
+ * Design: 
+ *
+ * Input is read from 
+ */ 
+#endif
+
+#include <time.h>
+#include <Common/Thread/Thread.h>
+#include <WallClockTime.h>
+
+time_t start;
+
+class LogPacketSink: public PacketSink
+{
+public:
+  virtual void processPacket( Consumer *consumer, const int64 &timestamp, struct RSP &packet ) {
+    //LOG_INFO_STR( "Received packet " << timestamp );
+  }
+  virtual void missingData( Consumer *consumer, const int64 &from, const int64 to ) {
+    LOG_INFO_STR( "Missed data from " << from << " to " << to );
+  }
+};
+
+class ConsumerThread {
+public:
+  void run();
+
+  Consumer *consumer;
+  Thread thread;
+
+  ConsumerThread( Consumer *consumer ): consumer(consumer), thread( this, &ConsumerThread::run ) {}
+};
+
+void ConsumerThread::run()
+{
+  TimeStamp cts(start, 0, sampleClock);
+
+  for (size_t i = 0; i < 16; ++i) {
+    TimeStamp from = cts;
+    TimeStamp to   = cts + 16 * 1000;
+    LOG_INFO_STR( ">>>> Reading from " << (int64)from << " to " << (int64)to << " <<<<<" );
+
+    struct timespec ts = to;
+
+    consumer->wait( to, ts );
+    consumer->read( from, to );
+    LOG_INFO_STR( "<<<< Done reading from " << (int64)from << " to " << (int64)to << " >>>>>" );
+    cts = to;
+  }
+}
+
+int main( int argc, char **argv ) {
+  INIT_LOGGER(argv[0]);
+
+  bool realtime = true;
+
+  PacketBuffer buffer( 1100, sampleClock, 16, realtime );
+  LogPacketSink logsink;
+  Consumer consumer( buffer, logsink );
+  buffer.registerConsumer(consumer);
+
+  ConsumerThread cthread( &consumer );
+
+  start = time(0) + 1;
+
+  WallClockTime wct;
+
+  TimeStamp ts(start, 0, sampleClock);
+
+  for (size_t i = 0; i < 100; ++i) {
+    wct.waitUntil(ts + 0000);
+
+    for (size_t j = 0; j < 160; ++j) {
+      buffer.startWrite();
+
+      struct RSP &packet = buffer.writePtr();
+
+      packet.header.timestamp = ts.getSeqId();
+      packet.header.blockSequenceNumber = ts.getBlockId();
+    
+      buffer.stopWrite();
+
+      ts += 16;
+    }
+  }
+
+  buffer.noMoreData();
+}
diff --git a/RTCP/IONProc/test/newInputSection/shmtest.cc b/RTCP/IONProc/test/newInputSection/shmtest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f7b0d5d804b9cc0e15de40de1c8aeffbe1877ca8
--- /dev/null
+++ b/RTCP/IONProc/test/newInputSection/shmtest.cc
@@ -0,0 +1,12 @@
+#include "SharedMemory.h"
+#include <unistd.h>
+
+using namespace LOFAR;
+
+int main() {
+  INIT_LOGGER("foo");
+
+  SharedMemory shm( 0x123, 4096, SharedMemory::READ );
+
+  sleep(5);
+}
diff --git a/RTCP/InputProc/test/tRSPTimeStamp2.cc b/RTCP/IONProc/test/newInputSection/tRSPTimeStamp.cc
similarity index 55%
rename from RTCP/InputProc/test/tRSPTimeStamp2.cc
rename to RTCP/IONProc/test/newInputSection/tRSPTimeStamp.cc
index 7ea31fe4cf35b3e897cc8045c7c124309214ca24..e4085cf3f05a5bd1d1d7e3697b2541a555bdceac 100644
--- a/RTCP/InputProc/test/tRSPTimeStamp2.cc
+++ b/RTCP/IONProc/test/newInputSection/tRSPTimeStamp.cc
@@ -3,9 +3,6 @@
 #include <Common/LofarLogger.h>
 #include <Interface/RSPTimeStamp.h>
 
-using namespace LOFAR;
-using namespace RTCP;
-
 int main( int, char **argv )
 {
   INIT_LOGGER(argv[0]);
@@ -13,16 +10,18 @@ int main( int, char **argv )
   unsigned clock = 200 * 1000 * 1000;
 
   {
-    TimeStamp ts(0, 0, clock);
+    TimeStamp ts(0,0,clock);
+
+    for (int64 i = 0; i < clock * 3; ++i) {
+      ++ts;
 
-    for (int64 i = 0; i < clock * 3; ++i, ++ts) {
       #define REPORT "(ts == " << ts << ", i == " << i << ")"
 
       ASSERTSTR( (int64)ts == i, REPORT );
 
-      ASSERTSTR( ts.getSeqId() == 1024 * i / clock, REPORT );
+      ASSERTSTR( ts.getSeqId() == i / clock, REPORT );
 
-      ASSERTSTR( ts.getBlockId() == 1024 * i % clock / 1024, REPORT );
+      ASSERTSTR( ts.getBlockId() == i % clock, REPORT );
     }
   }
 }
diff --git a/RTCP/IONProc/test/tRSP.cc b/RTCP/IONProc/test/tRSP.cc
deleted file mode 100644
index 1f729eace5e7554e603d00a2a3dda6324d6769f2..0000000000000000000000000000000000000000
--- a/RTCP/IONProc/test/tRSP.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-//#  tRSP.cc: stand-alone test program for RSP packet structure
-//#
-//#  Copyright (C) 2009
-//#  ASTRON (Netherlands Foundation for Research in Astronomy)
-//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
-//#
-//#  This program is free software; you can redistribute it and/or modify
-//#  it under the terms of the GNU General Public License as published by
-//#  the Free Software Foundation; either version 2 of the License, or
-//#  (at your option) any later version.
-//#
-//#  This program is distributed in the hope that it will be useful,
-//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//#  GNU General Public License for more details.
-//#
-//#  You should have received a copy of the GNU General Public License
-//#  along with this program; if not, write to the Free Software
-//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-//# Always #include <lofar_config.h> first!
-#include <lofar_config.h>
-
-#include <RSP.h>
-#include <Interface/RSPTimeStamp.h>
-#include <Common/LofarLogger.h>
-#include <Common/DataConvert.h>
-#include <Stream/FileStream.h>
-
-#include <string>
-#include <iostream>
-
-using namespace LOFAR;
-using namespace LOFAR::RTCP;
-using namespace std;
-
-void report( const string &filename )
-{
-  cout << "---- Checking " << filename << endl;
-  FileStream f(filename);
-
-  struct RSP packet;
-
-  // read header
-  f.read( &packet.header, sizeof (RSP::Header) );
-
-#ifdef WORDS_BIGENDIAN
-  dataConvert(LittleEndian, packet.header.configuration);
-  dataConvert(LittleEndian, packet.header.timestamp);
-  dataConvert(LittleEndian, packet.header.blockSequenceNumber);
-#endif
-
-  cout << "RSP version:  " << (int)packet.header.version << endl;
-  cout << "RSP board nr: " << packet.rspBoard() << endl;
-  cout << "Payload OK:   " << (packet.payloadError() ? "NO" : "YES") << endl;
-  cout << "Clock:        " << packet.clockMHz() << " MHz" << endl;
-  cout << "Bit mode:     " << packet.bitMode() << " bit" << endl;
-  cout << "Blocks:       " << (int)packet.header.nrBlocks << endl;
-  cout << "Beamlets:     " << (int)packet.header.nrBeamlets << endl;
-
-  // read payload
-  f.read( &packet.payload, packet.packetSize() - sizeof (RSP::Header) );
-
-#ifdef WORDS_BIGENDIAN
-  if (packet.bitMode() == 16)
-    dataConvert(LittleEndian, (int16*)&packet.payload, packet.header.nrBlocks * packet.header.nrBeamlets * 2 * 2);
-#endif
-
-  cout << "Sample 4 of beamlet 2:  X = " << packet.sample(2, 4, 'X') << endl;
-  cout << "Sample 4 of beamlet 2:  Y = " << packet.sample(2, 4, 'Y') << endl;
-}
-
-int main()
-{
-  INIT_LOGGER("tRSP");
-
-  try {
-    report( "tRSP.in_16bit" );
-    report( "tRSP.in_8bit" );
-  } catch (Exception &ex) {
-    LOG_FATAL_STR("Caught exception: " << ex);
-    return 1;
-  }
-
-  return 0;
-}
diff --git a/RTCP/IONProc/test/tRSP.in_16bit b/RTCP/IONProc/test/tRSP.in_16bit
deleted file mode 100644
index 548175c8a2d6ec09a42aedf0e6248086ba6234db..0000000000000000000000000000000000000000
Binary files a/RTCP/IONProc/test/tRSP.in_16bit and /dev/null differ
diff --git a/RTCP/IONProc/test/tRSP.in_8bit b/RTCP/IONProc/test/tRSP.in_8bit
deleted file mode 100644
index b69e78c30f0002a31e8f82c59086f94715412979..0000000000000000000000000000000000000000
Binary files a/RTCP/IONProc/test/tRSP.in_8bit and /dev/null differ
diff --git a/RTCP/IONProc/test/tRSP.sh b/RTCP/IONProc/test/tRSP.sh
deleted file mode 100755
index e4def6624f6025910b02d615c6f66066bd227486..0000000000000000000000000000000000000000
--- a/RTCP/IONProc/test/tRSP.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-./runctest.sh tRSP > tRSP.log 2>&1
diff --git a/RTCP/IONProc/test/tRSP.stdout b/RTCP/IONProc/test/tRSP.stdout
deleted file mode 100644
index cc274b6f9e6208dadfcbc8db06d806affda73544..0000000000000000000000000000000000000000
--- a/RTCP/IONProc/test/tRSP.stdout
+++ /dev/null
@@ -1,20 +0,0 @@
----- Checking tRSP.in_16bit
-RSP version:  3
-RSP board nr: 0
-Payload OK:   YES
-Clock:        200 MHz
-Bit mode:     16 bit
-Blocks:       16
-Beamlets:     61
-Sample 4 of beamlet 2:  X = (-6,-20)
-Sample 4 of beamlet 2:  Y = (-18,-41)
----- Checking tRSP.in_8bit
-RSP version:  3
-RSP board nr: 1
-Payload OK:   YES
-Clock:        200 MHz
-Bit mode:     8 bit
-Blocks:       16
-Beamlets:     122
-Sample 4 of beamlet 2:  X = (3,0)
-Sample 4 of beamlet 2:  Y = (0,0)
diff --git a/RTCP/IONProc/test/tSSH.sh b/RTCP/IONProc/test/tSSH.sh
index 6f413a9d328711c3a37cca2daec202148211d708..9a1c8b302b55fbc8be21fea61e0265a25072012a 100755
--- a/RTCP/IONProc/test/tSSH.sh
+++ b/RTCP/IONProc/test/tSSH.sh
@@ -1,2 +1,2 @@
 #!/bin/sh
-./runctest.sh tSSH > tSSH.log 2>&1
+./runctest.sh tSSH 2>&1 > tSSH.log
diff --git a/RTCP/InputProc/CMakeLists.txt b/RTCP/InputProc/CMakeLists.txt
deleted file mode 100644
index 18ab5405e0d2971349d32a5fde59c26b876fef46..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# $Id: CMakeLists.txt 21382 2012-06-29 11:26:52Z mol $
-
-lofar_package(InputProc 1.0
-  DEPENDS Common Stream Interface IONProc)
-
-include(LofarFindPackage)
-lofar_find_package(Boost REQUIRED COMPONENTS date_time)
-#lofar_find_package(Libssh2)
-#lofar_find_package(Valgrind)
-#lofar_find_package(Casacore COMPONENTS measures REQUIRED)
-
-add_subdirectory(src)
-add_subdirectory(test)
diff --git a/RTCP/InputProc/src/BufferSettings.cc b/RTCP/InputProc/src/BufferSettings.cc
deleted file mode 100644
index c0c388e7b170968ed7e5ff08d39114c5ac63f234..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/BufferSettings.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <lofar_config.h>
-#include "BufferSettings.h"
-#include "SharedMemory.h"
-#include <Common/LofarLogger.h>
-
-namespace LOFAR {
-namespace RTCP {
-
-
-BufferSettings::BufferSettings()
-:
-  version(currentVersion)
-{
-}
-
-BufferSettings::BufferSettings(struct StationID station)
-:
-  version(currentVersion),
-  station(station)
-{
-  do {
-    SharedStruct<struct BufferSettings> shm(station.hash(), false);
-
-    *this = shm.get();
-  } while (!valid());  
-
-  ASSERT( valid() );
-}
-
-std::ostream& operator<<( std::ostream &str, const struct BufferSettings &s ) {
-  str << s.station << " beamlets: " << s.nrBeamlets << " buffer: " << (1.0 * s.nrSamples / s.station.clock * 1024) << "s";
-
-  return str;
-}
-
-
-}
-}
diff --git a/RTCP/InputProc/src/BufferSettings.h b/RTCP/InputProc/src/BufferSettings.h
deleted file mode 100644
index 37225f986dd025aef7818ff00a2e5dd1428e29e5..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/BufferSettings.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef __BUFFERSETTINGS__
-#define __BUFFERSETTINGS__
-
-#include <Common/LofarLogger.h>
-#include "SharedMemory.h"
-#include "StationID.h"
-#include <ostream>
-
-namespace LOFAR {
-namespace RTCP {
-
-struct BufferSettings {
-private:
-  static const unsigned currentVersion = 1;
-
-  unsigned version;
-
-  bool valid() const { return version == currentVersion; }
-
-public:
-  struct StationID station;
-
-  unsigned nrBeamlets;
-
-  size_t   nrSamples;
-
-  unsigned nrBoards;
-  size_t   nrFlagRanges;
-
-  key_t    dataKey;
-
-  BufferSettings();
-
-  // read settings from shared memory, using the given stationID
-  BufferSettings(struct StationID station);
-
-  bool operator==(const struct BufferSettings &other) const {
-    return station == other.station
-        && nrBeamlets == other.nrBeamlets 
-        && nrSamples == other.nrSamples
-        && nrBoards == other.nrBoards
-        && nrFlagRanges == other.nrFlagRanges
-        && dataKey == other.dataKey;
-  }
-
-};
-
-std::ostream& operator<<( std::ostream &str, const struct BufferSettings &s );
-
-}
-}
-
-#endif
-
diff --git a/RTCP/InputProc/src/CMakeLists.txt b/RTCP/InputProc/src/CMakeLists.txt
deleted file mode 100644
index a7d71858ff28baa60d4a4657f3f5dc338a1524b7..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-include(LofarPackageVersion)
-
-lofar_add_library(inputproc
-  Package__Version.cc
-  BufferSettings.cc
-  Generator.cc
-  PacketReader.cc
-  Ranges.cc
-  SharedMemory.cc
-  StationID.cc
-  RSPBoards.cc
-  )
-
-lofar_add_bin_program(newInputSection newInputSection.cc)
diff --git a/RTCP/InputProc/src/Generator.cc b/RTCP/InputProc/src/Generator.cc
deleted file mode 100644
index 29953bb3a93c4c4b5dac346ecb1772af101d51a1..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/Generator.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-#include <lofar_config.h>
-#include "Generator.h"
-
-#include <Common/LofarLogger.h>
-#include <Stream/Stream.h>
-#include <Interface/RSPTimeStamp.h>
-#include <Interface/SmartPtr.h>
-#include <Interface/Stream.h>
-#include <IONProc/WallClockTime.h>
-#include <boost/format.hpp>
-
-
-namespace LOFAR {
-namespace RTCP {
-
-Generator::Generator( const BufferSettings &settings, const std::vector<std::string> &streamDescriptors )
-:
-  RSPBoards(str(boost::format("[station %s %s] [Generator] ") % settings.station.stationName % settings.station.antennaField), settings, streamDescriptors),
-  nrSent(nrBoards, 0)
-{
-  LOG_INFO_STR( logPrefix << "Initialised" );
-}
-
-void Generator::makePacket( size_t boardNr, struct RSP &packet, const TimeStamp &timestamp )
-{
-  // configure the packet header
-  packet.header.version = 3; // we emulate BDI 6.0
-
-  packet.header.sourceInfo1 =
-      (boardNr & 0x1F) | (settings.station.clock == 200 * 1000 * 1000 ? 1 << 7 : 0);
-
-  switch (settings.station.bitmode) {
-    case 16:
-      packet.header.sourceInfo2 = 0;
-      break;
-
-    case 8:
-      packet.header.sourceInfo2 = 1;
-      break;
-
-    case 4:
-      packet.header.sourceInfo2 = 2;
-      break;
-  }
-
-  packet.header.nrBeamlets = settings.nrBeamlets / settings.nrBoards;
-  packet.header.nrBlocks = 16;
-
-  packet.header.timestamp = timestamp.getSeqId();
-  packet.header.blockSequenceNumber = timestamp.getBlockId();
-
-  // insert data that is different for each packet
-  int64 data = timestamp;
-
-  memset(packet.payload.data, data & 0xFF, sizeof packet.payload.data);
-
-  // verify whether the packet really reflects what we intended
-  ASSERT(packet.rspBoard()     == boardNr);
-  ASSERT(packet.payloadError() == false);
-  ASSERT(packet.bitMode()      == settings.station.bitmode);
-  ASSERT(packet.clockMHz()     == settings.station.clock / 1000000);
-}
-
-void Generator::processBoard( size_t nr )
-{
-  const std::string logPrefix(str(boost::format("[station %s %s board %u] [Generator] ") % settings.station.stationName % settings.station.antennaField % nr));
-
-  try {
-    LOG_INFO_STR( logPrefix << "Connecting to " << streamDescriptors[nr] );
-    SmartPtr<Stream> s = createStream(streamDescriptors[nr], false);
-
-    LOG_INFO_STR( logPrefix << "Start" );
-
-    TimeStamp current(time(0L) + 1, 0, settings.station.clock);
-    for(;;) {
-      struct RSP packet;
-
-      // generate packet
-      makePacket( nr, packet, current );
-
-      ASSERT(packet.packetSize() <= sizeof packet);
-    
-      // wait until it is due
-      if (!waiter.waitUntil(current))
-        break;
-
-      // send packet
-      try {
-        s->write(&packet, packet.packetSize());
-      } catch (SystemCallException &ex) {
-        // UDP can return ECONNREFUSED or EINVAL if server does not have its port open
-        if (ex.error != ECONNREFUSED && ex.error != EINVAL)
-          throw;
-      }
-
-      nrSent[nr]++;
-
-      current += packet.header.nrBlocks;
-    }
-  } catch (Stream::EndOfStreamException &ex) {
-    LOG_INFO_STR( logPrefix << "End of stream");
-  } catch (SystemCallException &ex) {
-    if (ex.error == EINTR)
-      LOG_INFO_STR( logPrefix << "Aborted: " << ex.what());
-    else
-      LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex);
-  } catch (Exception &ex) {
-    LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex);
-  }
-
-  LOG_INFO_STR( logPrefix << "End");
-}
-
-void Generator::logStatistics()
-{
-  for( size_t nr = 0; nr < nrBoards; nr++ ) {
-    const std::string logPrefix(str(boost::format("[station %s %s board %u] [Generator] ") % settings.station.stationName % settings.station.antennaField % nr));
-
-    LOG_INFO_STR( logPrefix << nrSent[nr] << " packets sent.");
-
-    nrSent[nr] = 0;
-  }
-}
-
-}
-}
diff --git a/RTCP/InputProc/src/Generator.h b/RTCP/InputProc/src/Generator.h
deleted file mode 100644
index bcda4467d6c436bb7dd7eebd2f4d0f8a4856d6ab..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/Generator.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __GENERATOR__
-#define __GENERATOR__
-
-#include <IONProc/RSP.h>
-#include "RSPBoards.h"
-#include "BufferSettings.h"
-#include <string>
-#include <vector>
-
-namespace LOFAR {
-namespace RTCP {
-
-/* Generate station input data */
-
-class Generator: public RSPBoards {
-public:
-  Generator( const BufferSettings &settings, const std::vector<std::string> &streamDescriptors );
-
-protected:
-  std::vector<size_t> nrSent;
-
-  virtual void processBoard( size_t nr );
-  virtual void logStatistics();
-
-  virtual void makePacket( size_t boardNr, struct RSP &packet, const TimeStamp &timestamp );
-};
-
-}
-}
-
-#endif
diff --git a/RTCP/InputProc/src/PacketReader.cc b/RTCP/InputProc/src/PacketReader.cc
deleted file mode 100644
index 5d5b98ed324fa34ea5dbd027f91775b72d15c8b4..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/PacketReader.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-#include <lofar_config.h>
-#include "PacketReader.h"
-#include <Common/LofarLogger.h>
-#include <Stream/SocketStream.h>
-#include <Interface/RSPTimeStamp.h>
-#include <Interface/Stream.h>
-#include <boost/format.hpp>
-
-namespace LOFAR {
-namespace RTCP {
-
-
-PacketReader::PacketReader( const std::string &logPrefix, const std::string &streamDescriptor, const struct BufferSettings &settings )
-:
-  logPrefix(str(boost::format("%s [PacketReader] ") % logPrefix)),
-  settings(settings),
-
-  nrReceived(0),
-  nrBadSize(0),
-  nrBadTime(0),
-  nrBadData(0),
-  nrBadMode(0),
-  hadSizeError(false),
-  hadModeError(false)
-{
-  inputStream = createStream(streamDescriptor, true);
-
-  SocketStream *asSocket = dynamic_cast<SocketStream *>(inputStream.get());
-  bool isUDP = asSocket && asSocket->protocol == SocketStream::UDP;
-
-  supportPartialReads = !isUDP;
-}
-
-
-bool PacketReader::readPacket( struct RSP &packet )
-{
-  if (supportPartialReads) {
-    // read header first
-    inputStream->read(&packet.header, sizeof packet.header);
-
-    // read rest of packet
-    inputStream->read(&packet.payload.data, packet.packetSize() - sizeof packet.header);
-
-    ++nrReceived;
-  } else {
-    // read full packet at once -- numbytes will tell us how much we've actually read
-    size_t numbytes = inputStream->tryRead(&packet, sizeof packet);
-
-    ++nrReceived;
-
-    if( numbytes < sizeof(struct RSP::Header)
-     || numbytes != packet.packetSize() ) {
-
-      if (!hadSizeError) {
-        LOG_ERROR_STR( logPrefix << "Packet is " << numbytes << " bytes, but should be " << packet.packetSize() << " bytes" );
-        hadSizeError = true;
-      }
-
-      ++nrBadSize;
-      return false;
-    }
-  }
-
-  // illegal timestamp means illegal packet
-  if (packet.header.timestamp == ~0U) {
-    ++nrBadTime;
-    return false;
-  }
-
-  // check sanity of packet
-
-  // discard packets with errors
-  if (packet.payloadError()) {
-    ++nrBadData;
-    return false;
-  }
-
-  // check whether the station configuration matches ours
-  if (packet.clockMHz() * 1000000 != settings.station.clock
-   || packet.bitMode() != settings.station.bitmode) {
-
-    if (!hadModeError) {
-      LOG_ERROR_STR( logPrefix << "Packet has mode (" << packet.clockMHz() << " MHz, " << packet.bitMode() << " bit), but should be mode (" << settings.station.clock / 1000000 << " MHz, " << settings.station.bitmode << " bit)");
-      hadModeError = true;
-    }
-
-    ++nrBadMode;
-    return false;
-  }
-
-  return true;
-}
-
-
-void PacketReader::logStatistics()
-{
-  LOG_INFO_STR( logPrefix << "Received " << nrReceived << " packets: " << nrBadTime << " bad timestamps, " << nrBadSize << " bad sizes, " << nrBadData << " payload errors, " << nrBadMode << " clock/bitmode errors" );
-
-  nrReceived = 0;
-  nrBadTime = 0;
-  nrBadSize = 0;
-  nrBadData = 0;
-  nrBadMode = 0;
-
-  hadSizeError = false;
-  hadModeError = false;
-}
-
-
-}
-}
diff --git a/RTCP/InputProc/src/PacketReader.h b/RTCP/InputProc/src/PacketReader.h
deleted file mode 100644
index 346c0263a6cbed57b4bd8f478d803f4a33dca13f..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/PacketReader.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef __PACKETREADER__
-#define __PACKETREADER__
-
-#include <Stream/Stream.h>
-#include <Interface/SmartPtr.h>
-#include <IONProc/RSP.h>
-#include "BufferSettings.h"
-#include <string>
-
-namespace LOFAR {
-namespace RTCP {
-
-/* Receives input of one RSP board and stores it in shared memory. */
-
-class PacketReader {
-public:
-  PacketReader( const std::string &logPrefix, const std::string &streamDescriptor, const struct BufferSettings &settings );
-
-  // Reads a packet from the input stream. Returns true if a packet was
-  // succesfully read.
-  bool readPacket( struct RSP &packet );
-
-  void logStatistics();
-
-private:
-  const std::string logPrefix;
-
-  SmartPtr<Stream> inputStream;
-  bool supportPartialReads;
-  const struct BufferSettings settings;
-
-  size_t nrReceived, nrBadSize, nrBadTime, nrBadData, nrBadMode;
-  bool hadSizeError, hadModeError;
-};
-
-
-}
-}
-
-#endif
diff --git a/RTCP/InputProc/src/PacketsToBuffer.h b/RTCP/InputProc/src/PacketsToBuffer.h
deleted file mode 100644
index 8d987a8dcb24891c6014a4280e4666a6cd802559..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/PacketsToBuffer.h
+++ /dev/null
@@ -1,204 +0,0 @@
-#ifndef __STATION__
-#define __STATION__
-
-#include <Common/LofarLogger.h>
-#include <Common/LofarConstants.h>
-#include <Stream/Stream.h>
-#include <Stream/SocketStream.h>
-#include <Interface/RSPTimeStamp.h>
-#include <Interface/SmartPtr.h>
-#include <Interface/Stream.h>
-#include <IONProc/RSP.h>
-#include <IONProc/WallClockTime.h>
-#include "SampleBuffer.h"
-#include "BufferSettings.h"
-#include "PacketReader.h"
-#include "Ranges.h"
-#include "time.h"
-#include <boost/format.hpp>
-#include <string>
-#include <vector>
-#include <ios>
-
-namespace LOFAR {
-namespace RTCP {
-
-/* Receives station input and stores it in shared memory */
-
-template<typename T> class PacketsToBuffer: public RSPBoards {
-public:
-  PacketsToBuffer( const BufferSettings &settings, const std::vector<std::string> &streamDescriptors );
-
-protected:
-  SampleBuffer<T> buffer;
-
-  class BufferWriter {
-  public:
-    BufferWriter( const std::string &logPrefix, SampleBuffer<T> &buffer, Ranges &flags, size_t firstBeamlet, const struct BufferSettings &settings );
-
-    // Write a packet to the SampleBuffer
-    void writePacket( const struct RSP &packet );
-
-    void logStatistics();
-
-  private:
-    const std::string logPrefix;
-
-    SampleBuffer<T> &buffer;
-    Ranges &flags;
-    const struct BufferSettings settings;
-    const size_t firstBeamlet;
-
-    size_t nrWritten;
-  };
-
-  std::vector< SmartPtr<PacketReader> > readers;
-  std::vector< SmartPtr<BufferWriter> > writers;
-
-  // process data for this board until interrupted or end of data
-  virtual void processBoard( size_t nr );
-
-  virtual void logStatistics();
-};
-
-
-template<typename T> PacketsToBuffer<T>::PacketsToBuffer( const BufferSettings &settings, const std::vector<std::string> &streamDescriptors )
-:
-  RSPBoards(str(boost::format("[station %s %s] ") % settings.station.stationName % settings.station.antennaField), settings, streamDescriptors),
-
-  buffer(settings, true),
-  readers(nrBoards, 0),
-  writers(nrBoards, 0)
-{
-  LOG_INFO_STR( logPrefix << "Initialised" );
-}
-
-template<typename T> void PacketsToBuffer<T>::processBoard( size_t nr )
-{
-  const std::string logPrefix(str(boost::format("%s [board %u] ") % this->logPrefix % nr));
-
-  try {
-    LOG_INFO_STR( logPrefix << "Connecting to " << streamDescriptors[nr] );
-    readers[nr] = new PacketReader(logPrefix, streamDescriptors[nr], settings);
-
-    LOG_INFO_STR( logPrefix << "Connecting to shared memory buffer 0x" << std::hex << settings.dataKey );
-    size_t firstBeamlet = settings.nrBeamlets / settings.nrBoards * nr;
-    writers[nr] = new BufferWriter(logPrefix, buffer, buffer.flags[nr], firstBeamlet, settings);
-
-    LOG_INFO_STR( logPrefix << "Start" );
-
-    struct RSP packet;
-
-    for(;;)
-      if (readers[nr]->readPacket(packet))
-        writers[nr]->writePacket(packet);
-
-  } catch (Stream::EndOfStreamException &ex) {
-    LOG_INFO_STR( logPrefix << "End of stream");
-  } catch (SystemCallException &ex) {
-    if (ex.error == EINTR)
-      LOG_INFO_STR( logPrefix << "Aborted: " << ex.what());
-    else
-      LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex);
-  } catch (Exception &ex) {
-    LOG_ERROR_STR( logPrefix << "Caught Exception: " << ex);
-  }
-
-  LOG_INFO_STR( logPrefix << "End");
-}
-
-
-template<typename T> void PacketsToBuffer<T>::logStatistics()
-{
-  ASSERT(readers.size() == nrBoards);
-  ASSERT(writers.size() == nrBoards);
-
-  for (size_t nr = 0; nr < nrBoards; nr++) {
-    if (readers[nr].get())
-      readers[nr]->logStatistics();
-
-    if (writers[nr].get())
-      writers[nr]->logStatistics();
-  }
-}
-
-
-template<typename T> PacketsToBuffer<T>::BufferWriter::BufferWriter( const std::string &logPrefix, SampleBuffer<T> &buffer, Ranges &flags, size_t firstBeamlet, const struct BufferSettings &settings )
-:
-  logPrefix(str(boost::format("%s [BufferWriter] ") % logPrefix)),
-
-  buffer(buffer),
-  flags(flags),
-  settings(settings),
-  firstBeamlet(firstBeamlet),
-
-  nrWritten(0)
-{
-  // bitmode must coincide with our template
-  ASSERT( sizeof(T) == N_POL * 2 * settings.station.bitmode / 8 );
-}
-
-
-template<typename T> void PacketsToBuffer<T>::BufferWriter::writePacket( const struct RSP &packet )
-{
-  const uint8 &nrBeamlets  = packet.header.nrBeamlets;
-  const uint8 &nrTimeslots = packet.header.nrBlocks;
-
-  // should not exceed the number of beamlets in the buffer
-  ASSERT( firstBeamlet + nrBeamlets < settings.nrBeamlets );
-
-  const TimeStamp timestamp(packet.header.timestamp, packet.header.blockSequenceNumber, settings.station.clock);
-
-  // determine the time span when cast on the buffer
-  const size_t from_offset = (int64)timestamp % settings.nrSamples;
-  size_t to_offset = ((int64)timestamp + nrTimeslots) % settings.nrSamples;
-
-  if (to_offset == 0)
-    to_offset = settings.nrSamples;
-
-  const size_t wrap = from_offset < to_offset ? 0 : settings.nrSamples - from_offset;
-
-  /*
-   * Make sure the buffer and flags are always consistent.
-   */
-
-  // mark data we overwrite as invalid
-  flags.excludeBefore(timestamp + nrTimeslots - settings.nrSamples);
-
-  // transpose
-  const T *beamlets = reinterpret_cast<const T*>(&packet.payload.data);
-
-  for (uint8 b = 0; b < nrBeamlets; ++b) {
-    T *dst1 = &buffer.beamlets[firstBeamlet + b][from_offset];
-
-    if (wrap > 0) {
-      T *dst2 = &buffer.beamlets[firstBeamlet + b][0];
-
-      memcpy(dst1, beamlets, wrap        * sizeof(T));
-      memcpy(dst2, beamlets, to_offset   * sizeof(T));
-    } else {
-      memcpy(dst1, beamlets, nrTimeslots * sizeof(T));
-    }
-
-    beamlets += nrTimeslots;
-  }
-
-  // mark as valid
-  flags.include(timestamp, timestamp + nrTimeslots);
-
-  ++nrWritten;
-}
-
-
-template<typename T> void PacketsToBuffer<T>::BufferWriter::logStatistics()
-{
-  LOG_INFO_STR( logPrefix << "Written " << nrWritten << " packets");
-
-  nrWritten = 0;
-}
-
-
-}
-}
-
-#endif
diff --git a/RTCP/InputProc/src/RSPBoards.cc b/RTCP/InputProc/src/RSPBoards.cc
deleted file mode 100644
index b561d262378a00c71961bacd8578a8b9e148e1bb..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/RSPBoards.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-#include <lofar_config.h>
-#include "RSPBoards.h"
-#include "OMPThread.h"
-#include <Common/LofarLogger.h>
-#include <omp.h>
-
-namespace LOFAR {
-namespace RTCP {
-
-
-RSPBoards::RSPBoards( const std::string &logPrefix, const BufferSettings &settings, const std::vector<std::string> &streamDescriptors )
-:
-  logPrefix(logPrefix),
-  settings(settings),
-  streamDescriptors(streamDescriptors),
-  nrBoards(streamDescriptors.size())
-{
-}
-
-void RSPBoards::process()
-{
-  std::vector<OMPThread> threads(nrBoards * 2);
-
-  ASSERT(nrBoards > 0);
-
-  LOG_INFO_STR( logPrefix << "Start" );
-
-  #pragma omp parallel sections num_threads(3)
-  {
-    #pragma omp section
-    {
-      // start all boards
-      LOG_INFO_STR( logPrefix << "Starting all boards" );
-      #pragma omp parallel for num_threads(nrBoards)
-      for (size_t i = 0; i < nrBoards; ++i) {
-        OMPThread::ScopedRun sr(threads[i]);
-  
-        try {
-          processBoard(i);
-        } catch(Exception &ex) {
-          LOG_ERROR_STR("Caught exception: " << ex);
-        }
-      }
-
-      // we're done
-      stop();
-    }
-
-    #pragma omp section
-    {
-      // start all log statistics
-      LOG_INFO_STR( logPrefix << "Starting all log statistics" );
-      #pragma omp parallel for num_threads(nrBoards)
-      for (size_t i = 0; i < nrBoards; ++i) {
-        OMPThread::ScopedRun sr(threads[i + nrBoards]);
-  
-        try {
-          for(;;) {
-            if (usleep(999999) == -1 && errno == EINTR)
-              break;
-
-            logStatistics();
-          }
-        } catch(Exception &ex) {
-          LOG_ERROR_STR("Caught exception: " << ex);
-        }
-      }
-    }
-
-    #pragma omp section
-    {
-      // wait until we have to stop
-      LOG_INFO_STR( logPrefix << "Waiting for stop signal" );
-      waiter.waitForever();     
-
-      // kill all boards
-      LOG_INFO_STR( logPrefix << "Stopping all boards" );
-      #pragma omp parallel for num_threads(threads.size())
-      for (size_t i = 0; i < threads.size(); ++i)
-        try {
-          threads[i].kill();
-        } catch(Exception &ex) {
-          LOG_ERROR_STR("Caught exception: " << ex);
-        }
-    }
-  }
-
-  LOG_INFO_STR( logPrefix << "End" );
-}
-
-void RSPBoards::stop()
-{
-  waiter.cancelWait();
-}
-
-
-}
-}
diff --git a/RTCP/InputProc/src/RSPBoards.h b/RTCP/InputProc/src/RSPBoards.h
deleted file mode 100644
index 8f9c70c9a58a829751264d9d7c012d341a59812f..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/RSPBoards.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef __RSPBOARDS__
-#define __RSPBOARDS__
-
-#include "BufferSettings.h"
-#include <IONProc/WallClockTime.h>
-#include <string>
-#include <vector>
-
-namespace LOFAR {
-namespace RTCP {
-
-/* A class that generates or processes a set of data streams of a station. */
-
-class RSPBoards {
-public:
-  RSPBoards( const std::string &logPrefix, const BufferSettings &settings, const std::vector<std::string> &streamDescriptors );
-
-  void process();
-
-  void stop();
-
-protected:
-  const std::string logPrefix;
-  const BufferSettings settings;
-  const std::vector<std::string> streamDescriptors;
-  const size_t nrBoards;
-
-  WallClockTime waiter;
-
-  virtual void processBoard( size_t nr ) = 0;
-  virtual void logStatistics() = 0;
-};
-
-
-}
-}
-
-#endif
diff --git a/RTCP/InputProc/src/Ranges.h b/RTCP/InputProc/src/Ranges.h
deleted file mode 100644
index 60d6f6ea46f71ad6df69d4a1319ef343facd4af5..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/Ranges.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef RANGES
-#define RANGES
-
-#include <Interface/SparseSet.h>
-#include <Common/LofarLogger.h>
-#include <Common/LofarTypes.h>
-
-#include <ostream>
-
-namespace LOFAR {
-namespace RTCP {
-
-//
-// Thread-safe, lock-free set of int64 [from,to) ranges.
-//
-// This implementation is thread safe for one writer and any number
-// of readers.
-//
-// To maintain integrity, we maintain a fixed set of [from,to)
-// ranges. For any range, if to == 0, the range is either unused
-// or in the process of being updated. The calling process needs
-// to make sure that it updates ranges in an order that ensures
-// integrity w.r.t. the data that is represented. That is,
-// exclude ranges that will be overwritten before writing and
-// including the new data.
-
-class Ranges {
-public:
-  Ranges();
-  Ranges( void *data, size_t numBytes, int64 minHistory, bool create );
-  ~Ranges();
-
-  // remove [0,to)
-  void excludeBefore( int64 to );
-
-  // add a range [from,to), and return whether the addition
-  // was succesful.
-  bool include( int64 from, int64 to );
-
-  // returns whether there is anything set in [first, last)
-  bool anythingBetween( int64 first, int64 last ) const;
-
-  SparseSet<int64> sparseSet( int64 first, int64 last ) const;
-
-  static size_t elementSize() { return sizeof(struct Range); }
-
-private:
-  struct Range {
-    // Write 'from' before 'to' to allow the following invariant:
-    //
-    // from <  to   : a valid range
-    // from >= to   : invalid range (being written)
-    // from = to = 0: an unused range
-    volatile int64 from, to;
-
-    Range(): from(0), to(0) {}
-  };
-
-  bool create;
-  size_t len;
-  Range *ranges;
-  Range *begin;
-  Range *end;
-  Range *head;
-
-  // minimal history to maintain (samples newer than this
-  // will be maintained in favour of newly added ranges)
-  int64 minHistory;
-
-public:
-  static size_t size(size_t numElements) {
-    return numElements * sizeof(struct Range);
-  }
-
-  friend std::ostream& operator<<( std::ostream &str, const Ranges &r );
-};
-
-std::ostream& operator<<( std::ostream &str, const Ranges &r );
-
-}
-}
-
-#endif
-
diff --git a/RTCP/InputProc/src/SampleBufferReader.h b/RTCP/InputProc/src/SampleBufferReader.h
deleted file mode 100644
index 83db4040d4ff1e5c4fd75a56e0d991c8e3db03f3..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/SampleBufferReader.h
+++ /dev/null
@@ -1,201 +0,0 @@
-#ifndef __SAMPLEBUFFERREADER__
-#define __SAMPLEBUFFERREADER__
-
-#include <Common/LofarLogger.h>
-#include <IONProc/WallClockTime.h>
-#include <Interface/RSPTimeStamp.h>
-#include "BufferSettings.h"
-#include "SampleBuffer.h"
-
-#include <mpi.h>
-#include <vector>
-#include <string>
-
-using namespace LOFAR;
-using namespace RTCP;
-
-namespace LOFAR {
-namespace RTCP {
-
-template<typename T> class SampleBufferReader {
-public:
-  SampleBufferReader( const BufferSettings &settings, const std::vector<size_t> beamlets, const TimeStamp &from, const TimeStamp &to, size_t blockSize );
-
-  void process( double maxDelay );
-
-protected:
-  const BufferSettings settings;
-  SampleBuffer<T> buffer;
-
-  const std::vector<size_t> beamlets;
-  const TimeStamp from, to;
-  const size_t blockSize;
-
-  /* process() will call one of these sequences:
-   *
-   * 1. copyNothing(from, to);
-   *
-   * 2. copyStart(from, to, 0);
-   *    foreach(beamlet)
-   *      copyBeamlet(beamlet, 0, from, .., ..);
-   *    foreach(board)
-   *      copyFlags(board, ..);
-   *    copyEnd();
-   *
-   * 3. copyStart(from, to, ..);
-   *    foreach(beamlet) {
-   *      copyBeamlet(beamlet, 0, from, .., ..);
-   *      copyBeamlet(beamlet, 1, .., .., ..);
-   *    }
-   *    foreach(board)
-   *      copyFlags(board, ..);
-   *    copyEnd();
-   *
-   * Two transfers are needed per beamlet if the requested
-   * range wraps around the end of the buffer.
-   */
-
-  virtual void copyNothing( const TimeStamp &from, const TimeStamp &to ) { (void)from, (void)to; }
-
-  virtual void copyStart( const TimeStamp &from, const TimeStamp &to, size_t wrap ) { (void)from, (void)to, (void)wrap; }
-  virtual void copyBeamlet( unsigned beamlet, unsigned transfer, const TimeStamp &from_ts, const T* from, size_t nrSamples ) = 0;
-  virtual void copyFlags( unsigned board, const SparseSet<int64> &flags ) = 0;
-  virtual void copyEnd() {}
-
-  void copy( const TimeStamp &from, const TimeStamp &to );
-
-private:
-  WallClockTime waiter;
-};
-
-
-template<typename T> SampleBufferReader<T>::SampleBufferReader( const BufferSettings &settings, const std::vector<size_t> beamlets, const TimeStamp &from, const TimeStamp &to, size_t blockSize )
-:
-  settings(settings),
-  buffer(settings, false),
-
-  beamlets(beamlets),
-  from(from),
-  to(to),
-  blockSize(blockSize)
-{
-  for (size_t i = 0; i < beamlets.size(); ++i)
-    ASSERT( beamlets[i] < buffer.nrBeamlets );
-
-  ASSERT( blockSize > 0 );
-  ASSERT( blockSize < settings.nrSamples );
-  ASSERT( from < to );
-}
-
-
-template<typename T> void SampleBufferReader<T>::process( double maxDelay )
-{
-  /*const TimeStamp maxDelay_ts(static_cast<int64>(maxDelay * settings.station.clock / 1024) + blockSize, settings.station.clock);
-
-  const TimeStamp current(from);
-
-  for (TimeStamp current = from; current < to; current += blockSize) {
-    // wait
-    LOG_INFO_STR("Waiting until " << (current + maxDelay_ts) << " for " << current);
-    waiter.waitUntil( current + maxDelay_ts );
-
-    // read
-    LOG_INFO_STR("Reading from " << current << " to " << (current + blockSize));
-    copy(current, current + blockSize);
-  }
-
-  LOG_INFO("Done reading data");*/
-  const TimeStamp maxDelay_ts(static_cast<int64>(maxDelay * settings.station.clock / 1024) + blockSize, settings.station.clock);
-
-  const TimeStamp current(from);
-
-  double totalwait = 0.0;
-  unsigned totalnr = 0;
-
-  double lastreport = MPI_Wtime();
-
-  for (TimeStamp current = from; current < to; current += blockSize) {
-    // wait
-    waiter.waitUntil( current + maxDelay_ts );
-
-    // read
-    double bs = MPI_Wtime();
-
-    copy(current, current + blockSize);
-
-    totalwait += MPI_Wtime() - bs;
-    totalnr++;
-
-    if (bs - lastreport > 1.0) {
-      double mbps = (sizeof(T) * blockSize * beamlets.size() * 8) / (totalwait/totalnr) / 1e6;
-      lastreport = bs;
-      totalwait = 0.0;
-      totalnr = 0;
-
-      LOG_INFO_STR("Reading speed: " << mbps << " Mbit/s");
-    }
-  }
-
-  LOG_INFO("Done reading data");
-}
-
-template<typename T> void SampleBufferReader<T>::copy( const TimeStamp &from, const TimeStamp &to )
-{
-  ASSERT( from < to );
-  ASSERT( to - from < (int64)buffer.nrSamples );
-
-  const unsigned nrBoards = buffer.flags.size();
-
-#if 0
-  // check whether there is any data at all
-  bool data = false;
-
-  for (unsigned b = 0; b < nrBoards; ++b)
-    if (buffer.flags[b].anythingBetween(from, to)) {
-      data = true;
-      break;
-    }
-
-  if (!data) {
-    copyNothing(from, to);
-    return;
-  }
-#endif
-
-  // copy the beamlets
-
-  size_t from_offset = (int64)from % buffer.nrSamples;
-  size_t to_offset   = (int64)to % buffer.nrSamples;
-
-  if (to_offset == 0)
-    to_offset = buffer.nrSamples;
-
-  // wrap > 0 if we need to wrap around the end of the buffer
-  size_t wrap         = from_offset < to_offset ? 0 : buffer.nrSamples - from_offset;
-
-  copyStart(from, to, wrap);
-
-  for (size_t i = 0; i < beamlets.size(); ++i) {
-    unsigned nr = beamlets[i];
-    const T* origin = &buffer.beamlets[nr][0];
-
-    if (wrap > 0) {
-      copyBeamlet( nr, 0, from, origin + from_offset, wrap );
-      copyBeamlet( nr, 1, from, origin,               to_offset );
-    } else {
-      copyBeamlet( nr, 0, from, origin + from_offset, to_offset - from_offset );
-    }
-  }
-
-  // copy the flags
-
-  for (unsigned b = 0; b < nrBoards; ++b)
-    copyFlags( b, buffer.flags[b].sparseSet(from, to).invert(from, to) );
-
-  copyEnd();
-}
-
-}
-}
-
-#endif
diff --git a/RTCP/InputProc/src/SampleType.h b/RTCP/InputProc/src/SampleType.h
deleted file mode 100644
index 954686cba8148c5379a832c9a040073c9efa3aa2..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/SampleType.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __SAMPLETYPE__
-#define __SAMPLETYPE__
-
-#include <ostream>
-#include <Common/LofarTypes.h>
-
-namespace LOFAR {
-namespace RTCP {
-
-
-template<typename T> struct SampleType {
-  T x, y;
-};
-
-template struct SampleType<i16complex>;
-template struct SampleType<i8complex>;
-template struct SampleType<i4complex>;
-
-
-template<typename T> std::ostream &operator <<(std::ostream &str, const struct SampleType<T> &sample)
-{
-  str << "(" << sample.x.real() << " + " << sample.x.imag() << "i, " << sample.y.real() << " + " << sample.y.imag() << "i)";
-
-  return str;
-}
-
-
-}
-}
-
-#endif
-
diff --git a/RTCP/InputProc/src/SharedMemory.h b/RTCP/InputProc/src/SharedMemory.h
deleted file mode 100644
index c5e4a299e174732a40dbeaa00febb7d49e1cdcb7..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/SharedMemory.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef SHARED_MEMORY
-#define SHARED_MEMORY
-
-#include <Common/Exception.h>
-#include <Interface/Allocator.h>
-
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-namespace LOFAR {
-namespace RTCP {
-
-/*
- * A memory region manager for shared memory, to be used by
- * allocators defined in Interface/Allocator.h
- */
-class SharedMemoryArena: public FixedArena {
-public:
-  EXCEPTION_CLASS(TimeOutException, LOFAR::Exception);
-
-  enum Mode {
-    CREATE,
-    CREATE_EXCL,
-    READ,
-    READWRITE
-  };
-
-  /* Create a shared memory region, or attach to an existing one. The timeout
-   * specifies how long the constructor will wait for the memory region to
-   * appear if mode == READ or mode == READWRITE.
-   */
-  SharedMemoryArena( key_t key, size_t size, Mode mode = CREATE, time_t timeout = 60 );
-  ~SharedMemoryArena();
-
-  template <typename T> T* ptr( size_t offset = 0 ) const {
-    return reinterpret_cast<T*>(reinterpret_cast<char*>(itsBegin) + offset);
-  }
-
-private:
-  const key_t key;
-  const Mode mode;
-  int shmid;
-};
-
-/*
- * Provides an interface for any struct stored as a shared memory region.
- */
-template<typename T> class SharedStruct {
-public:
-  SharedStruct( key_t key, bool create = false, time_t timeout = 60 );
-
-  T &get() {
-    return *data.ptr<T>();
-  }
-
-  T &get() const {
-    return *data.ptr<T>();
-  }
-
-private:
-  SharedMemoryArena data;
-
-  SharedStruct( const SharedStruct & );
-  SharedStruct &operator=( const SharedStruct & );
-};
-
-
-template<typename T> SharedStruct<T>::SharedStruct( key_t key, bool create, time_t timeout )
-:
-  data(key, sizeof(T), create ? SharedMemoryArena::CREATE : SharedMemoryArena::READWRITE, timeout)
-{
-}
-
-}
-}
-
-#endif
-
diff --git a/RTCP/InputProc/src/StationID.cc b/RTCP/InputProc/src/StationID.cc
deleted file mode 100644
index fd601494077a0c0b83225eeda6c2596261348538..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/StationID.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-#include <lofar_config.h>
-#include "StationID.h"
-#include <Common/LofarLogger.h>
-#include <cstdio>
-
-#include <cstring>
-
-#ifndef HAVE_STRNLEN
-static size_t strnlen( const char *s, size_t maxlen )
-{
-  size_t len = 0;
-
-  for(; *s && len < maxlen; ++s)
-    ++len;
-
-  return len;
-}
-#endif
-
-namespace LOFAR {
-namespace RTCP {
-
-
-StationID::StationID( const std::string &stationName, const std::string &antennaField, unsigned clock, unsigned bitmode)
-:
-  clock(clock),
-  bitmode(bitmode)
-{
-  ASSERTSTR( stationName.size() < sizeof this->stationName, "Station name longer than " << (sizeof this->stationName - 1) << " characters.");
-  ASSERTSTR( antennaField.size() < sizeof this->antennaField, "Antenna-set name longer than " << (sizeof this->antennaField - 1) << " characters.");
-
-  snprintf(this->stationName, sizeof this->stationName, "%s", stationName.c_str());
-  snprintf(this->antennaField, sizeof this->antennaField, "%s", antennaField.c_str());
-}
-
-bool StationID::operator==(const struct StationID &other) const {
-  return !strncmp(stationName, other.stationName, sizeof stationName)
-      && !strncmp(antennaField, other.antennaField, sizeof antennaField)
-      && clock == other.clock
-      && bitmode == other.bitmode;
-}
-
-bool StationID::operator!=(const struct StationID &other) const {
-  return !(*this == other);
-}
-
-uint32 StationID::hash() const {
-  // convert to 32 bit value (human-readable in hexadecimal):
-  //
-  //
-  // 0x0106020F
-  //   \__||\||
-  //      || |\_ bitmode:       F  = 16-bit, 8 = 8-bit, 4 = 4-bit
-  //      || \__ clock:         20 = 200 MHz, 16 = 160 MHz
-  //      |\____ antenna field: 0 = HBA/HBA0/LBA, 1 = HBA1
-  //      \_____ station ID:    0x0106 = RS106
-  
-  uint32 stationNr = 0;
-
-  const std::string stationNameStr(stationName, strnlen(stationName, sizeof stationName));
-  const std::string antennaFieldStr(antennaField, strnlen(antennaField, sizeof antennaField));
-
-  for(std::string::const_iterator c = stationNameStr.begin(); c != stationNameStr.end(); ++c)
-    if(*c >= '0' && *c <= '9')
-      stationNr = stationNr * 16 + (*c - '0');
-
-  uint32 antennaFieldNr = 0;
-
-  if (antennaFieldStr == "HBA1")
-    antennaFieldNr = 1;
-  else
-    antennaFieldNr = 0;
-
-  // make sure everything fits
-  ASSERT( stationNr    < (1L << 16) );
-  ASSERT( antennaFieldNr < (1L << 4)  );
-
-  ASSERT( clock/1000000 == 200 || clock/1000000 == 160 );
-  ASSERT( bitmode == 4 || bitmode == 8 || bitmode == 16 );
-
-  // derive the hash
-  unsigned clockNr = clock/1000000 == 200 ? 0x20 : 0x16;
-  unsigned bitmodeNr = bitmode == 16 ? 0xF : bitmode;
-
-  return (stationNr << 16) + (antennaFieldNr << 12) + (clockNr << 4) + bitmodeNr;
-}
-
-std::ostream& operator<<( std::ostream &str, const struct StationID &s ) {
-  str << "station " << s.stationName << " antenna field " << s.antennaField << " clock " << s.clock/1000000 << " bitmode " << s.bitmode;
-
-  return str;
-}
-
-}
-}
diff --git a/RTCP/InputProc/src/StationID.h b/RTCP/InputProc/src/StationID.h
deleted file mode 100644
index 4509bd08a4f8c0ac76f33ff1fcd8c4d7d84136db..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/src/StationID.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __STATIONID__
-#define __STATIONID__
-
-#include <Common/LofarTypes.h>
-#include <ostream>
-#include <string>
-
-namespace LOFAR {
-namespace RTCP {
-
-struct StationID {
-  char stationName[64];
-  char antennaField[64];
-
-  unsigned clock;
-  unsigned bitmode;
-
-  StationID( const std::string &stationName = "", const std::string &antennaField = "", unsigned clock = 200 * 1000 * 1000, unsigned bitmode = 16);
-
-  bool operator==(const struct StationID &other) const;
-  bool operator!=(const struct StationID &other) const;
-
-  uint32 hash() const;
-};
-
-std::ostream& operator<<( std::ostream &str, const struct StationID &s );
-
-}
-}
-
-
-#endif
-
diff --git a/RTCP/InputProc/test/CMakeLists.txt b/RTCP/InputProc/test/CMakeLists.txt
deleted file mode 100644
index fd7cf58f1b11fd92e35b53f23165e3105b315c7e..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/test/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-# $Id: CMakeLists.txt 13414 2009-06-16 22:15:37Z loose $
-
-include(LofarCTest)
-
-# Add project's source directory to -I path.
-include_directories(${PACKAGE_SOURCE_DIR}/src)
-
-lofar_add_test(tGenerator tGenerator.cc)
-lofar_add_test(tRSPTimeStamp2 tRSPTimeStamp2.cc)
-lofar_add_test(tRanges tRanges.cc)
-lofar_add_test(tSharedMemory tSharedMemory.cc)
diff --git a/RTCP/InputProc/test/tGenerator.cc b/RTCP/InputProc/test/tGenerator.cc
deleted file mode 100644
index 7f53bb97cdcf6f93ad7561c0b7088e5c176412b1..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/test/tGenerator.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-#include <lofar_config.h>
-#include "Generator.h"
-#include "PacketReader.h"
-#include "OMPThread.h"
-#include <Common/LofarLogger.h>
-#include <vector>
-#include <string>
-#include <unistd.h>
-#include "omp.h"
-
-using namespace LOFAR;
-using namespace RTCP;
-using namespace std;
-
-// Duration of the test (seconds)
-#define DURATION 2
-
-// The number of packets to transmit (note: there are 16 time samples/packet)
-#define NUMPACKETS (200000000/1024/16)
-
-
-int main( int, char **argv ) {
-  INIT_LOGGER( argv[0] );
-
-  // Don't run forever if communication fails for some reason
-  alarm(10);
-
-  omp_set_nested(true);
-  omp_set_num_threads(16);
-
-  OMPThread::init();
-
-  vector<string> streamDescs(1, "tcp:localhost:54321");
-
-  unsigned clock = 200 * 1000 * 1000;
-  struct StationID stationID("RS106", "LBA", clock, 16);
-  struct BufferSettings settings;
-
-  settings.station = stationID;
-  settings.nrBeamlets = 61;
-  settings.nrBoards = 1;
-
-  settings.nrSamples = (2 * stationID.clock / 1024);// & ~0xFL;
-  settings.nrFlagRanges = 64;
-
-  settings.dataKey = stationID.hash();
-
-  Generator g(settings, streamDescs);
-
-  bool error = false;
-
-  #pragma omp parallel sections num_threads(2)
-  {
-    #pragma omp section
-    {
-      // Generate packets
-
-      try {
-        g.process();
-      } catch(Exception &ex) {
-        LOG_ERROR_STR("Caught exception: " << ex);
-        error = true;
-      }
-    }
-
-    #pragma omp section
-    { 
-      // Read and verify the generated packets
-
-      try {
-        PacketReader reader("", streamDescs[0], settings);
-
-        for(size_t nr = 0; nr < NUMPACKETS; ++nr) {
-          struct RSP packet;
-
-          if (!reader.readPacket(packet)) {
-            reader.logStatistics();
-
-            ASSERT(false);
-          }
-        }
-
-        // We received NUMPACKETS packets, kill the generator
-        g.stop();
-      } catch(Exception &ex) {
-        LOG_ERROR_STR("Caught exception: " << ex);
-        error = true;
-      }
-    }
-  }
-
-  return error ? 1 : 0;
-}
-
diff --git a/RTCP/InputProc/test/tRanges.cc b/RTCP/InputProc/test/tRanges.cc
deleted file mode 100644
index a5d31fb8afe8c097e8070f1385f745ccc89708ad..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/test/tRanges.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-#include <lofar_config.h>
-#include "Ranges.h"
-#include <Common/LofarLogger.h>
-#include <vector>
-
-using namespace LOFAR;
-using namespace RTCP;
-using namespace std;
-
-int main( int, char **argv ) {
-  INIT_LOGGER( argv[0] );
-
-  size_t clock = 200 * 1000 * 1000;
-  bool result;
-
-  {
-    LOG_INFO("Basic tests");
-
-    vector<char> buf(10 * Ranges::elementSize());
-    Ranges r(&buf[0], buf.size(), clock / 1024, true);
-
-    result = r.include(10, 20);
-    ASSERT(result);
-
-    /* r == [10,20) */
-
-    ASSERT(r.anythingBetween(10, 20));
-    ASSERT(r.anythingBetween(0, 30));
-    ASSERT(r.anythingBetween(0, 15));
-    ASSERT(r.anythingBetween(15, 30));
-    ASSERT(!r.anythingBetween(0, 10));
-    ASSERT(!r.anythingBetween(20, 30));
-
-    result = r.include(30, 40);
-    ASSERT(result);
-
-    /* r == [10,20) + [30,40) */
-
-    SparseSet<int64> s(r.sparseSet(0,100));
-    ASSERT(!s.test(9));
-    ASSERT(s.test(10));
-    ASSERT(s.test(11));
-    ASSERT(s.test(19));
-    ASSERT(!s.test(20));
-    ASSERT(!s.test(29));
-    ASSERT(s.test(30));
-    ASSERT(s.test(31));
-    ASSERT(s.test(39));
-    ASSERT(!s.test(40));
-
-    SparseSet<int64> s2(r.sparseSet(15,35));
-    ASSERT(!s2.test(14));
-    ASSERT(s2.test(15));
-    ASSERT(s2.test(19));
-    ASSERT(!s2.test(20));
-    ASSERT(!s2.test(29));
-    ASSERT(s2.test(30));
-    ASSERT(s2.test(31));
-    ASSERT(!s2.test(35));
-
-    r.excludeBefore(35);
-
-    /* r == [35,40) */
-
-    ASSERT(!r.anythingBetween(0,35));
-    ASSERT(r.anythingBetween(35,40));
-    ASSERT(!r.anythingBetween(40,100));
-  }
-
-
-  return 0;
-}
diff --git a/RTCP/InputProc/test/tSharedMemory.cc b/RTCP/InputProc/test/tSharedMemory.cc
deleted file mode 100644
index 6d6dd0cb4569346ab241d8e27268cd04ed30b105..0000000000000000000000000000000000000000
--- a/RTCP/InputProc/test/tSharedMemory.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-#include <lofar_config.h>
-#include "SharedMemory.h"
-#include <Common/LofarLogger.h>
-#include <Common/Thread/Thread.h>
-#include <unistd.h>
-
-using namespace LOFAR;
-using namespace RTCP;
-
-Semaphore semaphore;
-
-class A {
-public:
-  void creator() {
-    sleep(1);
-
-    SharedMemoryArena m( 0x12345678, 1024, SharedMemoryArena::CREATE, 0 );
-
-    LOG_INFO("Memory area created");
-
-    // wait for done
-    semaphore.down();
-  }
-
-  void reader() {
-    LOG_INFO("Waiting for memory area");
-
-    SharedMemoryArena m( 0x12345678, 1024, SharedMemoryArena::READ, 2 );
-
-    LOG_INFO("Memory area attached");
-
-    // signal done
-    semaphore.up();
-  }
-};
-
-int main( int, char **argv ) {
-  INIT_LOGGER( argv[0] );
-
-  /* Create a shared memory region */
-  {
-    LOG_INFO("Create shared memory region");
-
-    SharedMemoryArena m( 0x12345678, 1024, SharedMemoryArena::CREATE, 0 );
-  }
-
-  /* Create a shared memory region and access it */
-  {
-    LOG_INFO("Create shared memory region and access it");
-
-    SharedMemoryArena x( 0x12345678, 1024, SharedMemoryArena::CREATE, 0 );
-
-    SharedMemoryArena y( 0x12345678, 1024, SharedMemoryArena::READ, 0 );
-  }
-
-  /* Access a non-existing shared memory region */
-  {
-    LOG_INFO("Access a non-existing shared memory region");
-
-    bool caught_exception = false;
-
-    try {
-      SharedMemoryArena y( 0x12345678, 1024, SharedMemoryArena::READ, 0 );
-    } catch(SystemCallException &e) {
-      caught_exception = true;
-    }
-
-    ASSERT(caught_exception);
-  }
-
-  /* Access a non-existing shared memory region, with timeout */
-  {
-    LOG_INFO("Access a non-existing shared memory region");
-
-    bool caught_exception = false;
-
-    try {
-      SharedMemoryArena y( 0x12345678, 1024, SharedMemoryArena::READ, 1 );
-    } catch(SharedMemoryArena::TimeOutException &e) {
-      caught_exception = true;
-    }
-
-    ASSERT(caught_exception);
-  }
-
-#ifdef USE_THREADS
-  LOG_INFO("Debugging concurrent access");
-
-  {
-    /* Start reader before creator */
-    A obj;
-
-    // delayed creation of memory region
-    Thread creator(&obj, &A::creator);
-
-    // wait for access
-    obj.reader();
-  }
-#endif
-
-  /* Check whether memory access works as expected */
-  {
-    LOG_INFO("Checking memory access through SharedStruct");
-
-    SharedStruct<int> writer( 0x12345678, true, 0 );
-
-    SharedStruct<int> reader( 0x12345678, false, 0 );
-
-    writer.get() = 42;
-    ASSERT( reader.get() == 42 );
-  }
-
-  return 0;
-}
diff --git a/RTCP/Interface/src/Stream.cc b/RTCP/Interface/src/Stream.cc
index 9936b773bd3c68b034b252059cf5e84b4eb8a795..07b9225e38801768765d0a0d4ad07c268b9b8524 100644
--- a/RTCP/Interface/src/Stream.cc
+++ b/RTCP/Interface/src/Stream.cc
@@ -57,14 +57,14 @@ Stream *createStream(const string &descriptor, bool asServer, time_t deadline)
   if (descriptor == "null:")
     return new NullStream;
   else if (split.size() == 3 && split[0] == "udp")
-    return new SocketStream(split[1].c_str(), boost::lexical_cast<unsigned short>(split[2]), SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, deadline);
+    return new SocketStream(split[1].c_str(), boost::lexical_cast<short>(split[2]), SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, deadline);
   else if (split.size() == 3 && split[0] == "tcp")
-    return new SocketStream(split[1].c_str(), boost::lexical_cast<unsigned short>(split[2]), SocketStream::TCP, asServer ? SocketStream::Server : SocketStream::Client, deadline);
+    return new SocketStream(split[1].c_str(), boost::lexical_cast<short>(split[2]), SocketStream::TCP, asServer ? SocketStream::Server : SocketStream::Client, deadline);
   else if (split.size() == 3 && split[0] == "udpkey")
     return new SocketStream(split[1].c_str(), 0, SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, deadline, split[2].c_str());
 #ifdef USE_THREADS    
   else if (split.size() == 4 && split[0] == "tcpbroker") 
-    return asServer ? static_cast<Stream*>(new PortBroker::ServerStream(split[3])) : static_cast<Stream*>(new PortBroker::ClientStream(split[1], boost::lexical_cast<unsigned short>(split[2]), split[3]));
+    return asServer ? static_cast<Stream*>(new PortBroker::ServerStream(split[3])) : static_cast<Stream*>(new PortBroker::ClientStream(split[1], boost::lexical_cast<short>(split[2]), split[3]));
 #endif    
   else if (split.size() == 3 && split[0] == "tcpkey")
 #if defined CLUSTER_SCHEDULING
@@ -77,7 +77,7 @@ Stream *createStream(const string &descriptor, bool asServer, time_t deadline)
   else if (split.size() == 2 && split[0] == "pipe")
     return new NamedPipeStream(split[1].c_str(), asServer);
   else if (split.size() == 2)
-    return new SocketStream(split[0].c_str(), boost::lexical_cast<unsigned short>(split[1]), SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, deadline);
+    return new SocketStream(split[0].c_str(), boost::lexical_cast<short>(split[1]), SocketStream::UDP, asServer ? SocketStream::Server : SocketStream::Client, deadline);
   else if (split.size() == 1)
     return asServer ? new FileStream(split[0].c_str()) : new FileStream(split[0].c_str(), 0666);
   else
diff --git a/RTCP/Run/src/OLAP.parset b/RTCP/Run/src/OLAP.parset
index e61e31865cefe93a69f54f92e1d50cdc43e91dfd..996e102fc7890bad24118b6923e61ecf1cec92db 100644
--- a/RTCP/Run/src/OLAP.parset
+++ b/RTCP/Run/src/OLAP.parset
@@ -7,122 +7,122 @@ OLAP.correctClocks = T
 # Fibre length corrections for core stations using
 # a single clock. 
 #
-PIC.Core.CS001LBA.clockCorrectionTime  = 4.755947e-06
-PIC.Core.CS001HBA0.clockCorrectionTime = 4.759754e-06
-PIC.Core.CS001HBA1.clockCorrectionTime = 4.759754e-06
-PIC.Core.CS001HBA.clockCorrectionTime  = 4.759754e-06
-
-PIC.Core.CS002LBA.clockCorrectionTime  = 8.32233e-06
+PIC.Core.CS002LBA.clockCorrectionTime  = 8.318569e-06
 PIC.Core.CS002HBA0.clockCorrectionTime = 8.318834e-06
 PIC.Core.CS002HBA1.clockCorrectionTime = 8.318304e-06
 PIC.Core.CS002HBA.clockCorrectionTime  = 8.318569e-06
 
-PIC.Core.CS003LBA.clockCorrectionTime  = 6.921444e-06
+PIC.Core.CS003LBA.clockCorrectionTime  = 6.917899e-06
 PIC.Core.CS003HBA0.clockCorrectionTime = 6.917926e-06
 PIC.Core.CS003HBA1.clockCorrectionTime = 6.917872e-06
 PIC.Core.CS003HBA.clockCorrectionTime  = 6.917899e-06
 
-PIC.Core.CS004LBA.clockCorrectionTime  = 7.884847e-06
+PIC.Core.CS004LBA.clockCorrectionTime  = 7.889733e-06
 PIC.Core.CS004HBA0.clockCorrectionTime = 7.889961e-06
 PIC.Core.CS004HBA1.clockCorrectionTime = 7.889505e-06
 PIC.Core.CS004HBA.clockCorrectionTime  = 7.889733e-06
 
-PIC.Core.CS005LBA.clockCorrectionTime  = 8.537828e-06
+PIC.Core.CS005LBA.clockCorrectionTime  = 8.541942e-06
 PIC.Core.CS005HBA0.clockCorrectionTime = 8.542093e-06
 PIC.Core.CS005HBA1.clockCorrectionTime = 8.541791e-06
 PIC.Core.CS005HBA.clockCorrectionTime  = 8.541942e-06
 
-PIC.Core.CS006LBA.clockCorrectionTime  = 7.880705e-06
-PIC.Core.CS006HBA0.clockCorrectionTime = 7.882892e-06
-PIC.Core.CS006HBA1.clockCorrectionTime = 7.883396e-06
-PIC.Core.CS006HBA.clockCorrectionTime  = 7.883150e-06
+PIC.Core.CS006LBA.clockCorrectionTime  = 7.882660e-06
+PIC.Core.CS006HBA0.clockCorrectionTime = 7.882360e-06
+PIC.Core.CS006HBA1.clockCorrectionTime = 7.882960e-06
+PIC.Core.CS006HBA.clockCorrectionTime  = 7.882660e-06
 
-PIC.Core.CS007LBA.clockCorrectionTime  = 7.916458e-06
+PIC.Core.CS007LBA.clockCorrectionTime  = 7.913140e-06 
 PIC.Core.CS007HBA0.clockCorrectionTime = 7.913020e-06
 PIC.Core.CS007HBA1.clockCorrectionTime = 7.913260e-06
 PIC.Core.CS007HBA.clockCorrectionTime  = 7.913140e-06 
 
-PIC.Core.CS011LBA.clockCorrectionTime  = 7.55500e-06
-PIC.Core.CS011HBA0.clockCorrectionTime = 7.55852e-06
-PIC.Core.CS011HBA1.clockCorrectionTime = 7.55852e-06
-PIC.Core.CS011HBA.clockCorrectionTime  = 7.55852e-06
+PIC.Core.CS001LBA.clockCorrectionTime  = 4.759754e-06
+PIC.Core.CS001HBA0.clockCorrectionTime = 4.759754e-06
+PIC.Core.CS001HBA1.clockCorrectionTime = 4.759754e-06
+PIC.Core.CS001HBA.clockCorrectionTime  = 4.759754e-06
+
+PIC.Core.CS011LBA.clockCorrectionTime  = 7.55795e-06
+PIC.Core.CS011HBA0.clockCorrectionTime = 7.55795e-06
+PIC.Core.CS011HBA1.clockCorrectionTime = 7.55795e-06
+PIC.Core.CS011HBA.clockCorrectionTime  = 7.55795e-06
 
 PIC.Core.CS013LBA.clockCorrectionTime  = 1.639118e-05
 PIC.Core.CS013HBA0.clockCorrectionTime = 1.639118e-05
 PIC.Core.CS013HBA1.clockCorrectionTime = 1.639118e-05
 PIC.Core.CS013HBA.clockCorrectionTime  = 1.639118e-05
 
-PIC.Core.CS017LBA.clockCorrectionTime  = 1.540812e-05
+PIC.Core.CS017LBA.clockCorrectionTime  = 1.541095e-05
 PIC.Core.CS017HBA0.clockCorrectionTime = 1.541095e-05
 PIC.Core.CS017HBA1.clockCorrectionTime = 1.541095e-05
 PIC.Core.CS017HBA.clockCorrectionTime  = 1.541095e-05
 
-PIC.Core.CS021LBA.clockCorrectionTime  = 6.044335e-06
+PIC.Core.CS021LBA.clockCorrectionTime  = 6.04963e-06
 PIC.Core.CS021HBA0.clockCorrectionTime = 6.04963e-06
 PIC.Core.CS021HBA1.clockCorrectionTime = 6.04963e-06
 PIC.Core.CS021HBA.clockCorrectionTime  = 6.04963e-06
 
-PIC.Core.CS024LBA.clockCorrectionTime  = 4.66335e-06
-PIC.Core.CS024HBA0.clockCorrectionTime = 4.65857e-06
-PIC.Core.CS024HBA1.clockCorrectionTime = 4.65857e-06
-PIC.Core.CS024HBA.clockCorrectionTime  = 4.65857e-06
+PIC.Core.CS024LBA.clockCorrectionTime  = 4.65818e-06
+PIC.Core.CS024HBA0.clockCorrectionTime = 4.65818e-06
+PIC.Core.CS024HBA1.clockCorrectionTime = 4.65818e-06
+PIC.Core.CS024HBA.clockCorrectionTime  = 4.65818e-06
 
-PIC.Core.CS026LBA.clockCorrectionTime  = 1.620482e-05
+PIC.Core.CS026LBA.clockCorrectionTime  = 1.619948e-05
 PIC.Core.CS026HBA0.clockCorrectionTime = 1.619948e-05
 PIC.Core.CS026HBA1.clockCorrectionTime = 1.619948e-05
 PIC.Core.CS026HBA.clockCorrectionTime  = 1.619948e-05
 
-PIC.Core.CS028LBA.clockCorrectionTime  = 1.6967048e-05
+PIC.Core.CS028LBA.clockCorrectionTime  = 1.6962571e-05
 PIC.Core.CS028HBA0.clockCorrectionTime = 1.6962571e-05
 PIC.Core.CS028HBA1.clockCorrectionTime = 1.6962571e-05
 PIC.Core.CS028HBA.clockCorrectionTime  = 1.6962571e-05
 
-PIC.Core.CS030LBA.clockCorrectionTime  = 9.7110576e-06
+PIC.Core.CS030LBA.clockCorrectionTime  = 9.7160576e-06
 PIC.Core.CS030HBA0.clockCorrectionTime = 9.7160576e-06
 PIC.Core.CS030HBA1.clockCorrectionTime = 9.7160576e-06
 PIC.Core.CS030HBA.clockCorrectionTime  = 9.7160576e-06
 
-PIC.Core.CS031LBA.clockCorrectionTime  = 6.375533e-06
+PIC.Core.CS031LBA.clockCorrectionTime  = 6.370090e-06
 PIC.Core.CS031HBA0.clockCorrectionTime = 6.370090e-06
 PIC.Core.CS031HBA1.clockCorrectionTime = 6.370090e-06
 PIC.Core.CS031HBA.clockCorrectionTime  = 6.370090e-06
 
-PIC.Core.CS032LBA.clockCorrectionTime  = 8.541675e-06
+PIC.Core.CS032LBA.clockCorrectionTime  = 8.546255e-06
 PIC.Core.CS032HBA0.clockCorrectionTime = 8.546255e-06
 PIC.Core.CS032HBA1.clockCorrectionTime = 8.546255e-06
 PIC.Core.CS032HBA.clockCorrectionTime  = 8.546255e-06
 
-PIC.Core.CS101LBA.clockCorrectionTime  = 1.5155471e-05
+PIC.Core.CS101LBA.clockCorrectionTime  = 1.5157971e-05
 PIC.Core.CS101HBA0.clockCorrectionTime = 1.5157971e-05
 PIC.Core.CS101HBA1.clockCorrectionTime = 1.5157971e-05
 PIC.Core.CS101HBA.clockCorrectionTime  = 1.5157971e-05
 
-PIC.Core.CS103LBA.clockCorrectionTime  = 3.5503206e-05
+PIC.Core.CS103LBA.clockCorrectionTime  = 3.5500922e-05
 PIC.Core.CS103HBA0.clockCorrectionTime = 3.5500922e-05
 PIC.Core.CS103HBA1.clockCorrectionTime = 3.5500922e-05
 PIC.Core.CS103HBA.clockCorrectionTime  = 3.5500922e-05
 
-PIC.Core.CS201LBA.clockCorrectionTime  = 1.745439e-05
+PIC.Core.CS201LBA.clockCorrectionTime  = 1.744924e-05
 PIC.Core.CS201HBA0.clockCorrectionTime = 1.744924e-05
 PIC.Core.CS201HBA1.clockCorrectionTime = 1.744924e-05
 PIC.Core.CS201HBA.clockCorrectionTime  = 1.744924e-05
 
-PIC.Core.CS301LBA.clockCorrectionTime  = 7.685249e-06
+PIC.Core.CS301LBA.clockCorrectionTime  = 7.690431e-06
 PIC.Core.CS301HBA0.clockCorrectionTime = 7.690431e-06
 PIC.Core.CS301HBA1.clockCorrectionTime = 7.690431e-06
 PIC.Core.CS301HBA.clockCorrectionTime  = 7.690431e-06
 
-PIC.Core.CS302LBA.clockCorrectionTime  = 1.2317004e-05
-PIC.Core.CS302HBA0.clockCorrectionTime = 1.2321604e-05
-PIC.Core.CS302HBA1.clockCorrectionTime = 1.2321604e-05
-PIC.Core.CS302HBA.clockCorrectionTime  = 1.2321604e-05
+PIC.Core.CS302LBA.clockCorrectionTime  = 1.5062785e-05
+PIC.Core.CS302HBA0.clockCorrectionTime = 1.5062785e-05
+PIC.Core.CS302HBA1.clockCorrectionTime = 1.5062785e-05
+PIC.Core.CS302HBA.clockCorrectionTime  = 1.5062785e-05
 
-PIC.Core.CS401LBA.clockCorrectionTime  = 8.052200e-06
+PIC.Core.CS401LBA.clockCorrectionTime  = 8.051870e-06
 PIC.Core.CS401HBA0.clockCorrectionTime = 8.057504e-06
 PIC.Core.CS401HBA1.clockCorrectionTime = 8.057770e-06
 PIC.Core.CS401HBA.clockCorrectionTime  = 8.057637e-06
 
-PIC.Core.CS501LBA.clockCorrectionTime  = 1.65797e-05
+PIC.Core.CS501LBA.clockCorrectionTime  = 1.65842e-05
 PIC.Core.CS501HBA0.clockCorrectionTime = 1.65842e-05
 PIC.Core.CS501HBA1.clockCorrectionTime = 1.65842e-05
 PIC.Core.CS501HBA.clockCorrectionTime  = 1.65842e-05
@@ -351,12 +351,6 @@ PIC.Core.RS307HBA.phaseCenter = [3837964.520, 449627.261, 5057357.585]
 PIC.Core.RS406LBA.phaseCenter = [3818467.634, 451974.601, 5071790.597]
 PIC.Core.RS406HBA.phaseCenter = [3818424.939, 452020.269, 5071817.644]
 
-PIC.Core.RS407LBA.phaseCenter = [3811595.861, 453444.681, 5076770.429]
-PIC.Core.RS407HBA.phaseCenter = [3811649.455, 453459.894, 5076728.952]
-
-PIC.Core.RS409LBA.phaseCenter = [3824755.853, 426178.847, 5069289.868]
-PIC.Core.RS409HBA.phaseCenter = [3824812.621, 426130.330, 5069251.754]
-
 PIC.Core.RS503LBA.phaseCenter = [3824090.452, 459438.282, 5066898.190]
 PIC.Core.RS503HBA.phaseCenter = [3824138.566, 459476.972, 5066858.578]
 
diff --git a/RTCP/Run/src/locations.sh.in b/RTCP/Run/src/locations.sh.in
index 12f8bf44944e8c9275e3c6b619200dd617d68bab..5d7d8c9ec54b1bb3b3178e282f131f6813f03f79 100644
--- a/RTCP/Run/src/locations.sh.in
+++ b/RTCP/Run/src/locations.sh.in
@@ -61,7 +61,7 @@ OLAP.Storage.HBADeltasDir = $STORAGE_HOME/production/lofar/etc/StaticMetaData
 OLAP.FinalMetaDataGatherer.host = lhn001
 OLAP.FinalMetaDataGatherer.userName = lofarsys
 OLAP.FinalMetaDataGatherer.sshIdentityFile = /root/.ssh/id_rsa.lofarsys
-OLAP.FinalMetaDataGatherer.executable = LD_LIBRARY_PATH= $FINALMETADATAGATHERER
+OLAP.FinalMetaDataGatherer.executable = $FINALMETADATAGATHERER
 
 OLAP.FinalMetaDataGatherer.database.host = $OTDB_HOST
 
diff --git a/RTCP/Run/src/multitail-olap.conf b/RTCP/Run/src/multitail-olap.conf
index d1d59a78339a1ff361d1b51bf31b688b7444c19a..6681df3d1945efdacca3021626515750a2f5e7be 100644
--- a/RTCP/Run/src/multitail-olap.conf
+++ b/RTCP/Run/src/multitail-olap.conf
@@ -12,9 +12,6 @@ mcsre:red:.* Signal:.*$
 mcsre:red:ERROR|FATAL|EXCEPTION|(Un)?[Cc]aught.*|Assertion.*failed.$
 mcsre:yellow:WARN
 
-# startBGL python error messages
-mcsre:red:^[A-Za-z.]+Error:
-
 # ----- messages by 'tail' (used by multitail)
 # examples:
 # tail: `/globalhome/lofarsystem/log/latest/run.CNProc.log' has appeared;  following end of new file
@@ -45,7 +42,7 @@ mcsre_s:green:(\[obs [^[]+\])
 
 # ----- define filters and rewrite rules to show only errors
 filterscheme:errors:Only show severe errors
-rule:em:ERROR|FATAL.*[Cc]aught|EXCEPTION|BE_MPI|FATAL \w+Error:|^mpirun noticed.*exited on signal|Assertion.*failed.$| Signal: |^MPI_.*|^Abort\(1\).*|^\[bgfen.* mca_oob_tcp_msg_recv:.*|Assertion `.*' failed.|^[A-Za-z.]+Error:
+rule:em:ERROR|FATAL.*[Cc]aught|EXCEPTION|BE_MPI|FATAL \w+Error:|^mpirun noticed.*exited on signal|Assertion.*failed.$| Signal: |^MPI_.*|^Abort\(1\).*|^\[bgfen.* mca_oob_tcp_msg_recv:.*|Assertion `.*' failed.
 
 filterscheme:flags:Only show >0% flagging
 rule:em:flags.*\([0-9.]{2,5}%\)
diff --git a/RTCP/Run/src/watchlogs.sh b/RTCP/Run/src/watchlogs.sh
index 458ffb305bf8ef32455de890b855f3f966158e29..37705ac27425500b551fa0cc5fbe64cdd4f66e56 100755
--- a/RTCP/Run/src/watchlogs.sh
+++ b/RTCP/Run/src/watchlogs.sh
@@ -21,6 +21,7 @@ then
   done 
 fi
 
+
 multitail --no-mark-change --follow-all --retry-all -m 10240 --basename -F $ETCDIR/multitail-olap.conf \
   $FLAGS -t "-- FLAGS --"  -fr flags -ks flags -i $IONPROC_LOG \
   $FLAGS -t "-- ERRORS --" -fr errors          -i $IONPROC_LOG \
diff --git a/RTCP/Storage/src/MSWriterCorrelated.cc b/RTCP/Storage/src/MSWriterCorrelated.cc
index f1809278a0bc914862421e09632b9169aec5aac5..ac774e676cdfe0ef631ecd5c7019ba9a0391f983 100644
--- a/RTCP/Storage/src/MSWriterCorrelated.cc
+++ b/RTCP/Storage/src/MSWriterCorrelated.cc
@@ -129,18 +129,11 @@ void MSWriterCorrelated::write(StreamableData *data)
 
   // Write sequence number
   if (itsSequenceNumbersFile != 0) {
-    // quick fix: always write to maintain integrity
-    unsigned seqnr = data->sequenceNumber(true);
-
-    itsSequenceNumbersFile->write(&seqnr, sizeof seqnr);
-
-#if 0
     // write the sequencenumber in correlator endianness, no byteswapping
     itsSequenceNumbers.push_back(data->sequenceNumber(true));
-   
+    
     if (itsSequenceNumbers.size() > 64)
       flushSequenceNumbers();
-#endif
   }
 
   itsNrBlocksWritten++;
diff --git a/RTCP/Storage/src/Storage_main.cc b/RTCP/Storage/src/Storage_main.cc
index 911d225c362cfc3e014230f60bdb8c74289f2923..06d0a903e7dee9963b0de3d9e32a6e278cf1cc6c 100644
--- a/RTCP/Storage/src/Storage_main.cc
+++ b/RTCP/Storage/src/Storage_main.cc
@@ -23,6 +23,7 @@
 #include <Stream/PortBroker.h>
 #include <Storage/SubbandWriter.h>
 #include <Storage/IOPriority.h>
+#include <Storage/ExitOnClosedStdin.h>
 #include <Storage/Package__Version.h>
 
 #if defined HAVE_MPI
@@ -78,6 +79,7 @@ int main(int argc, char *argv[])
     if (argc != 4)
       throw StorageException(str(boost::format("usage: %s obsid rank is_bigendian") % argv[0]), THROW_ARGS);
 
+    ExitOnClosedStdin			  stdinWatcher;
     setvbuf(stdout, stdoutbuf, _IOLBF, sizeof stdoutbuf);
     setvbuf(stderr, stderrbuf, _IOLBF, sizeof stderrbuf);
 
diff --git a/RTCP/Storage/test/tMSWriterCorrelated.stdout b/RTCP/Storage/test/tMSWriterCorrelated.stdout
index 4672275cebf5911a3ceca25466791550a1a785b0..77c9cda00e77af10d6d3fa38233df2dfca3a8b7f 100644
--- a/RTCP/Storage/test/tMSWriterCorrelated.stdout
+++ b/RTCP/Storage/test/tMSWriterCorrelated.stdout
@@ -1,5 +1,5 @@
     select result of 1 rows
 1 selected columns:  Col_1
 Axis Lengths: [1, 96]  (NB: Matrix in Row/Column order)
-[0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
+[0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
 
diff --git a/SAS/OTB/OTB/dist-src/startClientOTB b/SAS/OTB/OTB/dist-src/startClientOTB
index 6ac8b87441cb53c0ae17e2ba8e06dd3a70b69b60..f4a6392c972e5913b271d19d6a139108437879e5 100755
--- a/SAS/OTB/OTB/dist-src/startClientOTB
+++ b/SAS/OTB/OTB/dist-src/startClientOTB
@@ -1,22 +1,13 @@
 #!/bin/sh
 
-# Check if portnumber is added to commandline; if yes, use it.
-if [ -z $1 ]; then
-  port1=12500
-else
-  port1=$1
-fi
-echo "Using port $port1 for this client"
-
 export OTB_DIR=/opt/sas/otb/client
 export JAVA_HOME=/usr/java/jdk1.7.0_02
 
 echo
 echo --- Starting OTB Client ---
 
-otbfile=`ls $OTB_DIR/OTB*.jar | grep -v javadoc | grep -v sources`
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTB_DIR
-export OTB_APP=$OTB_DIR/`basename $otbfile`
+export OTB_APP=$OTB_DIR/`basename $OTB_DIR/OTB*.jar`
 export CLASSPATH=$OTB_APP
 
 for JAR_DEPENDENCY in $OTB_DIR/lib/*.jar
@@ -26,9 +17,4 @@ do
 done
 
 echo Starting up ...
-curdate=`date +%Y%m%dT%H%M%S`
-logfile="/localhome/log/OTBClient_${port1}_${curdate}.log"
-echo "Logging client logs to file $logfile"
-$JAVA_HOME/bin/java -cp $CLASSPATH nl.astron.lofar.sas.otb.Main -s sas001 -p $port1 -d LOFAR_4 -u busyman 2>&1 1>$logfile &
-clientpid=$!
-echo Started OTB client with PID: $clientpid
+$JAVA_HOME/bin/java -cp $CLASSPATH nl.astron.lofar.sas.otb.Main -s sas001 -p 12500 -d LOFAR_4 -u busyman
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/Main.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/Main.java
index acabf1aa000153d94f8ddfd3f3684c09e721f962..6ac2428fa51b69552271284520bbd6091b724255 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/Main.java
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/Main.java
@@ -132,7 +132,7 @@ public class Main {
             if (f.exists()) {
                 PropertyConfigurator.configure(logConfig);
             } else {
-                logConfig = File.separator+"opt"+File.separator+"sas"+File.separator+"otb"+File.separator+"etc"+File.separator+logConfig;
+                logConfig = File.separator+"opt"+File.separator+"sas"+File.separator+logConfig;
                 f = new File(logConfig);
                 if (f.exists()) {
                     PropertyConfigurator.configure(logConfig);
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/objects/Beam.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/objects/Beam.java
index 0f94989641516003b1d7084fb7a271063cf22f3e..34e73be9933788ba7b8b6cfd3c0c09ca0a11f081 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/objects/Beam.java
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/objects/Beam.java
@@ -5,6 +5,8 @@
 package nl.astron.lofar.sas.otb.objects;
 
 import java.util.ArrayList;
+import java.util.BitSet;
+import nl.astron.lofar.lofarutils.LofarUtils;
 import nl.astron.lofar.sas.otb.util.IBeam;
 
 /**
@@ -35,6 +37,14 @@ public class Beam implements IBeam {
         this.itsAngle2 = anAngle2;
     }
 
+    public String getBeamletList() {
+        return itsBeamletList;
+    }
+
+    public void setBeamletList(String aBeamletList) {
+        this.itsBeamletList = aBeamletList;
+    }
+
     public String getDirectionType() {
         return itsDirectionType;
     }
@@ -134,6 +144,9 @@ public class Beam implements IBeam {
         this.itsDirectionTypeChoices = directionTypeChoices;
     }
     
+    public BitSet getBeamletBitSet() {
+        return LofarUtils.beamletToBitSet(LofarUtils.expandedArrayString(itsBeamletList));
+    }
     
     public String getTreeType() {
         return itsTreeType;
@@ -157,6 +170,7 @@ public class Beam implements IBeam {
         clone.itsStartTime = itsStartTime;
         clone.itsDuration = itsDuration;
         clone.itsSubbandList = itsSubbandList;
+        clone.itsBeamletList = itsBeamletList;
         clone.itsMomID = itsMomID;
         clone.itsNrTiedArrayBeams = itsNrTiedArrayBeams;     // 
         clone.itsNrTabRings = itsNrTabRings;
@@ -182,6 +196,7 @@ public class Beam implements IBeam {
     private String                   itsStartTime;
     private String                   itsDuration;
     private String                   itsSubbandList;
+    private String                   itsBeamletList;
     private String                   itsMomID;
     private String                   itsNrTiedArrayBeams="1";     // 
     private String                   itsNrTabRings;
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.form
index e56c37918ecd9b3ad4c7a530103c3d29e83019fa..d46ba8550624ef751927142c2842bbcc6f0e61c7 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.form
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.form
@@ -10,7 +10,7 @@
     <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
     <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
     <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
-    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-37,0,0,3,116"/>
+    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-37,0,0,2,84"/>
   </AuxValues>
 
   <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.java
index 9cacee43595bf88042c8e0a7e4f15c52687ee612..d105bc665b4c8f20f873b898ffa99d33a003833a 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.java
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/panels/MainPanel.java
@@ -20,8 +20,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
-package nl.astron.lofar.sas.otb.panels;
 
+package nl.astron.lofar.sas.otb.panels;
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -62,8 +62,8 @@ import org.apache.log4j.Logger;
  * @version $Id$
  * @updated deleteComponentNode added to component panel
  */
-public class MainPanel extends javax.swing.JPanel
-        implements IPluginPanel {
+public class MainPanel extends javax.swing.JPanel 
+                       implements IPluginPanel {
 
     static Logger logger = Logger.getLogger(MainPanel.class);
     static String name = "Home";
@@ -73,7 +73,8 @@ public class MainPanel extends javax.swing.JPanel
         initComponents();
         initializeButtons();
     }
-
+    
+           
     /** 
      * Initializes the buttonpanel. Every tab has different buttons 
      */
@@ -82,114 +83,111 @@ public class MainPanel extends javax.swing.JPanel
         switch (itsTabFocus) {
             case "PIC":
                 buttonPanel1.addButton("State History");
-                buttonPanel1.setButtonIcon("State History", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_info.gif")));
+                buttonPanel1.setButtonIcon("State History",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_info.gif")));
                 buttonPanel1.addButton("Query Panel");
-                buttonPanel1.setButtonIcon("Query Panel", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_help.png")));
+                buttonPanel1.setButtonIcon("Query Panel",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_help.png")));
                 buttonPanel1.addButton("New");
-                buttonPanel1.setButtonIcon("New", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_new.png")));
+                buttonPanel1.setButtonIcon("New",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_new.png")));
                 buttonPanel1.addButton("Delete");
-                buttonPanel1.setButtonIcon("Delete", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
+                buttonPanel1.setButtonIcon("Delete",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
                 buttonPanel1.addButton("Refresh");
-                buttonPanel1.setButtonIcon("Refresh", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
+                buttonPanel1.setButtonIcon("Refresh",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
                 buttonPanel1.addButton("View");
-                buttonPanel1.setButtonIcon("View", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
+                buttonPanel1.setButtonIcon("View",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
                 buttonPanel1.addButton("Info");
-                buttonPanel1.setButtonIcon("Info", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_fileopen.gif")));
-                buttonPanel1.setButtonEnabled("Delete", false);
-                buttonPanel1.setButtonEnabled("View", false);
-                buttonPanel1.setButtonEnabled("Info", false);
-                buttonPanel1.setButtonEnabled("State History", false);
+                buttonPanel1.setButtonIcon("Info",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_fileopen.gif")));
+                buttonPanel1.setButtonEnabled("Delete",false);
+                buttonPanel1.setButtonEnabled("View",false);
+                buttonPanel1.setButtonEnabled("Info",false);
+                buttonPanel1.setButtonEnabled("State History",false);
                 break;
             case "VIC":
                 buttonPanel1.addButton("State History");
-                buttonPanel1.setButtonIcon("State History", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_info.gif")));
+                buttonPanel1.setButtonIcon("State History",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_info.gif")));
                 buttonPanel1.addButton("Query Panel");
-                buttonPanel1.setButtonIcon("Query Panel", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_help.png")));
+                buttonPanel1.setButtonIcon("Query Panel",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_help.png")));
                 buttonPanel1.addButton("Delete");
-                buttonPanel1.setButtonIcon("Delete", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
+                buttonPanel1.setButtonIcon("Delete",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
                 buttonPanel1.addButton("Refresh");
-                buttonPanel1.setButtonIcon("Refresh", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
+                buttonPanel1.setButtonIcon("Refresh",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
                 buttonPanel1.addButton("View");
-                buttonPanel1.setButtonIcon("View", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
+                buttonPanel1.setButtonIcon("View",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
                 buttonPanel1.addButton("Schedule");
-                buttonPanel1.setButtonIcon("Schedule", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_fileopen.gif")));
-                buttonPanel1.setButtonEnabled("State History", false);
-                buttonPanel1.setButtonEnabled("Delete", false);
-                buttonPanel1.setButtonEnabled("View", false);
-                buttonPanel1.setButtonEnabled("Schedule", false);
+                buttonPanel1.setButtonIcon("Schedule",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_fileopen.gif")));
+                buttonPanel1.setButtonEnabled("State History",false);
+                buttonPanel1.setButtonEnabled("Delete",false);
+                buttonPanel1.setButtonEnabled("View",false);
+                buttonPanel1.setButtonEnabled("Schedule",false);
                 break;
             case "Templates":
                 buttonPanel1.addButton("State History");
-                buttonPanel1.setButtonIcon("State History", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_info.gif")));
+                buttonPanel1.setButtonIcon("State History",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_info.gif")));
                 buttonPanel1.addButton("Query Panel");
-                buttonPanel1.setButtonIcon("Query Panel", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_help.png")));
+                buttonPanel1.setButtonIcon("Query Panel",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_help.png")));
                 buttonPanel1.addButton("Duplicate");
-                buttonPanel1.setButtonIcon("Duplicate", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_copy.png")));
+                buttonPanel1.setButtonIcon("Duplicate",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_copy.png")));
                 buttonPanel1.addButton("Modify");
-                buttonPanel1.setButtonIcon("Modify", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
+                buttonPanel1.setButtonIcon("Modify",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
                 buttonPanel1.addButton("Delete");
-                buttonPanel1.setButtonIcon("Delete", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
+                buttonPanel1.setButtonIcon("Delete",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
                 buttonPanel1.addButton("Refresh");
-                buttonPanel1.setButtonIcon("Refresh", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
+                buttonPanel1.setButtonIcon("Refresh",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
                 buttonPanel1.addButton("Build VIC tree");
-                buttonPanel1.setButtonIcon("Build VIC tree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_new.png")));
+                buttonPanel1.setButtonIcon("Build VIC tree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_new.png")));
                 buttonPanel1.addButton("Change Status");
-                buttonPanel1.setButtonIcon("Change Status", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_fileopen.gif")));
+                buttonPanel1.setButtonIcon("Change Status",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_fileopen.gif")));
                 buttonPanel1.addButton("MultiEdit");
-                buttonPanel1.setButtonIcon("MultiEdit", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
+                buttonPanel1.setButtonIcon("MultiEdit",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif" )));
                 buttonPanel1.addButton("Set to Default");
-                buttonPanel1.setButtonIcon("Set to Default", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_redo.png")));
-                buttonPanel1.setButtonEnabled("Duplicate", false);
-                buttonPanel1.setButtonEnabled("Modify", false);
-                buttonPanel1.setButtonEnabled("Delete", false);
-                buttonPanel1.setButtonEnabled("Build VIC tree", false);
-                buttonPanel1.setButtonEnabled("Change Status", false);
-                buttonPanel1.setButtonEnabled("MultiEdit", false);
-                buttonPanel1.setButtonEnabled("Set to Default", false);
-                buttonPanel1.setButtonEnabled("State History", false);
+                buttonPanel1.setButtonIcon("Set to Default",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_redo.png")));
+                buttonPanel1.setButtonEnabled("Duplicate",false);
+                buttonPanel1.setButtonEnabled("Modify",false);
+                buttonPanel1.setButtonEnabled("Delete",false);
+                buttonPanel1.setButtonEnabled("Build VIC tree",false);
+                buttonPanel1.setButtonEnabled("Change Status",false);
+                buttonPanel1.setButtonEnabled("MultiEdit",false);
+                buttonPanel1.setButtonEnabled("Set to Default",false);
+                buttonPanel1.setButtonEnabled("State History",false);
                 break;
             case "Default Templates":
                 buttonPanel1.addButton("State History");
-                buttonPanel1.setButtonIcon("State History", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_info.gif")));
+                buttonPanel1.setButtonIcon("State History",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_info.gif")));
                 buttonPanel1.addButton("Duplicate");
-                buttonPanel1.setButtonIcon("Duplicate", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_copy.png")));
+                buttonPanel1.setButtonIcon("Duplicate",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_copy.png")));
                 buttonPanel1.addButton("Modify");
-                buttonPanel1.setButtonIcon("Modify", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
+                buttonPanel1.setButtonIcon("Modify",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
                 buttonPanel1.addButton("Refresh");
-                buttonPanel1.setButtonIcon("Refresh", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
-                buttonPanel1.addButton("Remove from Default");
-                buttonPanel1.setButtonIcon("Remove from Default", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
+                buttonPanel1.setButtonIcon("Refresh",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
                 buttonPanel1.addButton("Change Status");
-                buttonPanel1.setButtonIcon("Change Status", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_fileopen.gif")));
-                buttonPanel1.setButtonEnabled("Modify", false);
-                buttonPanel1.setButtonEnabled("Duplicate", false);
-                buttonPanel1.setButtonEnabled("Remove from Default", false);
-                buttonPanel1.setButtonEnabled("Change Status", false);
-                buttonPanel1.setButtonEnabled("State History", false);
+                buttonPanel1.setButtonIcon("Change Status",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_fileopen.gif")));
+                buttonPanel1.setButtonEnabled("Modify",false);
+                buttonPanel1.setButtonEnabled("Duplicate",false);
+                buttonPanel1.setButtonEnabled("Change Status",false);
+                buttonPanel1.setButtonEnabled("State History",false);
                 break;
             case "Components":
                 buttonPanel1.addButton("Query Panel");
-                buttonPanel1.setButtonIcon("Query Panel", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_help.png")));
+                buttonPanel1.setButtonIcon("Query Panel",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_help.png")));
                 buttonPanel1.addButton("New");
-                buttonPanel1.setButtonIcon("New", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_new.png")));
+                buttonPanel1.setButtonIcon("New",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_new.png")));
                 buttonPanel1.addButton("Modify");
-                buttonPanel1.setButtonIcon("Modify", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
+                buttonPanel1.setButtonIcon("Modify",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_edit.gif")));
                 buttonPanel1.addButton("Delete");
-                buttonPanel1.setButtonIcon("Delete", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
+                buttonPanel1.setButtonIcon("Delete",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_delete.png")));
                 buttonPanel1.addButton("Refresh");
-                buttonPanel1.setButtonIcon("Refresh", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
+                buttonPanel1.setButtonIcon("Refresh",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_refresh_e.gif")));
                 buttonPanel1.addButton("Build TemplateTree");
-                buttonPanel1.setButtonIcon("Build TemplateTree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_redo.png")));
+                buttonPanel1.setButtonIcon("Build TemplateTree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_redo.png")));
                 //            buttonPanel1.setButtonEnabled("Delete",false);
-                buttonPanel1.setButtonEnabled("Modify", false);
-                buttonPanel1.setButtonEnabled("Build TemplateTree", false);
+                buttonPanel1.setButtonEnabled("Modify",false);
+                buttonPanel1.setButtonEnabled("Build TemplateTree",false);
                 break;
             case "Query Results":
                 break;
         }
         buttonPanel1.addButton("Quit");
-        buttonPanel1.setButtonIcon("Quit", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_exit2.png")));
-        buttonsInitialized = true;
+        buttonPanel1.setButtonIcon("Quit",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_exit2.png")));
+        buttonsInitialized=true;
     }
 
     /** 
@@ -201,25 +199,25 @@ public class MainPanel extends javax.swing.JPanel
      */
     public boolean initializePlugin(MainFrame mainframe) {
         itsMainFrame = mainframe;
-
+        
         // check access
         UserAccount userAccount = itsMainFrame.getUserAccount();
-        if (userAccount.isAdministrator()) {
+        if(userAccount.isAdministrator()) {
             // enable/disable certain controls
         }
-        if (userAccount.isAstronomer()) {
+        if(userAccount.isAstronomer()) {
             // enable/disable certain controls
         }
-        if (userAccount.isInstrumentScientist()) {
+        if(userAccount.isInstrumentScientist()) {
             // enable/disable certain controls
         }
-
+        
         initializeTabs();
-
+        
         return true;
-
+        
     }
-
+    
     /** 
      * Initializes the tab-panels. Each tab has a specific table model that
      * contains the data for the table in the tab
@@ -228,45 +226,45 @@ public class MainPanel extends javax.swing.JPanel
         PICtableModel PICmodel = new PICtableModel(SharedVars.getOTDBrmi());
         PICPanel.setTableModel(PICmodel);
         PICPanel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-        PICPanel.setColumnSize("ID", 35);
-        PICPanel.setColumnSize("Description", 700);
+        PICPanel.setColumnSize("ID",35);
+        PICPanel.setColumnSize("Description",700);
         PICPanel.setAutoCreateRowSorter(true);
         PICPanel.setTableCellAlignment(JLabel.LEFT);
-
+        
 
         VICtableModel VICmodel = new VICtableModel(SharedVars.getOTDBrmi());
         VICPanel.setTableModel(VICmodel);
         VICPanel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-        VICPanel.setColumnSize("ID", 40);
+        VICPanel.setColumnSize("ID",40);
         VICPanel.setColumnSize("PType", 60);
         VICPanel.setColumnSize("PStype", 60);
         VICPanel.setColumnSize("Strat", 60);
-        VICPanel.setColumnSize("StartTime", 150);
-        VICPanel.setColumnSize("StopTime", 150);
-        VICPanel.setColumnSize("Description", 300);
+        VICPanel.setColumnSize("StartTime",150);
+        VICPanel.setColumnSize("StopTime",150);
+        VICPanel.setColumnSize("Description",300);
         VICPanel.setAutoCreateRowSorter(true);
         VICPanel.setTableCellAlignment(JLabel.LEFT);
-
+        
         TemplatetableModel Templatemodel = new TemplatetableModel(SharedVars.getOTDBrmi());
         TemplatesPanel.setTableModel(Templatemodel);
         TemplatesPanel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-        TemplatesPanel.setColumnSize("ID", 40);
+        TemplatesPanel.setColumnSize("ID",40);
         TemplatesPanel.setColumnSize("PType", 60);
         TemplatesPanel.setColumnSize("PStype", 60);
         TemplatesPanel.setColumnSize("Strat", 60);
-        TemplatesPanel.setColumnSize("Description", 300);
+        TemplatesPanel.setColumnSize("Description",300);
         TemplatesPanel.setAutoCreateRowSorter(true);
         TemplatesPanel.setTableCellAlignment(JLabel.LEFT);
 
         DefaultTemplatetableModel DefaultTemplatemodel = new DefaultTemplatetableModel(SharedVars.getOTDBrmi());
         DefaultTemplatesPanel.setTableModel(DefaultTemplatemodel);
-        DefaultTemplatesPanel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-        DefaultTemplatesPanel.setColumnSize("ID", 40);
-        DefaultTemplatesPanel.setColumnSize("Name", 150);
+        DefaultTemplatesPanel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        DefaultTemplatesPanel.setColumnSize("ID",40);
+        DefaultTemplatesPanel.setColumnSize("Name",150);
         DefaultTemplatesPanel.setColumnSize("PType", 60);
         DefaultTemplatesPanel.setColumnSize("PStype", 60);
         DefaultTemplatesPanel.setColumnSize("Strat", 60);
-        DefaultTemplatesPanel.setColumnSize("Description", 300);
+        DefaultTemplatesPanel.setColumnSize("Description",300);
         DefaultTemplatesPanel.setAutoCreateRowSorter(true);
         DefaultTemplatesPanel.setTableCellAlignment(JLabel.LEFT);
 
@@ -274,14 +272,14 @@ public class MainPanel extends javax.swing.JPanel
         ComponentTableModel Componentmodel = new ComponentTableModel(SharedVars.getOTDBrmi());
         ComponentsPanel.setTableModel(Componentmodel);
         ComponentsPanel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-        ComponentsPanel.setColumnSize("ID", 50);
-        ComponentsPanel.setColumnSize("Description", 685);
+        ComponentsPanel.setColumnSize("ID",50);
+        ComponentsPanel.setColumnSize("Description",685);
         ComponentsPanel.setAutoCreateRowSorter(true);
         ComponentsPanel.setTableCellAlignment(JLabel.LEFT);
-
+        
         //TODO: do the same for the other tabs
     }
-
+    
     /** 
      * Returns the human-readable name of this panel
      *
@@ -290,15 +288,16 @@ public class MainPanel extends javax.swing.JPanel
     public String getFriendlyName() {
         return getFriendlyNameStatic();
     }
-
+    
     public boolean hasChanged() {
         return changed;
     }
-
+    
     public void setChanged(boolean flag) {
         changed = flag;
     }
 
+
     public void checkChanged() {
         if (inputFieldBuilder.currentInputField != null) {
             inputFieldBuilder.currentInputField.checkPopup();
@@ -306,31 +305,31 @@ public class MainPanel extends javax.swing.JPanel
         logger.debug("Check Changed status");
         if (this.hasChanged()) {
             // keep selected tree
-            int aSavedID = itsMainFrame.getSharedVars().getTreeID();
+            int aSavedID=itsMainFrame.getSharedVars().getTreeID();
             itsMainFrame.setHourglassCursor();
             switch (itsTabFocus) {
                 case "PIC":
-                    if (!((PICtableModel) PICPanel.getTableModel()).fillTable()) {
+                    if (!((PICtableModel)PICPanel.getTableModel()).fillTable()) {
                         logger.error("error filling PICtable");
                     }
                     break;
                 case "VIC":
-                    if (!((VICtableModel) VICPanel.getTableModel()).fillTable()) {
+                    if (!((VICtableModel)VICPanel.getTableModel()).fillTable()) {
                         logger.error("error filling VICtable");
                     }
                     break;
                 case "Templates":
-                    if (!((TemplatetableModel) TemplatesPanel.getTableModel()).fillTable()) {
+                    if (!((TemplatetableModel)TemplatesPanel.getTableModel()).fillTable()) {
                         logger.error("error filling templateTable");
                     }
                     break;
                 case "Default Templates":
-                    if (!((DefaultTemplatetableModel) DefaultTemplatesPanel.getTableModel()).fillTable()) {
+                    if (!((DefaultTemplatetableModel)DefaultTemplatesPanel.getTableModel()).fillTable()) {
                         logger.error("error filling Default templateTable");
                     }
                     break;
                 case "Components":
-                    if (!((ComponentTableModel) ComponentsPanel.getTableModel()).fillTable()) {
+                    if (!((ComponentTableModel)ComponentsPanel.getTableModel()).fillTable()) {
                         logger.error("error filling ComponentsTable");
                     }
                     break;
@@ -338,14 +337,14 @@ public class MainPanel extends javax.swing.JPanel
             if (aSavedID > 0) {
                 itsMainFrame.getSharedVars().setTreeID(aSavedID);
                 this.setSelectedID(aSavedID);
-            }
+            }   
             this.setChanged(false);
             this.validate();
             this.validateButtons();
             itsMainFrame.setNormalCursor();
-        }
+        } 
     }
-
+    
     /** 
      * Static method that returns the human-readable name of this panel
      *
@@ -354,7 +353,7 @@ public class MainPanel extends javax.swing.JPanel
     public static String getFriendlyNameStatic() {
         return name;
     }
-
+    
     /** This method is called from within the constructor to
      * initialize the form.
      * WARNING: Do NOT modify this code. The content of this method is
@@ -445,14 +444,15 @@ public class MainPanel extends javax.swing.JPanel
     }//GEN-LAST:event_jTabbedPane1PropertyChange
 
     private void QueryResultsPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_QueryResultsPanelMouseClicked
-        if (evt.getClickCount() == 1) {
+        if(evt.getClickCount() == 1) {
             validateButtons();
         } else {
+
         }
     }//GEN-LAST:event_QueryResultsPanelMouseClicked
 
     private void ComponentsPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ComponentsPanelMouseClicked
-        if (evt.getClickCount() == 1) {
+        if(evt.getClickCount() == 1) {
             validateButtons();
         } else {
             if (buttonPanel1.isButtonEnabled("Modify") && buttonPanel1.isButtonVisible("Modify")) {
@@ -462,7 +462,7 @@ public class MainPanel extends javax.swing.JPanel
     }//GEN-LAST:event_ComponentsPanelMouseClicked
 
     private void TemplatesPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_TemplatesPanelMouseClicked
-        if (evt.getClickCount() == 1) {
+        if(evt.getClickCount() == 1) {
             validateButtons();
         } else {
             if (buttonPanel1.isButtonEnabled("Modify") && buttonPanel1.isButtonVisible("Modify")) {
@@ -472,7 +472,7 @@ public class MainPanel extends javax.swing.JPanel
     }//GEN-LAST:event_TemplatesPanelMouseClicked
 
     private void VICPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_VICPanelMouseClicked
-        if (evt.getClickCount() == 1) {
+        if(evt.getClickCount() == 1) {
             validateButtons();
         } else {
             if (buttonPanel1.isButtonEnabled("View") && buttonPanel1.isButtonVisible("View")) {
@@ -482,7 +482,7 @@ public class MainPanel extends javax.swing.JPanel
     }//GEN-LAST:event_VICPanelMouseClicked
 
     private void PICPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_PICPanelMouseClicked
-        if (evt.getClickCount() == 1) {
+        if(evt.getClickCount() == 1) {
             validateButtons();
         } else {
             if (buttonPanel1.isButtonEnabled("View") && buttonPanel1.isButtonVisible("View")) {
@@ -493,19 +493,19 @@ public class MainPanel extends javax.swing.JPanel
 
     private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
         if (!itsTabFocus.equals(jTabbedPane1.getTitleAt(jTabbedPane1.getSelectedIndex()))) {
-            itsTabFocus = jTabbedPane1.getTitleAt(jTabbedPane1.getSelectedIndex());
+            itsTabFocus=jTabbedPane1.getTitleAt(jTabbedPane1.getSelectedIndex());
             // force reload
-            logger.debug("Tab changed, force reload: " + itsTabFocus);
+            logger.debug("Tab changed, force reload: "+ itsTabFocus);
             this.setChanged(true);
         }
-        if (buttonsInitialized) {
+        if (buttonsInitialized) {        
             initializeButtons();
             validateButtons();
-            // Force a refresh since MoM/scheduler might have added something to the trees
-            //set changed flag, we want to refresh the tree
-            logger.debug("Refresh table");
-            itsMainFrame.setChanged(this.getFriendlyName(), true);
-            checkChanged();
+           // Force a refresh since MoM/scheduler might have added something to the trees
+           //set changed flag, we want to refresh the tree
+           logger.debug("Refresh table");
+           itsMainFrame.setChanged(this.getFriendlyName(),true);
+           checkChanged();
         }
 
 
@@ -517,7 +517,7 @@ public class MainPanel extends javax.swing.JPanel
     }//GEN-LAST:event_buttonPanel1ActionPerformed
 
     private void DefaultTemplatesPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DefaultTemplatesPanelMouseClicked
-        if (evt.getClickCount() == 1) {
+        if(evt.getClickCount() == 1) {
             validateButtons();
         } else {
             if (buttonPanel1.isButtonEnabled("Modify") && buttonPanel1.isButtonVisible("Modify")) {
@@ -525,10 +525,10 @@ public class MainPanel extends javax.swing.JPanel
             }
         }
     }//GEN-LAST:event_DefaultTemplatesPanelMouseClicked
-
+    
     /** Returns the selected row in the present tree */
     private int getSelectedRow() {
-        int aRow = -1;
+        int aRow=-1;
         switch (itsTabFocus) {
             case "PIC":
                 aRow = PICPanel.getSelectedRow();
@@ -551,7 +551,7 @@ public class MainPanel extends javax.swing.JPanel
 
     /** Returns the selected rows in the present tree */
     private int[] getSelectedRows() {
-        int[] rows = null;
+        int [] rows=null;
         switch (itsTabFocus) {
             case "PIC":
                 rows = PICPanel.getSelectedRows();
@@ -594,51 +594,51 @@ public class MainPanel extends javax.swing.JPanel
             }
         }
     }
-
+    
     /** Returns the ids of the selected Trees in case of a multiple selection */
-    private int[] getSelectedTreeIDs() {
-        int[] rows = this.getSelectedRows();
-        int[] treeIDs = new int[rows.length];
+    private int [] getSelectedTreeIDs() {
+        int [] rows=this.getSelectedRows();
+        int [] treeIDs=new int[rows.length];
         switch (itsTabFocus) {
             case "PIC":
-                for (int i = 0; i < rows.length; i++) {
-                    treeIDs[i] = ((Integer) PICPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
+                for (int i=0; i < rows.length; i++) {
+                    treeIDs[i] = ((Integer)PICPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
                 }
                 break;
             case "VIC":
-                for (int i = 0; i < rows.length; i++) {
-                    treeIDs[i] = ((Integer) VICPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
+                for (int i=0; i < rows.length; i++) {
+                    treeIDs[i] = ((Integer)VICPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
                 }
                 break;
             case "Templates":
-                for (int i = 0; i < rows.length; i++) {
-                    treeIDs[i] = ((Integer) TemplatesPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
+                for (int i=0; i < rows.length; i++) {
+                    treeIDs[i] = ((Integer)TemplatesPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
                 }
                 break;
             case "Default Templates":
-                for (int i = 0; i < rows.length; i++) {
-                    treeIDs[i] = ((Integer) DefaultTemplatesPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
+                for (int i=0; i < rows.length; i++) {
+                    treeIDs[i] = ((Integer)DefaultTemplatesPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
                 }
                 break;
             case "Components":
-                for (int i = 0; i < rows.length; i++) {
+                for (int i=0; i < rows.length; i++) {
                     // is the node ID in the case of Components
-                    treeIDs[i] = ((Integer) ComponentsPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
+                    treeIDs[i] = ((Integer)ComponentsPanel.getTableModel().getValueAt(rows[i], 0)).intValue();
                 }
                 break;
         }
 
-        return treeIDs;
+        return treeIDs;   
     }
 
     /** Returns the id of the selected Tree */
     private int getSelectedTreeID() {
-        int treeID = 0;
-        int aRow = this.getSelectedRow();
+        int treeID=0;
+        int aRow=this.getSelectedRow();
         switch (itsTabFocus) {
             case "PIC":
-                if (aRow > -1) {
-                    treeID = ((Integer) PICPanel.getTableModel().getValueAt(aRow, 0)).intValue();
+                if ( aRow > -1) {
+                    treeID = ((Integer)PICPanel.getTableModel().getValueAt(aRow, 0)).intValue();
                     if (treeID > 0) {
                         itsMainFrame.getSharedVars().setTreeID(treeID);
                     } else {
@@ -647,8 +647,8 @@ public class MainPanel extends javax.swing.JPanel
                 }
                 break;
             case "VIC":
-                if (aRow > -1) {
-                    treeID = ((Integer) VICPanel.getTableModel().getValueAt(aRow, 0)).intValue();
+                if ( aRow > -1) {
+                    treeID = ((Integer)VICPanel.getTableModel().getValueAt(aRow, 0)).intValue();
                     if (treeID > 0) {
                         itsMainFrame.getSharedVars().setTreeID(treeID);
                     } else {
@@ -657,8 +657,8 @@ public class MainPanel extends javax.swing.JPanel
                 }
                 break;
             case "Templates":
-                if (aRow > -1) {
-                    treeID = ((Integer) TemplatesPanel.getTableModel().getValueAt(aRow, 0)).intValue();
+                if ( aRow > -1) {
+                    treeID = ((Integer)TemplatesPanel.getTableModel().getValueAt(aRow, 0)).intValue();
                     if (treeID > 0) {
                         itsMainFrame.getSharedVars().setTreeID(treeID);
                     } else {
@@ -667,8 +667,8 @@ public class MainPanel extends javax.swing.JPanel
                 }
                 break;
             case "Default Templates":
-                if (aRow > -1) {
-                    treeID = ((Integer) DefaultTemplatesPanel.getTableModel().getValueAt(aRow, 0)).intValue();
+                if ( aRow > -1) {
+                    treeID = ((Integer)DefaultTemplatesPanel.getTableModel().getValueAt(aRow, 0)).intValue();
                     if (treeID > 0) {
                         itsMainFrame.getSharedVars().setTreeID(treeID);
                     } else {
@@ -677,9 +677,9 @@ public class MainPanel extends javax.swing.JPanel
                 }
                 break;
             case "Components":
-                if (aRow > -1) {
+                if ( aRow > -1) {
                     // is the node ID in the case of Components
-                    treeID = ((Integer) ComponentsPanel.getTableModel().getValueAt(aRow, 0)).intValue();
+                    treeID = ((Integer)ComponentsPanel.getTableModel().getValueAt(aRow, 0)).intValue();
                     if (treeID > 0) {
                         itsMainFrame.getSharedVars().setComponentID(treeID);
                     } else {
@@ -690,24 +690,24 @@ public class MainPanel extends javax.swing.JPanel
         }
         return treeID;
     }
-
+    
     /** Perform actions depending on the Button pressed and the Tab active
      *
      * @param   aButton     Name of the pressed button
      */
     private void buttonPanelAction(String aButton) {
-        logger.debug("Button pressed: " + aButton + "  ActiveTab: " + itsTabFocus);
+        logger.debug("Button pressed: "+aButton+ "  ActiveTab: " + itsTabFocus);
         if (inputFieldBuilder.currentInputField != null) {
             inputFieldBuilder.currentInputField.checkPopup();
         }
-        int treeID = getSelectedTreeID();
+        int treeID=getSelectedTreeID();
         switch (aButton) {
             case "Quit":
                 itsMainFrame.exit();
                 return;
             case "Refresh":
                 //set changed flag, we want to refresh the tree
-                itsMainFrame.setChanged(this.getFriendlyName(), true);
+                itsMainFrame.setChanged(this.getFriendlyName(),true);
                 checkChanged();
                 return;
         }
@@ -716,604 +716,576 @@ public class MainPanel extends javax.swing.JPanel
                 if (treeID > 0) {
                     itsMainFrame.getSharedVars().setTreeID(treeID);
                 } else if (!aButton.equals("New")) {
-                    LofarUtils.showErrorPanel(this, "You didn't select a tree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    LofarUtils.showErrorPanel(this,"You didn't select a tree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
 
                     return;
                 }
-                switch (aButton) {
-                    case "Query Panel":
-                        // TODO open Query Panel
-                        itsMainFrame.ToDo();
-                        break;
-                    case "State History":
-                        if (treeID > 0) {
-                            viewStateChanges(treeID);
-                        }
-                        break;
-                    case "New":
-                        if (getFile("PIC-tree")) {
-                            try {
-                                // the file obviously resides at the client side, and needs to be transfered to the server side.
-                                byte uldata[] = new byte[(int) itsNewFile.length()];
-                                try (BufferedInputStream input = new BufferedInputStream(new FileInputStream(itsNewFile))) {
-                                    input.read(uldata, 0, uldata.length);
-                                }
-                                String aFileName = "/tmp/" + itsMainFrame.getUserAccount().getUserName() + "_" + itsNewFile.getName();
-                                if (OtdbRmi.getRemoteFileTrans().uploadFile(uldata, aFileName)) {
-                                    logger.debug("upload finished");
-                                    // Create a new Tree from the found file.
-                                    int aTreeID = OtdbRmi.getRemoteMaintenance().loadMasterFile(aFileName);
-                                    if (aTreeID < 1) {
-                                        String aS = "Error on fileLoad: " + aFileName;
-                                        logger.error(aS);
-                                        LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                    } else {
-                                        // set changed flag to reload mainpanel
-                                        itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                        // set the new created TreeID to active and fill description stuff if needed
-                                        itsMainFrame.getSharedVars().setTreeID(aTreeID);
-                                        checkChanged();
-                                        if (!itsFileDescription.equals("")) {
-                                            if (!OtdbRmi.getRemoteMaintenance().setDescription(aTreeID, itsFileDescription)) {
-                                                String aS = "Error during setDescription in Tree " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                                logger.error(aS);
-                                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                            }
-                                        }
-
-                                        if (!itsFileStatus.equals("")) {
-                                            if (!OtdbRmi.getRemoteMaintenance().setTreeState(aTreeID, OtdbRmi.getRemoteTypes().getTreeState(itsFileStatus))) {
-                                                String aS = "Error during setStatus in Tree " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                                logger.error(aS);
-                                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                            }
-                                        }
-                                    }
-                                    ResultBrowserPanel aP = (ResultBrowserPanel) itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ResultBrowserPanel", true, true);
-                                    if (aP != null) {
-                                        itsMainFrame.showPanel(aP.getFriendlyName());
-                                    }
-                                }
-                            } catch (RemoteException ex) {
-                                String aS = "Error during newPICTree creation: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            } catch (FileNotFoundException ex) {
-                                String aS = "Error during newPICTree creation: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            } catch (IOException ex) {
-                                String aS = "Error during newPICTree creation: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            }
+        switch (aButton) {
+            case "Query Panel":
+                // TODO open Query Panel
+                itsMainFrame.ToDo();
+                break;
+            case "State History":
+                if (treeID > 0) {
+                    viewStateChanges(treeID);
+                }
+                break;
+            case "New":
+                if (getFile("PIC-tree")) {
+                    try {
+                       // the file obviously resides at the client side, and needs to be transfered to the server side.
+                       byte uldata[] = new byte[(int)itsNewFile.length()]; 
+                try (BufferedInputStream input = new BufferedInputStream(new FileInputStream(itsNewFile))) {
+                    input.read(uldata,0,uldata.length);
+                }
+                       String aFileName= "/tmp/"+itsMainFrame.getUserAccount().getUserName()+"_"+itsNewFile.getName();
+                       if (OtdbRmi.getRemoteFileTrans().uploadFile(uldata,aFileName)) {
+                           logger.debug("upload finished");                       
+                           // Create a new Tree from the found file.
+                           int aTreeID=OtdbRmi.getRemoteMaintenance().loadMasterFile(aFileName);
+                           if (aTreeID < 1) {
+                               String aS="Error on fileLoad: " + aFileName;
+                               logger.error(aS);
+                               LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                           } else {
+                               // set changed flag to reload mainpanel
+                               itsMainFrame.setChanged(this.getFriendlyName(),true);
+                               // set the new created TreeID to active and fill description stuff if needed
+                               itsMainFrame.getSharedVars().setTreeID(aTreeID);
+                               checkChanged();
+                               if (!itsFileDescription.equals("")) {
+                                  if (!OtdbRmi.getRemoteMaintenance().setDescription(aTreeID,itsFileDescription)) {
+                                      String aS="Error during setDescription in Tree "+OtdbRmi.getRemoteMaintenance().errorMsg();
+                                     logger.error(aS);
+                                     LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                                  }
+                               }
+                                  
+                               if (!itsFileStatus.equals("")) {
+                                  if (!OtdbRmi.getRemoteMaintenance().setTreeState(aTreeID,OtdbRmi.getRemoteTypes().getTreeState(itsFileStatus))) {
+                                      String aS="Error during setStatus in Tree "+OtdbRmi.getRemoteMaintenance().errorMsg();
+                                     logger.error(aS);
+                                     LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                                  }
+                               }                               
+                           }
+                           ResultBrowserPanel aP=(ResultBrowserPanel)itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ResultBrowserPanel", true, true);
+                           if (aP != null) {
+                              itsMainFrame.showPanel(aP.getFriendlyName());
+                           }
                         }
-                        break;
-                    case "Delete":
-                        if (JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this tree(s): ?", "Delete Tree", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
-                            try {
-                                int[] treeIDs = getSelectedTreeIDs();
-                                for (int i = 0; i < treeIDs.length; i++) {
-                                    if (!OtdbRmi.getRemoteMaintenance().deleteTree(treeIDs[i])) {
-                                        String aS = "Failed to delete tree: " + treeIDs[i];
-                                        logger.error(aS);
-                                        LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                    }
-                                }
-                            } catch (RemoteException ex) {
-                                String aS = "Remote error during deleteTree: " + ex;
+                   } catch (RemoteException ex) {
+                       String aS="Error during newPICTree creation: "+ ex;
+                       logger.error(aS);
+                       LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                   } catch (FileNotFoundException ex) {
+                       String aS="Error during newPICTree creation: "+ ex;
+                       logger.error(aS);
+                       LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                   } catch (IOException ex) {
+                       String aS="Error during newPICTree creation: "+ ex;
+                       logger.error(aS);
+                       LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                   }
+                }
+                break;
+            case "Delete":
+                if (JOptionPane.showConfirmDialog(this,"Are you sure you want to delete this tree(s): ?","Delete Tree",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+                    try {
+                        int[] treeIDs=getSelectedTreeIDs();
+                        for (int i=0;i< treeIDs.length;i++) {
+                            if (!OtdbRmi.getRemoteMaintenance().deleteTree(treeIDs[i])) {
+                                String aS="Failed to delete tree: "+treeIDs[i];
                                 logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                                LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                             }
-                            itsMainFrame.setHourglassCursor();
-                            ((PICtableModel) PICPanel.getTableModel()).fillTable();
-                            itsMainFrame.setNormalCursor();
                         }
-                        break;
-                    case "View":
-                        ResultBrowserPanel aP = (ResultBrowserPanel) itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ResultBrowserPanel", true, true);
-                        if (aP != null) {
-                            itsMainFrame.showPanel(aP.getFriendlyName());
-                        }
-                        break;
-                    case "Info":
-                        if (treeID > 0) {
-                            int[] id = new int[1];
-                            id[0] = treeID;
-                            if (viewInfo(id)) {
-
-                                logger.debug("Tree has been changed, reloading tableline");
-                                itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                checkChanged();
-                            }
-                        }
-                        break;
+                    } catch (RemoteException ex) {
+                        String aS="Remote error during deleteTree: "+ ex;
+                        logger.error(aS);
+                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    }
+                    itsMainFrame.setHourglassCursor();
+                    ((PICtableModel)PICPanel.getTableModel()).fillTable();
+                    itsMainFrame.setNormalCursor();
                 }
                 break;
+            case "View":
+                ResultBrowserPanel aP=(ResultBrowserPanel)itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ResultBrowserPanel", true, true);
+                if (aP != null) {
+                    itsMainFrame.showPanel(aP.getFriendlyName());
+                }
+                break;
+            case "Info":
+                if (treeID > 0) {
+                    int [] id=new int[1];
+                    id[0]=treeID;
+                    if (viewInfo(id)) {
+                        
+                        logger.debug("Tree has been changed, reloading tableline");
+                          itsMainFrame.setChanged(this.getFriendlyName(),true);
+                          checkChanged();
+                    }
+                }
+                break;
+        }
+                break;
             case "VIC":
                 if (treeID > 0) {
                     itsMainFrame.getSharedVars().setTreeID(treeID);
                 } else {
-                    LofarUtils.showErrorPanel(this, "You didn't select a tree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    LofarUtils.showErrorPanel(this, "You didn't select a tree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                     return;
                 }
-                switch (aButton) {
-                    case "Query Panel":
-                        // TODO open Query Panel
-                        itsMainFrame.ToDo();
-                        break;
-                    case "State History":
-                        if (treeID > 0) {
-                            viewStateChanges(treeID);
-                        }
-                        break;
-                    case "Delete":
-                        if (JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this tree(s): ?", "Delete Tree", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
-                            try {
-                                int[] treeIDs = getSelectedTreeIDs();
-                                for (int i = 0; i < treeIDs.length; i++) {
-                                    if (!OtdbRmi.getRemoteMaintenance().deleteTree(treeIDs[i])) {
-                                        String aS = "Failed to delete tree: " + treeIDs[i];
-                                        logger.error(aS);
-                                        LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                    }
-                                }
-                            } catch (RemoteException ex) {
-                                String aS = "Remote error during deleteTree: " + ex;
+        switch (aButton) {
+            case "Query Panel":
+                // TODO open Query Panel
+                itsMainFrame.ToDo();
+                break;
+            case "State History":
+                if (treeID > 0) {
+                    viewStateChanges(treeID);
+                }
+                break;
+            case "Delete":
+                if (JOptionPane.showConfirmDialog(this,"Are you sure you want to delete this tree(s): ?","Delete Tree",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+                    try {
+                        int[] treeIDs=getSelectedTreeIDs();
+                        for (int i=0;i< treeIDs.length;i++) {
+                            if (!OtdbRmi.getRemoteMaintenance().deleteTree(treeIDs[i])) {
+                                String aS="Failed to delete tree: "+treeIDs[i];
                                 logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            }
-                            itsMainFrame.setHourglassCursor();
-                            ((VICtableModel) VICPanel.getTableModel()).fillTable();
-                            itsMainFrame.setNormalCursor();
-                        }
-                        break;
-                    case "View":
-                        ResultBrowserPanel aP = (ResultBrowserPanel) itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ResultBrowserPanel", true, true);
-                        if (aP != null) {
-                            itsMainFrame.showPanel(aP.getFriendlyName());
-                        }
-                        break;
-                    case "Schedule":
-                        // in case of VICtree we have the possibility of changing a multiple selection
-                        // so things like start and/or stoptimes can be set for a few entries at once
-                        if (this.VICPanel.getSelectedRowCount() > 0) {
-                            if (viewInfo(this.getSelectedTreeIDs())) {
-                                logger.debug("Tree has been changed, reloading tableline");
-                                itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                checkChanged();
+                                LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                             }
-
                         }
-                        break;
+                    } catch (RemoteException ex) {
+                        String aS="Remote error during deleteTree: "+ ex;
+                        logger.error(aS);
+                        LofarUtils.showErrorPanel(this, aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    }
+                    itsMainFrame.setHourglassCursor();
+                    ((VICtableModel)VICPanel.getTableModel()).fillTable();
+                    itsMainFrame.setNormalCursor();
                 }
                 break;
-            case "Templates": {
-                jOTDBtree aTree = null;
-                String aTreeState = "";
-                if (treeID > 0) {
-                    itsMainFrame.getSharedVars().setTreeID(treeID);
-                    try {
-                        aTree = OtdbRmi.getRemoteOTDB().getTreeInfo(treeID, false);
-                        aTreeState = OtdbRmi.getRemoteTypes().getTreeState(aTree.state);
-                    } catch (RemoteException ex) {
-                        String aS = "Error during Remote treeMaintenance";
-                        logger.debug(aS);
-                        LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+            case "View":
+                ResultBrowserPanel aP=(ResultBrowserPanel)itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ResultBrowserPanel", true, true);
+                if (aP != null) {
+                    itsMainFrame.showPanel(aP.getFriendlyName());
+                }
+                break;
+            case "Schedule":
+                // in case of VICtree we have the possibility of changing a multiple selection
+                // so things like start and/or stoptimes can be set for a few entries at once
+                if (this.VICPanel.getSelectedRowCount() > 0) {
+                    if (viewInfo(this.getSelectedTreeIDs()) ) {
+                        logger.debug("Tree has been changed, reloading tableline");
+                          itsMainFrame.setChanged(this.getFriendlyName(),true);
+                          checkChanged();
                     }
-                } else {
-
-                    LofarUtils.showErrorPanel(this, "You didn't select a tree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                    return;
+                    
                 }
-                switch (aButton) {
-                    case "Query Panel":
-                        itsMainFrame.ToDo();
-                        break;
-                    case "State History":
-                        if (treeID > 0) {
-                            viewStateChanges(treeID);
+                break;
+        }
+                break;
+            case "Templates":
+                {
+                    jOTDBtree aTree=null;
+                    String aTreeState="";
+                    if (treeID > 0) {
+                        itsMainFrame.getSharedVars().setTreeID(treeID);
+                        try {
+                            aTree =    OtdbRmi.getRemoteOTDB().getTreeInfo(treeID,false);
+                            aTreeState=OtdbRmi.getRemoteTypes().getTreeState(aTree.state);
+                        } catch (RemoteException ex) {
+                            String aS="Error during Remote treeMaintenance";
+                            logger.debug(aS);
+                            LofarUtils.showErrorPanel(this, aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                         }
-                        break;
-                    case "Duplicate":
-                        if (treeID < 1) {
-                            LofarUtils.showErrorPanel(this, "You didn't select a tree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                        } else {
-                            try {
-                                int newTreeID = OtdbRmi.getRemoteMaintenance().copyTemplateTree(treeID);
-                                if (newTreeID > 0) {
-                                    JOptionPane.showMessageDialog(this, "New Tree created with ID: " + newTreeID,
-                                            "New Tree Message",
-                                            JOptionPane.INFORMATION_MESSAGE);
-                                    // set back treestate to described
-                                    jOTDBtree aT = OtdbRmi.getRemoteOTDB().getTreeInfo(newTreeID, false);
-                                    if (aT.state != OtdbRmi.getRemoteTypes().getTreeState("described")) {
-                                        aT.state = OtdbRmi.getRemoteTypes().getTreeState("described");
-                                        if (!OtdbRmi.getRemoteMaintenance().setTreeState(aT.treeID(), aT.state)) {
-                                            String aS = "Error during setTreeState: " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                            logger.error(aS);
-                                            LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                        }
-                                    }
-                                    // check momID, if not zero set to zero
-                                    if (aT.momID() != 0) {
-                                        if (!OtdbRmi.getRemoteMaintenance().setMomInfo(aT.treeID(), 0, aT.groupID, aT.campaign)) {
-                                            String aS = "Error during setMomInfo: " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                            logger.debug(aS);
-                                            LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                        }
-
-                                    }
-                                    itsMainFrame.getSharedVars().setTreeID(newTreeID);
-                                    // set changed flag to reload mainpanel
-                                    itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                    checkChanged();
-                                } else {
-                                    logger.debug("No Template Tree created!!!");
-                                }
+                    } else {
 
-                            } catch (RemoteException ex) {
-                                String aS = "Remote error during Build TemplateTree: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            }
-                        }
-                        break;
-                    case "Modify":
-                        TemplateMaintenancePanel aP = (TemplateMaintenancePanel) itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.TemplateMaintenancePanel", true, true);
-                        if (aP != null) {
-                            itsMainFrame.showPanel(aP.getFriendlyName());
-                        }
-                        break;
-                    case "Delete":
-                        if (JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this tree(s) ?", "Delete Tree", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
-                            try {
-                                int[] treeIDs = getSelectedTreeIDs();
-                                for (int i = 0; i < treeIDs.length; i++) {
-                                    if (!OtdbRmi.getRemoteMaintenance().deleteTree(treeIDs[i])) {
-                                        String aS = "Failed to delete tree: " + treeIDs[i];
+                        LofarUtils.showErrorPanel(this, "You didn't select a tree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                        return;
+                    }
+            switch (aButton) {
+                case "Query Panel":
+                    itsMainFrame.ToDo();
+                    break;
+                case "State History":
+                    if (treeID > 0) {
+                        viewStateChanges(treeID);
+                    }
+                    break;
+                case "Duplicate":
+                    if (treeID < 1) {
+                        LofarUtils.showErrorPanel(this, "You didn't select a tree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    } else {
+                        try {
+                            int newTreeID=OtdbRmi.getRemoteMaintenance().copyTemplateTree(treeID);
+                            if (newTreeID > 0) {
+                                JOptionPane.showMessageDialog(this,"New Tree created with ID: "+newTreeID,
+                                    "New Tree Message",
+                                    JOptionPane.INFORMATION_MESSAGE);
+                                // set back treestate to described
+                                jOTDBtree aT=OtdbRmi.getRemoteOTDB().getTreeInfo(newTreeID, false); 
+                                if (aT.state != OtdbRmi.getRemoteTypes().getTreeState("described") ) {
+                                    aT.state=OtdbRmi.getRemoteTypes().getTreeState("described");
+                                    if (!OtdbRmi.getRemoteMaintenance().setTreeState(aT.treeID(), aT.state)) {
+                                        String aS="Error during setTreeState: "+OtdbRmi.getRemoteMaintenance().errorMsg();
                                         logger.error(aS);
-                                        LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                                     }
                                 }
-                            } catch (RemoteException ex) {
-                                String aS = "Remote error during deleteTree: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            }
-                            itsMainFrame.getSharedVars().setTreeID(-1);
-                            itsMainFrame.setHourglassCursor();
-                            ((TemplatetableModel) TemplatesPanel.getTableModel()).fillTable();
-                            itsMainFrame.setNormalCursor();
-                            // set changed flag to reload mainpanel
-                            //                  itsMainFrame.setChanged(this.getFriendlyName(),true);
-                            //                    checkChanged();
-                        }
-                        break;
-                    case "Build VIC tree":
-                        if (treeID < 1) {
-                            LofarUtils.showErrorPanel(this, "You didn't select a tree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                        } else {
-                            try {
-                                int newTreeID = OtdbRmi.getRemoteMaintenance().instanciateTree(itsMainFrame.getSharedVars().getTreeID());
-                                if (newTreeID > 0) {
-                                    JOptionPane.showMessageDialog(this, "New VICTree created with ID: " + newTreeID,
-                                            "New Tree Message",
-                                            JOptionPane.INFORMATION_MESSAGE);
-                                    itsMainFrame.getSharedVars().setTreeID(newTreeID);
-                                    // set changed flag to reload mainpanel
-                                    itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                    checkChanged();
-                                } else {
-                                    String aS = "No VIC Tree created!!! : " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                    logger.error(aS);
-                                    LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                }
+                                // check momID, if not zero set to zero
+                                if (aT.momID() != 0) {
+                                    if (!OtdbRmi.getRemoteMaintenance().setMomInfo(aT.treeID(),0,aT.groupID,aT.campaign)) {
+                                        String aS="Error during setMomInfo: "+OtdbRmi.getRemoteMaintenance().errorMsg();
+                                        logger.debug(aS);
+                                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                                    }
 
-                            } catch (RemoteException ex) {
-                                String aS = "Remote error during Build VICTree: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            }
-                        }
-                        break;
-                    case "Change Status":
-                        // in case of templatetree we have the possibility of changing a multiple selection
-                        // so things like status can be set for a few entries at once
-                        if (TemplatesPanel.getSelectedRowCount() > 0) {
-                            if (viewInfo(this.getSelectedTreeIDs())) {
-                                logger.debug("Tree has been changed, reloading tableline");
-                                itsMainFrame.setChanged(this.getFriendlyName(), true);
+                                }
+                                itsMainFrame.getSharedVars().setTreeID(newTreeID);
+                                // set changed flag to reload mainpanel
+                                itsMainFrame.setChanged(this.getFriendlyName(),true);
                                 checkChanged();
+                            } else {
+                                logger.debug("No Template Tree created!!!");
                             }
-
+               
+                        } catch (RemoteException ex) {
+                            String aS="Remote error during Build TemplateTree: "+ ex;
+                            logger.error(aS);
+                            LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                         }
-                        break;
-                    case "MultiEdit":
-                        // in case of templatetree we have the possibility to change a few crucial settings for all trees chosen
-                        if (TemplatesPanel.getSelectedRowCount() > 0) {
-                            if (viewMultiEditDialog(this.getSelectedTreeIDs())) {
-                                logger.debug("Trees have been changed, reloading tablelines");
-                                itsMainFrame.setChanged(this.getFriendlyName(), true);
+                    }
+                    break;
+                case "Modify":
+                    TemplateMaintenancePanel aP =(TemplateMaintenancePanel)itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.TemplateMaintenancePanel", true, true);
+                    if (aP != null) {
+                        itsMainFrame.showPanel(aP.getFriendlyName());
+                    }
+                    break;
+                case "Delete":
+                    if (JOptionPane.showConfirmDialog(this,"Are you sure you want to delete this tree(s) ?","Delete Tree",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+                        try {
+                           int[] treeIDs=getSelectedTreeIDs();
+                           for (int i=0;i< treeIDs.length;i++) {
+                               if (!OtdbRmi.getRemoteMaintenance().deleteTree(treeIDs[i])) {
+                                   String aS="Failed to delete tree: "+treeIDs[i];
+                                   logger.error(aS);
+                                   LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                               }
+                           }
+                        } catch (RemoteException ex) {
+                           String aS="Remote error during deleteTree: "+ ex;
+                           logger.error(aS);
+                           LofarUtils.showErrorPanel(this, aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                       }
+                       itsMainFrame.getSharedVars().setTreeID(-1);                              
+                       itsMainFrame.setHourglassCursor();
+                       ((TemplatetableModel)TemplatesPanel.getTableModel()).fillTable();
+                       itsMainFrame.setNormalCursor();
+                       // set changed flag to reload mainpanel
+   //                  itsMainFrame.setChanged(this.getFriendlyName(),true);
+   //                    checkChanged();
+                   }break;
+                case "Build VIC tree":
+                    if (treeID < 1) {
+                        LofarUtils.showErrorPanel(this, "You didn't select a tree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    } else {
+                        try {
+                            int newTreeID=OtdbRmi.getRemoteMaintenance().instanciateTree(itsMainFrame.getSharedVars().getTreeID());
+                            if (newTreeID > 0) {
+                                JOptionPane.showMessageDialog(this,"New VICTree created with ID: "+newTreeID,
+                                    "New Tree Message",
+                                    JOptionPane.INFORMATION_MESSAGE);
+                                itsMainFrame.getSharedVars().setTreeID(newTreeID);
+                                // set changed flag to reload mainpanel
+                                itsMainFrame.setChanged(this.getFriendlyName(),true);
                                 checkChanged();
-                            }
-
-                        }
-                        break;
-                    case "Set to Default":
-                        if (itsMainFrame.getSharedVars().getTreeID() > 0) {
-                            try {
-                                ArrayList<jDefaultTemplate> aDFList = new ArrayList(OtdbRmi.getRemoteOTDB().getDefaultTemplates());
-                                if (createDefaultTemplateDialog(aTree, aDFList)) {
-                                    // check momID, if not zero set to zero
-                                    if (aTree.momID() != 0) {
-                                        if (!OtdbRmi.getRemoteMaintenance().setMomInfo(aTree.treeID(), 0, aTree.groupID, aTree.campaign)) {
-                                            String aS = "Error during setMomInfo: " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                            logger.error(aS);
-                                            LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                        }
-                                    }
-                                    itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                    checkChanged();
-                                }
-                            } catch (RemoteException ex) {
-                                String aS = "Error during Remote treeMaintenance" + ex;
+                            } else {
+                                String aS="No VIC Tree created!!! : "+ OtdbRmi.getRemoteMaintenance().errorMsg();
                                 logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                                LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                             }
+               
+                        } catch (RemoteException ex) {
+                            String aS="Remote error during Build VICTree: "+ ex;
+                            logger.error(aS);
+                            LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                         }
-                        break;
-                }
-                break;
-            }
-            case "Default Templates": {
-                jOTDBtree aTree = null;
-                String aTreeState = "";
-                if (treeID > 0) {
-                    itsMainFrame.getSharedVars().setTreeID(treeID);
-                    try {
-                        aTree = OtdbRmi.getRemoteOTDB().getTreeInfo(treeID, false);
-                        aTreeState = OtdbRmi.getRemoteTypes().getTreeState(aTree.state);
-                    } catch (RemoteException ex) {
-                        String aS = "Error during Remote treeMaintenance" + ex;
-                        logger.error(aS);
-                        LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                     }
-                } else {
-                    LofarUtils.showErrorPanel(this, "You didn't select a tree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                    return;
-                }
-                switch (aButton) {
-                    case "Query Panel":
-                        itsMainFrame.ToDo();
-                        break;
-                    case "State History":
-                        if (treeID > 0) {
-                            viewStateChanges(treeID);
+                    break;
+                case "Change Status":
+                    // in case of templatetree we have the possibility of changing a multiple selection
+                    // so things status can be set for a few entries at once
+                    if (TemplatesPanel.getSelectedRowCount() > 0) {
+                        if (viewInfo(this.getSelectedTreeIDs()) ) {
+                            logger.debug("Tree has been changed, reloading tableline");
+                              itsMainFrame.setChanged(this.getFriendlyName(),true);
+                              checkChanged();
                         }
-                        break;
-                    case "Duplicate":
-                        if (treeID < 1) {
-                            LofarUtils.showErrorPanel(this, "You didn't select a tree", new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                        } else {
-                            try {
-                                int newTreeID = OtdbRmi.getRemoteMaintenance().copyTemplateTree(treeID);
-                                if (newTreeID > 0) {
-                                    JOptionPane.showMessageDialog(this, "New Tree (Not Default!!!) created with ID: " + newTreeID,
-                                            "New Tree Message",
-                                            JOptionPane.INFORMATION_MESSAGE);
-                                    // set back treestate to described
-                                    jOTDBtree aT = OtdbRmi.getRemoteOTDB().getTreeInfo(newTreeID, false);
-                                    if (aT.state != OtdbRmi.getRemoteTypes().getTreeState("described")) {
-                                        aT.state = OtdbRmi.getRemoteTypes().getTreeState("described");
-                                        if (!OtdbRmi.getRemoteMaintenance().setTreeState(aT.treeID(), aT.state)) {
-                                            String aS = "Error during setTreeState: " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                            logger.error(aS);
-                                            LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                        }
-                                    }
-                                    // check momID, if not zero set to zero
-                                    if (aT.momID() != 0) {
-                                        if (!OtdbRmi.getRemoteMaintenance().setMomInfo(aT.treeID(), 0, aT.groupID, aT.campaign)) {
-                                            String aS = "Error during setMomInfo: " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                            logger.error(aS);
-                                            LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                        }
 
-                                    }
-                                    itsMainFrame.getSharedVars().setTreeID(newTreeID);
-                                    // set changed flag to reload mainpanel
-                                    itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                    checkChanged();
-                                } else {
-                                    String aS = "No Template Tree created!!!";
-                                    logger.error(aS);
-                                    LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                }
-
-                            } catch (RemoteException ex) {
-                                String aS = "Remote error during Build TemplateTree: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            }
-                        }
-                        break;
-                    case "Modify":
-                        TemplateMaintenancePanel aP = (TemplateMaintenancePanel) itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.TemplateMaintenancePanel", true, true);
-                        if (aP != null) {
-                            itsMainFrame.showPanel(aP.getFriendlyName());
+                    }
+                    break;
+                case "MultiEdit":
+                    // in case of templatetree we have the possibility to change a few crucial settings for all trees chosen
+                    if (TemplatesPanel.getSelectedRowCount() > 0) {
+                        if (viewMultiEditDialog(this.getSelectedTreeIDs()) ) {
+                            logger.debug("Trees have been changed, reloading tablelines");
+                              itsMainFrame.setChanged(this.getFriendlyName(),true);
+                              checkChanged();
                         }
-                        break;
-                    case "Remove from Default":
-                        if (JOptionPane.showConfirmDialog(this, "Are you sure you want to move this default template(s) to an ordinary template ?", "Remove template from Default templates", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
-                            try {
-                                int[] treeIDs = getSelectedTreeIDs();
-                                for (int i = 0; i < treeIDs.length; i++) {
-                                    jOTDBtree tmpTree = OtdbRmi.getRemoteOTDB().getTreeInfo(treeIDs[i], false);
 
-                                    if (!OtdbRmi.getRemoteMaintenance().assignTemplateName(tmpTree.treeID(), "")) {
-                                        String aS = "Error during assignTemplateName(" + tmpTree.treeID() + ", ): " + OtdbRmi.getRemoteMaintenance().errorMsg();
+                    }
+                    break;
+                case "Set to Default":
+                    if (itsMainFrame.getSharedVars().getTreeID() > 0) {
+                        try {
+                            ArrayList<jDefaultTemplate> aDFList = new ArrayList(OtdbRmi.getRemoteOTDB().getDefaultTemplates());
+                            if (createDefaultTemplateDialog(aTree, aDFList)) {
+                                // check momID, if not zero set to zero
+                                if (aTree.momID() != 0) {
+                                    if (!OtdbRmi.getRemoteMaintenance().setMomInfo(aTree.treeID(), 0, aTree.groupID, aTree.campaign)) {
+                                        String aS = "Error during setMomInfo: " + OtdbRmi.getRemoteMaintenance().errorMsg();
                                         logger.error(aS);
                                         LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                    } else {
-                                        itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                        checkChanged();
                                     }
                                 }
-                            } catch (RemoteException ex) {
-                                try {
-                                    String aS = "RemoteExceptionError while setting TemplateName " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                    logger.error(aS);
-                                    LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                } catch (RemoteException ex1) {
-                                    String aS = "Remote Exception Error getting the remote errorMessage";
-                                    logger.error(aS);
-                                    LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                }
-                            }
-                            }
-                            break;
-                    case "Change Status":
-                        if (itsMainFrame.getSharedVars().getTreeID() > 0) {
-                            int[] id = new int[1];
-                            id[0] = itsMainFrame.getSharedVars().getTreeID();
-                            if (viewInfo(id)) {
-                                logger.debug("Tree has been changed, reloading table line");
                                 itsMainFrame.setChanged(this.getFriendlyName(), true);
                                 checkChanged();
                             }
+                        } catch (RemoteException ex) {
+                            String aS="Error during Remote treeMaintenance" + ex;
+                            logger.error(aS);
+                            LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                         }
-                        break;
-                }
-                break;
+                    }
+                    break;
             }
-            case "Components":
-                switch (aButton) {
-                    case "Query Panel":
-                        itsMainFrame.ToDo();
-                        break;
-                    case "New":
-                        if (getFile("VIC-component")) {
-                            try {
-                                // the file obviously resides at the client side, and needs to be transfered to the server side.
-                                byte uldata[] = new byte[(int) itsNewFile.length()];
-                                try (BufferedInputStream input = new BufferedInputStream(new FileInputStream(itsNewFile))) {
-                                    input.read(uldata, 0, uldata.length);
-                                }
-                                String aFileName = "/tmp/" + itsMainFrame.getUserAccount().getUserName() + "_" + itsNewFile.getName();
-                                if (OtdbRmi.getRemoteFileTrans().uploadFile(uldata, aFileName)) {
-                                    logger.debug("upload finished");
-                                    // Create a new Tree from the found file.
-                                    int anID = OtdbRmi.getRemoteMaintenance().loadComponentFile(aFileName, "", "");
-                                    if (anID < 1) {
-                                        String aS = "Error on ComponentfileLoad: " + itsNewFile.getPath();
+                    break;
+                }
+            case "Default Templates":
+                {
+                    jOTDBtree aTree=null;
+                    String aTreeState="";
+                    if (treeID > 0) {
+                        itsMainFrame.getSharedVars().setTreeID(treeID);
+                        try {
+                            aTree =    OtdbRmi.getRemoteOTDB().getTreeInfo(treeID,false);
+                            aTreeState=OtdbRmi.getRemoteTypes().getTreeState(aTree.state);
+                        } catch (RemoteException ex) {
+                            String aS="Error during Remote treeMaintenance" + ex;
+                            logger.error(aS);
+                            LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                        }
+                    } else {
+                        LofarUtils.showErrorPanel(this, "You didn't select a tree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                        return;
+                    }
+            switch (aButton) {
+                case "Query Panel":
+                    itsMainFrame.ToDo();
+                    break;
+                case "State History":
+                    if (treeID > 0) {
+                        viewStateChanges(treeID);
+                    }
+                    break;
+                case "Duplicate":
+                    if (treeID < 1) {
+                        LofarUtils.showErrorPanel(this, "You didn't select a tree",new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    } else {
+                        try {
+                            int newTreeID=OtdbRmi.getRemoteMaintenance().copyTemplateTree(treeID);
+                            if (newTreeID > 0) {
+                                JOptionPane.showMessageDialog(this,"New Tree (Not Default!!!) created with ID: "+newTreeID,
+                                    "New Tree Message",
+                                    JOptionPane.INFORMATION_MESSAGE);
+                                // set back treestate to described
+                                jOTDBtree aT=OtdbRmi.getRemoteOTDB().getTreeInfo(newTreeID, false);
+                                if (aT.state != OtdbRmi.getRemoteTypes().getTreeState("described") ) {
+                                    aT.state=OtdbRmi.getRemoteTypes().getTreeState("described");
+                                    if (!OtdbRmi.getRemoteMaintenance().setTreeState(aT.treeID(), aT.state)) {
+                                        String aS="Error during setTreeState: "+OtdbRmi.getRemoteMaintenance().errorMsg();
                                         logger.error(aS);
-                                        LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                    } else {
-                                        // set the new created fill description stuff if needed
-                                        itsMainFrame.getSharedVars().setComponentID(anID);
-                                        if (!itsFileDescription.equals("")) {
-                                            jVICnodeDef aND = OtdbRmi.getRemoteMaintenance().getComponentNode(anID);
-                                            aND.description = itsFileDescription;
-                                            if (!OtdbRmi.getRemoteMaintenance().saveComponentNode(aND)) {
-                                                String aS = "Error during setDescription in Component " + OtdbRmi.getRemoteMaintenance().errorMsg();
-                                                logger.error(aS);
-                                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                            }
-                                        }
-                                        // set changed flag to reload mainpanel
-                                        itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                        checkChanged();
+                                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                                     }
-                                    ComponentMaintenancePanel aP = (ComponentMaintenancePanel) itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ComponentMaintenancePanel", true, true);
-                                    if (aP != null) {
-                                        itsMainFrame.showPanel(aP.getFriendlyName());
+                                }
+                                // check momID, if not zero set to zero
+                                if (aT.momID() != 0) {
+                                    if (!OtdbRmi.getRemoteMaintenance().setMomInfo(aT.treeID(),0, aT.groupID, aT.campaign)) {
+                                        String aS="Error during setMomInfo: "+OtdbRmi.getRemoteMaintenance().errorMsg();
+                                        logger.error(aS);
+                                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                                     }
-                                } else {
-                                    String aS = "upload failed";
-                                    logger.error(aS);
-                                    LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/tb/icons/16_warn.gif")));
+
                                 }
-                            } catch (FileNotFoundException ex) {
-                                String aS = "Error during new Component creation: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            } catch (RemoteException ex) {
-                                String aS = "Error during new Component creation: " + ex;
-                                logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            } catch (IOException ex) {
-                                String aS = "Error during new Component creation: " + ex;
+                                itsMainFrame.getSharedVars().setTreeID(newTreeID);
+                                // set changed flag to reload mainpanel
+                                itsMainFrame.setChanged(this.getFriendlyName(),true);
+                                checkChanged();
+                            } else {
+                                String aS="No Template Tree created!!!";
                                 logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                            }
-                        }
-                        break;
-                    case "Modify":
-                        ComponentMaintenancePanel aP = (ComponentMaintenancePanel) itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ComponentMaintenancePanel", true, true);
-                        if (aP != null) {
-                            itsMainFrame.showPanel(aP.getFriendlyName());
-                        }
-                        break;
-                    case "Build TemplateTree":
-                        int nodeID = itsMainFrame.getSharedVars().getComponentID();
-                        short classifID;
-                        try {
-                            classifID = OtdbRmi.getRemoteTypes().getClassif("operational");
-                            if (OtdbRmi.getRemoteMaintenance().isTopComponent(nodeID)) {
-                                int newTreeID = OtdbRmi.getRemoteMaintenance().buildTemplateTree(nodeID, classifID);
-                                if (newTreeID > 0) {
-                                    JOptionPane.showMessageDialog(this, "New Tree created with ID: " + newTreeID,
-                                            "New Tree Message",
-                                            JOptionPane.INFORMATION_MESSAGE);
-                                    itsMainFrame.getSharedVars().setTreeID(newTreeID);
-                                    // set changed flag to reload mainpanel
-                                    itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                    checkChanged();
-                                } else {
-                                    String aS = "No Template Tree created!!!";
-                                    logger.error(aS);
-                                    LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                }
+                                LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                             }
+
                         } catch (RemoteException ex) {
-                            String aS = "Remote error during Build TemplateTree: " + ex;
+                            String aS="Remote error during Build TemplateTree: "+ ex;
                             logger.error(aS);
-                            LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                            LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                         }
-                        break;
-                    case "Delete":
-                        if (JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this component(s): ?", "Delete Component", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) {
-                            try {
-                                int[] componentIDs = getSelectedTreeIDs();
-                                for (int i = 0; i < componentIDs.length; i++) {
-                                    if (!OtdbRmi.getRemoteMaintenance().deleteComponentNode(componentIDs[i])) {
-                                        String aS = "Failed to delete component: " + componentIDs[i];
+                    }
+                    break;
+                case "Modify":
+                    TemplateMaintenancePanel aP =(TemplateMaintenancePanel)itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.TemplateMaintenancePanel", true, true);
+                    if (aP != null) {
+                        itsMainFrame.showPanel(aP.getFriendlyName());
+                    }
+                    break;
+                case "Change Status":
+                    if (itsMainFrame.getSharedVars().getTreeID() > 0) {
+                        int [] id = new int[1];
+                        id[0]=itsMainFrame.getSharedVars().getTreeID();
+                        if (viewInfo(id)) {
+                            logger.debug("Tree has been changed, reloading table line");
+                              itsMainFrame.setChanged(this.getFriendlyName(),true);
+                              checkChanged();
+                        }
+                    }
+                    break;
+            }
+                    break;
+                }
+            case "Components":
+        switch (aButton) {
+            case "Query Panel":
+                itsMainFrame.ToDo();
+                break;
+            case "New":
+                if (getFile("VIC-component") ) {
+                    try {
+                        // the file obviously resides at the client side, and needs to be transfered to the server side.
+                        byte uldata[] = new byte[(int)itsNewFile.length()]; 
+                try (BufferedInputStream input = new BufferedInputStream(new FileInputStream(itsNewFile))) {
+                    input.read(uldata,0,uldata.length);
+                }
+                        String aFileName= "/tmp/"+itsMainFrame.getUserAccount().getUserName()+"_"+itsNewFile.getName();
+                        if (OtdbRmi.getRemoteFileTrans().uploadFile(uldata,aFileName)) {
+                            logger.debug("upload finished");
+                            // Create a new Tree from the found file.
+                            int anID=OtdbRmi.getRemoteMaintenance().loadComponentFile(aFileName,"","");
+                            if (anID < 1) {
+                                String aS="Error on ComponentfileLoad: " + itsNewFile.getPath();
+                                logger.error(aS);
+                                LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                            } else {
+                                // set the new created fill description stuff if needed
+                                itsMainFrame.getSharedVars().setComponentID(anID);
+                                if (!itsFileDescription.equals("")) {
+                                    jVICnodeDef aND=OtdbRmi.getRemoteMaintenance().getComponentNode(anID);
+                                    aND.description=itsFileDescription;
+                                    if (!OtdbRmi.getRemoteMaintenance().saveComponentNode(aND)) {
+                                        String aS="Error during setDescription in Component "+OtdbRmi.getRemoteMaintenance().errorMsg();
                                         logger.error(aS);
-                                        LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
-                                    } else {
-                                        // set changed flag to reload mainpanel
-                                        itsMainFrame.setChanged(this.getFriendlyName(), true);
-                                        checkChanged();
+                                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                                     }
                                 }
-                            } catch (RemoteException ex) {
-                                String aS = "Remote error during deleteComponents: " + ex;
+                                // set changed flag to reload mainpanel
+                                itsMainFrame.setChanged(this.getFriendlyName(),true);
+                                checkChanged();
+                            }
+                            ComponentMaintenancePanel aP=(ComponentMaintenancePanel)itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ComponentMaintenancePanel", true, true);
+                            if (aP != null) {
+                                itsMainFrame.showPanel(aP.getFriendlyName());
+                            }
+                        } else {
+                            String aS="upload failed";
+                            logger.error(aS);
+                            LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/tb/icons/16_warn.gif")));
+                        }
+                    } catch (FileNotFoundException ex) {
+                        String aS="Error during new Component creation: "+ ex;
+                        logger.error(aS);
+                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    } catch (RemoteException ex) {
+                        String aS="Error during new Component creation: "+ ex;
+                        logger.error(aS);
+                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    } catch (IOException ex) {
+                        String aS="Error during new Component creation: "+ ex;
+                        logger.error(aS);
+                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    }
+                }
+                break;
+            case "Modify":
+                ComponentMaintenancePanel aP = (ComponentMaintenancePanel)itsMainFrame.registerPlugin("nl.astron.lofar.sas.otb.panels.ComponentMaintenancePanel", true, true);
+                if (aP != null) {
+                    itsMainFrame.showPanel(aP.getFriendlyName());
+                }
+                break;
+            case "Build TemplateTree":
+                int nodeID=itsMainFrame.getSharedVars().getComponentID();
+                short classifID;
+                try {
+                    classifID = OtdbRmi.getRemoteTypes().getClassif("operational");
+                    if (OtdbRmi.getRemoteMaintenance().isTopComponent(nodeID)) {
+                        int newTreeID=OtdbRmi.getRemoteMaintenance().buildTemplateTree(nodeID,classifID);
+                        if (newTreeID > 0) {
+                            JOptionPane.showMessageDialog(this,"New Tree created with ID: "+newTreeID,
+                                "New Tree Message",
+                                JOptionPane.INFORMATION_MESSAGE);
+                            itsMainFrame.getSharedVars().setTreeID(newTreeID);
+                            // set changed flag to reload mainpanel
+                            itsMainFrame.setChanged(this.getFriendlyName(),true);
+                            checkChanged();
+                        } else {
+                            String aS="No Template Tree created!!!";
+                            logger.error(aS);
+                            LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                        }
+                    }
+                } catch (RemoteException ex) {
+                    String aS="Remote error during Build TemplateTree: "+ ex;
+                    logger.error(aS);
+                    LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                }
+                break;
+            case "Delete":
+                if (JOptionPane.showConfirmDialog(this,"Are you sure you want to delete this component(s): ?","Delete Component",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+                    try {
+                        int[] componentIDs=getSelectedTreeIDs();
+                        for (int i=0;i< componentIDs.length;i++) {
+                            if (!OtdbRmi.getRemoteMaintenance().deleteComponentNode(componentIDs[i])) {
+                                String aS="Failed to delete component: "+componentIDs[i];
                                 logger.error(aS);
-                                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                                LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                            } else {
+                                // set changed flag to reload mainpanel
+                               itsMainFrame.setChanged(this.getFriendlyName(),true);
+                               checkChanged();
                             }
-                            itsMainFrame.setHourglassCursor();
-                            ((ComponentTableModel) ComponentsPanel.getTableModel()).fillTable();
-                            itsMainFrame.setNormalCursor();
                         }
-                        break;
+                    } catch (RemoteException ex) {
+                        String aS="Remote error during deleteComponents: "+ ex;
+                        logger.error(aS);
+                        LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                    }
+                    itsMainFrame.setHourglassCursor();
+                    ((ComponentTableModel)ComponentsPanel.getTableModel()).fillTable();
+                    itsMainFrame.setNormalCursor();
                 }
                 break;
+        }
+                break;
             case "Query Results":
                 itsMainFrame.ToDo();
                 break;
             default:
-                logger.debug("Other command found: " + aButton);
+                logger.debug("Other command found: "+aButton);
                 break;
         }
     }
@@ -1324,10 +1296,10 @@ public class MainPanel extends javax.swing.JPanel
      */
     private void viewStateChanges(int treeID) {
         // create tableModel
-        itsStateChangeModel = new StateChangeHistoryTableModel(SharedVars.getOTDBrmi(), treeID);
+        itsStateChangeModel = new StateChangeHistoryTableModel(SharedVars.getOTDBrmi(),treeID);
         // showstateChangeInfo
         if (stateChangeHistoryDialog == null) {
-            stateChangeHistoryDialog = new TableDialog(itsMainFrame, true, itsStateChangeModel, "State change history");
+            stateChangeHistoryDialog = new TableDialog(itsMainFrame,true,itsStateChangeModel, "State change history");
         } else {
             itsStateChangeModel.setTree(treeID);
             stateChangeHistoryDialog.setModel(itsStateChangeModel);
@@ -1340,6 +1312,7 @@ public class MainPanel extends javax.swing.JPanel
 
     }
 
+
     /** Launch multiEditDialog,
      *
      * @param  treeIDs  The IDs of the chosen trees.
@@ -1347,13 +1320,13 @@ public class MainPanel extends javax.swing.JPanel
     private boolean viewInfo(int[] treeIDs) {
         logger.debug("viewInfo for treeID: " + treeIDs);
         //get the selected tree from the database
-        boolean multiple = false;
+        boolean multiple=false;
 
 
         if (treeIDs.length > 0) {
             // show treeInfo dialog
-            if (treeInfoDialog == null) {
-                treeInfoDialog = new TreeInfoDialog(true, treeIDs, itsMainFrame);
+            if (treeInfoDialog == null ) {
+                treeInfoDialog = new TreeInfoDialog(true,treeIDs, itsMainFrame);
             } else {
                 treeInfoDialog.setTree(treeIDs);
             }
@@ -1379,11 +1352,11 @@ public class MainPanel extends javax.swing.JPanel
     private boolean viewMultiEditDialog(int[] treeIDs) {
         logger.debug("viewMultiEditDialog for treeID: " + treeIDs);
         //get the selected tree from the database
-
+       
         if (treeIDs.length > 0) {
             // show multiEdit dialog
-            if (multiEditDialog == null) {
-                multiEditDialog = new MultiEditDialog(true, treeIDs, itsMainFrame);
+            if (multiEditDialog == null ) {
+                multiEditDialog = new MultiEditDialog(true,treeIDs, itsMainFrame);
             } else {
                 multiEditDialog.setTree(treeIDs);
             }
@@ -1395,7 +1368,7 @@ public class MainPanel extends javax.swing.JPanel
             } else {
                 logger.debug("trees have not been changed");
             }
-
+               
         } else {
             logger.debug("no trees selected");
         }
@@ -1406,15 +1379,15 @@ public class MainPanel extends javax.swing.JPanel
      *
      * @param  aList Vector<jDefaultTemplate> all default template names.
      */
-    private boolean createDefaultTemplateDialog(jOTDBtree aTree, ArrayList<jDefaultTemplate> aList) {
+    private boolean createDefaultTemplateDialog(jOTDBtree aTree,ArrayList<jDefaultTemplate> aList) {
         logger.debug("createDefaultTemplateDialog started");
 
         if (itsMainFrame.getSharedVars().getTreeID() > 0) {
-            // show defaultTemplate dialog
-            if (defaultTemplateDialog == null) {
-                defaultTemplateDialog = new CreateDefaultTemplateDialog(true, aList, aTree, itsMainFrame);
+            // show multiEdit dialog
+            if (defaultTemplateDialog == null ) {
+                defaultTemplateDialog = new CreateDefaultTemplateDialog(true,aList,aTree,itsMainFrame);
             } else {
-                defaultTemplateDialog.setNew(aList, aTree);
+                defaultTemplateDialog.setNew(aList,aTree);
             }
             defaultTemplateDialog.setLocationRelativeTo(this);
             defaultTemplateDialog.setVisible(true);
@@ -1432,24 +1405,25 @@ public class MainPanel extends javax.swing.JPanel
         return defaultTemplateDialog.isOk();
     }
 
+    
     /** Launch LoadFileDialog to get a file to work with.
      *
      * @param   aType   PIC-tree or VIC-component
      *
      */
     private boolean getFile(String aType) {
-        File aNewFile = null;
-        String aFileStatus = "";
-        String aFileDescription = "";
-
+        File aNewFile=null;
+        String aFileStatus="";
+        String aFileDescription="";
+        
         // Reset the File info fields
         itsNewFile = null;
-        itsFileDescription = "";
-        itsFileStatus = "";
-
+        itsFileDescription="";
+        itsFileStatus="";
+        
         // show login dialog
-        if (loadFileDialog == null) {
-            loadFileDialog = new LoadFileDialog(itsMainFrame, true, aType);
+        if (loadFileDialog == null ) {
+            loadFileDialog = new LoadFileDialog(itsMainFrame,true,aType);
         } else {
             loadFileDialog.setType(aType);
         }
@@ -1458,10 +1432,10 @@ public class MainPanel extends javax.swing.JPanel
             loadFileDialog.setStatusVisible(false);
         }
         loadFileDialog.setVisible(true);
-        if (loadFileDialog.isOk()) {
+        if(loadFileDialog.isOk()) {
             aFileDescription = loadFileDialog.getDescription();
             aFileStatus = loadFileDialog.getStatus();
-            aNewFile = loadFileDialog.getFile();
+            aNewFile = loadFileDialog.getFile();       
         } else {
             logger.info("No File chosen");
             return false;
@@ -1469,7 +1443,7 @@ public class MainPanel extends javax.swing.JPanel
         if (aNewFile != null && aNewFile.exists()) {
             logger.trace("File to load: " + aNewFile.getName());
             logger.debug("Status: " + aFileStatus);
-            logger.debug("Description: " + aFileDescription);
+            logger.debug("Description: "+ aFileDescription);
             itsNewFile = aNewFile;
             if (aType.equals("VIC-component")) {
                 itsFileStatus = "";
@@ -1481,227 +1455,227 @@ public class MainPanel extends javax.swing.JPanel
         }
         return false;
     }
-
+    
     private void validateButtons() {
         // depending on the tabfocus and the info the selected row contains
         // certain buttons are valid and others need to be grey out
-        jOTDBtree aTree = null;
-        String aTreeState = "";
-        String aClassif = "";
-
-        int treeID = getSelectedTreeID();
-        int componentID = itsMainFrame.getSharedVars().getComponentID();
-        logger.debug("Selected Tree: " + treeID);
+        jOTDBtree aTree=null;
+        String aTreeState="";
+        String aClassif="";
+        
+        int treeID=getSelectedTreeID();
+        int componentID=itsMainFrame.getSharedVars().getComponentID();
+        logger.debug("Selected Tree: "+treeID);
 
         if (treeID > 0) {
             try {
-                aTree = OtdbRmi.getRemoteOTDB().getTreeInfo(treeID, false);
+                aTree      = OtdbRmi.getRemoteOTDB().getTreeInfo(treeID,false);
                 aTreeState = OtdbRmi.getRemoteTypes().getTreeState(aTree.state);
-                aClassif = OtdbRmi.getRemoteTypes().getClassif(aTree.classification);
+                aClassif   = OtdbRmi.getRemoteTypes().getClassif(aTree.classification);
             } catch (RemoteException ex) {
-                String aS = "Couldn't get Tree " + treeID;
+                String aS="Couldn't get Tree "+ treeID;
                 logger.error(aS);
-                LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                 return;
             }
         }
         switch (itsTabFocus) {
             case "PIC":
-                if (treeID > 0) {
+                if (treeID>0) {
                     if (aTreeState.equals("active")) {
-                        buttonPanel1.setButtonEnabled("Delete", false);
+                        buttonPanel1.setButtonEnabled("Delete",false);
                     } else {
-                        buttonPanel1.setButtonEnabled("Delete", true);
+                        buttonPanel1.setButtonEnabled("Delete",true);                    
                     }
-                    buttonPanel1.setButtonEnabled("View", true);
-                    buttonPanel1.setButtonEnabled("Info", true);
-                    buttonPanel1.setButtonEnabled("State History", true);
+                    buttonPanel1.setButtonEnabled("View",true);
+                    buttonPanel1.setButtonEnabled("Info",true);
+                    buttonPanel1.setButtonEnabled("State History",true);
                 } else {
-                    buttonPanel1.setButtonEnabled("State History", false);
-                    buttonPanel1.setButtonEnabled("Delete", false);
-                    buttonPanel1.setButtonEnabled("View", false);
-                    buttonPanel1.setButtonEnabled("Info", false);
+                    buttonPanel1.setButtonEnabled("State History",false);
+                    buttonPanel1.setButtonEnabled("Delete",false);
+                    buttonPanel1.setButtonEnabled("View",false);
+                    buttonPanel1.setButtonEnabled("Info",false);
                 }
                 break;
             case "VIC":
                 if (VICPanel.getSelectedRowCount() > 1) {
-                    multipleSelection = true;
+                    multipleSelection=true;
                 } else {
-                    multipleSelection = false;
+                    multipleSelection=false;
                 }
-                if (treeID > 0) {
+                if (treeID>0) {
                     // !!!!!!!!!!!!!!
                     // Need to see if buttons need to be invalidated under certain states....
                     //
                     if (!multipleSelection) {
-                        buttonPanel1.setButtonEnabled("State History", true);
-                        buttonPanel1.setButtonEnabled("View", true);
-                        buttonPanel1.setButtonEnabled("Query Panel", true);
-                        buttonPanel1.setButtonEnabled("Refresh", true);
+                        buttonPanel1.setButtonEnabled("State History",true);
+                        buttonPanel1.setButtonEnabled("View",true);
+                        buttonPanel1.setButtonEnabled("Query Panel",true);
+                        buttonPanel1.setButtonEnabled("Refresh",true);
                     } else {
-                        buttonPanel1.setButtonEnabled("Query Panel", false);
-                        buttonPanel1.setButtonEnabled("Refresh", false);
-                        buttonPanel1.setButtonEnabled("State History", false);
-                        buttonPanel1.setButtonEnabled("View", false);
+                        buttonPanel1.setButtonEnabled("Query Panel",false);
+                        buttonPanel1.setButtonEnabled("Refresh",false);
+                        buttonPanel1.setButtonEnabled("State History",false);
+                        buttonPanel1.setButtonEnabled("View",false);
                     }
-                    buttonPanel1.setButtonEnabled("Delete", true);
-                    buttonPanel1.setButtonEnabled("Schedule", true);
+                    buttonPanel1.setButtonEnabled("Delete",true);
+                    buttonPanel1.setButtonEnabled("Schedule",true);
                 } else {
-                    buttonPanel1.setButtonEnabled("Delete", false);
-                    buttonPanel1.setButtonEnabled("View", false);
-                    buttonPanel1.setButtonEnabled("State History", false);
-                    buttonPanel1.setButtonEnabled("Schedule", false);
+                    buttonPanel1.setButtonEnabled("Delete",false);
+                    buttonPanel1.setButtonEnabled("View",false);
+                    buttonPanel1.setButtonEnabled("State History",false);
+                    buttonPanel1.setButtonEnabled("Schedule",false);
                 }
                 break;
             case "Templates":
                 if (TemplatesPanel.getSelectedRowCount() > 1) {
-                    multipleSelection = true;
+                    multipleSelection=true;
                 } else {
-                    multipleSelection = false;
+                    multipleSelection=false;
                 }
                 if (treeID > 0) {
-                    if ((aTreeState.equals("idle")
-                            || aTreeState.equals("described")
-                            || aTreeState.equals("prepared")
-                            || aTreeState.equals("approved")) && !multipleSelection) {
-                        buttonPanel1.setButtonEnabled("Duplicate", true);
-                        buttonPanel1.setButtonEnabled("Modify", true);
-                        buttonPanel1.setButtonEnabled("Set to Default", true);
-                        buttonPanel1.setButtonEnabled("Query Panel", true);
+                    if ((aTreeState.equals("idle") ||
+                            aTreeState.equals("described") ||
+                            aTreeState.equals("prepared") ||
+                            aTreeState.equals("approved")) && !multipleSelection) {
+                        buttonPanel1.setButtonEnabled("Duplicate",true);
+                        buttonPanel1.setButtonEnabled("Modify",true);
+                        buttonPanel1.setButtonEnabled("Set to Default",true);
+                        buttonPanel1.setButtonEnabled("Query Panel",true);
                         if (aTreeState.equals("approved") || aTreeState.equals("on_hold") || aTreeState.equals("prescheduled")) {
-                            buttonPanel1.setButtonEnabled("Build VIC tree", true);
+                            buttonPanel1.setButtonEnabled("Build VIC tree",true);
                         } else {
-                            buttonPanel1.setButtonEnabled("Build VIC tree", false);
+                            buttonPanel1.setButtonEnabled("Build VIC tree",false);
                         }
                     } else {
-                        buttonPanel1.setButtonEnabled("Duplicate", false);
-                        buttonPanel1.setButtonEnabled("Modify", false);
-                        buttonPanel1.setButtonEnabled("Set to Default", false);
+                        buttonPanel1.setButtonEnabled("Duplicate",false);
+                        buttonPanel1.setButtonEnabled("Modify",false);                                        
+                        buttonPanel1.setButtonEnabled("Set to Default",false);
                     }
                     if (multipleSelection) {
-                        buttonPanel1.setButtonEnabled("State History", false);
-                        buttonPanel1.setButtonEnabled("Duplicate", false);
-                        buttonPanel1.setButtonEnabled("Modify", false);
-                        buttonPanel1.setButtonEnabled("MultiEdit", true);
-                        buttonPanel1.setButtonEnabled("Query Panel", false);
-                        buttonPanel1.setButtonEnabled("Refresh", false);
+                        buttonPanel1.setButtonEnabled("State History",false);
+                        buttonPanel1.setButtonEnabled("Duplicate",false);
+                        buttonPanel1.setButtonEnabled("Modify",false);
+                        buttonPanel1.setButtonEnabled("MultiEdit",true);
+                        buttonPanel1.setButtonEnabled("Query Panel",false);
+                        buttonPanel1.setButtonEnabled("Refresh",false);
                     } else {
-                        buttonPanel1.setButtonEnabled("State History", true);
-                        buttonPanel1.setButtonEnabled("Duplicate", true);
-                        buttonPanel1.setButtonEnabled("Modify", true);
-                        buttonPanel1.setButtonEnabled("MultiEdit", false);
-                        buttonPanel1.setButtonEnabled("Query Panel", true);
-                        buttonPanel1.setButtonEnabled("Refresh", true);
+                        buttonPanel1.setButtonEnabled("State History",true);
+                        buttonPanel1.setButtonEnabled("Duplicate",true);
+                        buttonPanel1.setButtonEnabled("Modify",true);
+                        buttonPanel1.setButtonEnabled("MultiEdit",false);
+                        buttonPanel1.setButtonEnabled("Query Panel",true);
+                        buttonPanel1.setButtonEnabled("Refresh",true);
                     }
-                    buttonPanel1.setButtonEnabled("Delete", true);
-                    buttonPanel1.setButtonEnabled("Change Status", true);
+                    buttonPanel1.setButtonEnabled("Delete",true);
+                    buttonPanel1.setButtonEnabled("Change Status",true);
                 } else {
-                    buttonPanel1.setButtonEnabled("Duplicate", false);
-                    buttonPanel1.setButtonEnabled("State History", false);
-                    buttonPanel1.setButtonEnabled("Modify", false);
-                    buttonPanel1.setButtonEnabled("Delete", false);
-                    buttonPanel1.setButtonEnabled("Change Status", false);
-                    buttonPanel1.setButtonEnabled("Build VIC tree", false);
-                    buttonPanel1.setButtonEnabled("Set to Default", false);
+                    buttonPanel1.setButtonEnabled("Duplicate",false);
+                    buttonPanel1.setButtonEnabled("State History",false);
+                    buttonPanel1.setButtonEnabled("Modify",false);
+                    buttonPanel1.setButtonEnabled("Delete",false);                
+                    buttonPanel1.setButtonEnabled("Change Status",false);  
+                    buttonPanel1.setButtonEnabled("Build VIC tree",false);
+                    buttonPanel1.setButtonEnabled("Set to Default",false);
                 }
                 break;
             case "Default Templates":
                 if (DefaultTemplatesPanel.getSelectedRowCount() > 1) {
-                    multipleSelection = true;
+                    multipleSelection=true;
                 } else {
-                    multipleSelection = false;
+                    multipleSelection=false;
                 }
                 if (treeID > 0) {
-                    if ((aTreeState.equals("idle")
-                            || aTreeState.equals("described")
-                            || aTreeState.equals("prepared")
-                            || aTreeState.equals("approved")) && !multipleSelection) {
-                        buttonPanel1.setButtonEnabled("Duplicate", true);
-                        buttonPanel1.setButtonEnabled("Modify", true);
+                    if ((aTreeState.equals("idle") ||
+                            aTreeState.equals("described") ||
+                            aTreeState.equals("prepared") ||
+                            aTreeState.equals("approved")) && !multipleSelection) {
+                        buttonPanel1.setButtonEnabled("Duplicate",true);
+                        buttonPanel1.setButtonEnabled("Modify",true);
                     } else {
-                        buttonPanel1.setButtonEnabled("Duplicate", false);
-                        buttonPanel1.setButtonEnabled("Modify", false);
+                        buttonPanel1.setButtonEnabled("Duplicate",false);
+                        buttonPanel1.setButtonEnabled("Modify",false);
                     }
                     if (multipleSelection) {
-                        buttonPanel1.setButtonEnabled("State History", false);
-                        buttonPanel1.setButtonEnabled("Duplicate", false);
-                        buttonPanel1.setButtonEnabled("Modify", false);
-                        buttonPanel1.setButtonEnabled("Change Status", false);
+                        buttonPanel1.setButtonEnabled("State History",false);
+                        buttonPanel1.setButtonEnabled("Duplicate",false);
+                        buttonPanel1.setButtonEnabled("Modify",false);
                     } else {
-                        buttonPanel1.setButtonEnabled("State History", true);
-                        buttonPanel1.setButtonEnabled("Duplicate", true);
-                        buttonPanel1.setButtonEnabled("Modify", true);
-                        buttonPanel1.setButtonEnabled("Change Status", true);
+                        buttonPanel1.setButtonEnabled("State History",true);
+                        buttonPanel1.setButtonEnabled("Duplicate",true);
+                        buttonPanel1.setButtonEnabled("Modify",true);
                     }
-                    buttonPanel1.setButtonEnabled("Remove from Default", true);
+                    buttonPanel1.setButtonEnabled("Change Status",true);
                 } else {
-                    buttonPanel1.setButtonEnabled("Duplicate", false);
-                    buttonPanel1.setButtonEnabled("Modify", false);
-                    buttonPanel1.setButtonEnabled("State History", false);
-                    buttonPanel1.setButtonEnabled("Change Status", false);
-                    buttonPanel1.setButtonEnabled("Remove from Default", false);
-                }
-                break;
+                    buttonPanel1.setButtonEnabled("Duplicate",false);
+                    buttonPanel1.setButtonEnabled("Modify",false);
+                    buttonPanel1.setButtonEnabled("State History",false);
+                    buttonPanel1.setButtonEnabled("Change Status",false);
+               }break;
             case "Components":
                 if (ComponentsPanel.getSelectedRowCount() > 1) {
-                    multipleSelection = true;
+                    multipleSelection=true;
                 } else {
-                    multipleSelection = false;
+                    multipleSelection=false;
                 }
-                if (componentID > 0) {
+                if (componentID > 0 ) {
                     if (multipleSelection) {
-                        buttonPanel1.setButtonEnabled("Modify", false);
-                        buttonPanel1.setButtonEnabled("Query Panel", false);
-                        buttonPanel1.setButtonEnabled("New", false);
-                        buttonPanel1.setButtonEnabled("Refresh", false);
-                        buttonPanel1.setButtonEnabled("Build TemplateTree", false);
+                        buttonPanel1.setButtonEnabled("Modify",false);
+                        buttonPanel1.setButtonEnabled("Query Panel",false);
+                        buttonPanel1.setButtonEnabled("New",false);
+                        buttonPanel1.setButtonEnabled("Refresh",false);
+                        buttonPanel1.setButtonEnabled("Build TemplateTree",false);
                     } else {
-                        buttonPanel1.setButtonEnabled("Modify", true);
-                        buttonPanel1.setButtonEnabled("Query Panel", true);
-                        buttonPanel1.setButtonEnabled("New", true);
-                        buttonPanel1.setButtonEnabled("Refresh", true);
-                        buttonPanel1.setButtonEnabled("Build TemplateTree", true);
+                        buttonPanel1.setButtonEnabled("Modify",true);
+                        buttonPanel1.setButtonEnabled("Query Panel",true);
+                        buttonPanel1.setButtonEnabled("New",true);
+                        buttonPanel1.setButtonEnabled("Refresh",true);
+                        buttonPanel1.setButtonEnabled("Build TemplateTree",true);
                         try {
                             if (OtdbRmi.getRemoteMaintenance().isTopComponent(componentID)) {
-                                buttonPanel1.setButtonEnabled("Build TemplateTree", true);
+                                buttonPanel1.setButtonEnabled("Build TemplateTree",true);
                             } else {
-                                buttonPanel1.setButtonEnabled("Build TemplateTree", false);
+                                buttonPanel1.setButtonEnabled("Build TemplateTree",false);
                             }
                         } catch (RemoteException ex) {
-                            String aS = "Error checking isTopComponent";
+                            String aS="Error checking isTopComponent";
                             logger.error(aS);
-                            LofarUtils.showErrorPanel(this, aS, new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
+                            LofarUtils.showErrorPanel(this,aS,new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_warn.gif")));
                         }
                     }
-                    buttonPanel1.setButtonEnabled("Delete", true);
+                    buttonPanel1.setButtonEnabled("Delete",true);
                 } else {
-                    buttonPanel1.setButtonEnabled("Delete", false);
-                    buttonPanel1.setButtonEnabled("Modify", false);
-                    buttonPanel1.setButtonEnabled("Query Panel", false);
-                    buttonPanel1.setButtonEnabled("New", false);
-                    buttonPanel1.setButtonEnabled("Refresh", false);
-                    buttonPanel1.setButtonEnabled("Build TemplateTree", false);
+                    buttonPanel1.setButtonEnabled("Delete",false);
+                    buttonPanel1.setButtonEnabled("Modify",false);
+                    buttonPanel1.setButtonEnabled("Query Panel",false);
+                    buttonPanel1.setButtonEnabled("New",false);
+                    buttonPanel1.setButtonEnabled("Refresh",false);
+                    buttonPanel1.setButtonEnabled("Build TemplateTree",false);
                 }
                 break;
             case "Query Results":
                 break;
         }
     }
-    private MainFrame itsMainFrame = null;
-    private String itsTabFocus = "PIC";
-    private boolean buttonsInitialized = false;
-    private LoadFileDialog loadFileDialog = null;
-    private TreeInfoDialog treeInfoDialog = null;
-    private MultiEditDialog multiEditDialog = null;
+    
+    private MainFrame                   itsMainFrame = null;
+    private String                      itsTabFocus="PIC";
+    private boolean                     buttonsInitialized=false;
+    private LoadFileDialog              loadFileDialog = null;
+    private TreeInfoDialog              treeInfoDialog = null;
+    private MultiEditDialog             multiEditDialog = null;
     private CreateDefaultTemplateDialog defaultTemplateDialog = null;
-    private TableDialog stateChangeHistoryDialog = null;
+    private TableDialog                 stateChangeHistoryDialog = null;
     private StateChangeHistoryTableModel itsStateChangeModel = null;
-    private boolean changed = false;
-    private boolean multipleSelection = false;
+    private boolean                     changed=false;
+    private boolean                     multipleSelection=false;
+    
     // File to be loaded info
-    File itsNewFile = null;
-    String itsFileDescription = "";
+    File itsNewFile=null;
+    String itsFileDescription="";
     String itsFileStatus = "";
+            
+    
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JPanel AdminPanel;
     private nl.astron.lofar.sas.otbcomponents.TablePanel ComponentsPanel;
@@ -1713,4 +1687,5 @@ public class MainPanel extends javax.swing.JPanel
     private nl.astron.lofar.sas.otbcomponents.ButtonPanel buttonPanel1;
     private javax.swing.JTabbedPane jTabbedPane1;
     // End of variables declaration//GEN-END:variables
+    
 }
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamConfigurationTableModel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamConfigurationTableModel.java
index 637c406b936468e7cd8e559624f782582bf263e7..e2f9b7b94ca2a9177897774515df81f55b42597f 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamConfigurationTableModel.java
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/tablemodels/BeamConfigurationTableModel.java
@@ -61,6 +61,7 @@ public class BeamConfigurationTableModel extends javax.swing.table.DefaultTableM
         this.addColumn("coordtype");
         this.addColumn("#TAB");
         this.addColumn("subbands");
+        this.addColumn("beamlets");
     }
     
     /** fills the table with the initial settings
@@ -137,7 +138,8 @@ public class BeamConfigurationTableModel extends javax.swing.table.DefaultTableM
                              aBeam.getAngle2(),
                              aBeam.getCoordType(),
                              aBeam.getNrTiedArrayBeams(),
-                             aBeam.getSubbandList() };
+                             aBeam.getSubbandList(),
+                             aBeam.getBeamletList() };
         this.addRow(newRow);
         itsBeams.trimToSize();
 
@@ -169,6 +171,7 @@ public class BeamConfigurationTableModel extends javax.swing.table.DefaultTableM
         this.setValueAt(newBeam.getCoordType(),row,3);
         this.setValueAt(newBeam.getNrTiedArrayBeams(),row,5);
         this.setValueAt(newBeam.getSubbandList(),row,6);
+        this.setValueAt(newBeam.getBeamletList(),row,7);
         
         isChanged=true;
 
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.form
index b41add2590a183726a1835d99d29c28ed980ac93..a1ff016b431d68b4b3b6028720b44e4b5e4a18cd 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.form
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.form
@@ -107,14 +107,25 @@
                               <EmptySpace max="-2" attributes="0"/>
                           </Group>
                           <Group type="102" alignment="1" attributes="0">
-                              <Component id="labelSubbandList" pref="102" max="32767" attributes="1"/>
-                              <EmptySpace type="separate" max="-2" attributes="0"/>
-                              <Component id="inputSubbandList" min="-2" pref="1077" max="-2" attributes="1"/>
+                              <Group type="103" groupAlignment="0" attributes="0">
+                                  <Group type="102" alignment="0" attributes="0">
+                                      <Component id="labelSubbandList" pref="87" max="32767" attributes="1"/>
+                                      <EmptySpace type="separate" max="-2" attributes="0"/>
+                                  </Group>
+                                  <Group type="102" alignment="0" attributes="0">
+                                      <Component id="labelBeamletList" min="-2" max="-2" attributes="1"/>
+                                      <EmptySpace min="-2" pref="45" max="-2" attributes="0"/>
+                                  </Group>
+                              </Group>
+                              <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                                  <Component id="inputBeamletList" max="32767" attributes="1"/>
+                                  <Component id="inputSubbandList" alignment="0" pref="1077" max="32767" attributes="1"/>
+                              </Group>
                               <EmptySpace min="-2" pref="665" max="-2" attributes="0"/>
                           </Group>
                           <Group type="102" alignment="0" attributes="0">
                               <Component id="jPanel3" min="-2" pref="1201" max="-2" attributes="1"/>
-                              <EmptySpace pref="661" max="32767" attributes="0"/>
+                              <EmptySpace pref="646" max="32767" attributes="0"/>
                           </Group>
                       </Group>
                   </Group>
@@ -162,7 +173,12 @@
                           <Component id="labelSubbandList" alignment="3" min="-2" max="-2" attributes="0"/>
                           <Component id="inputSubbandList" alignment="3" min="-2" max="-2" attributes="0"/>
                       </Group>
-                      <EmptySpace min="-2" pref="49" max="-2" attributes="0"/>
+                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="3" attributes="0">
+                          <Component id="labelBeamletList" alignment="3" min="-2" max="-2" attributes="0"/>
+                          <Component id="inputBeamletList" alignment="3" min="-2" max="-2" attributes="0"/>
+                      </Group>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
                       <Component id="jPanel3" min="-2" pref="267" max="-2" attributes="1"/>
                       <EmptySpace min="-2" pref="94" max="-2" attributes="0"/>
                       <Group type="103" groupAlignment="3" attributes="0">
@@ -208,6 +224,13 @@
             </Component>
             <Component class="javax.swing.JTextField" name="inputSubbandList">
             </Component>
+            <Component class="javax.swing.JLabel" name="labelBeamletList">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Beamlets :"/>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JTextField" name="inputBeamletList">
+            </Component>
             <Component class="javax.swing.JButton" name="cancelButton">
               <Properties>
                 <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
@@ -288,7 +311,7 @@
                 <DimensionLayout dim="1">
                   <Group type="103" groupAlignment="0" attributes="0">
                       <Group type="102" alignment="1" attributes="0">
-                          <Component id="TABConfigurationPanel" pref="202" max="32767" attributes="0"/>
+                          <Component id="TABConfigurationPanel" pref="201" max="32767" attributes="0"/>
                           <EmptySpace type="separate" max="-2" attributes="0"/>
                           <Group type="103" groupAlignment="3" attributes="0">
                               <Component id="addTiedArrayBeamButton" alignment="3" min="-2" max="-2" attributes="0"/>
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.java
index 60c7b3ddd62ff1f43306b89adc25768e985a5dba..2d4b0ba1a1e028838706b296c69f7a33138ac002 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.java
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/BeamDialog.java
@@ -21,6 +21,7 @@
 
 package nl.astron.lofar.sas.otbcomponents;
 import java.util.ArrayList;
+import java.util.BitSet;
 import javax.swing.JOptionPane;
 import javax.swing.ListSelectionModel;
 import javax.swing.border.TitledBorder;
@@ -48,17 +49,20 @@ public class BeamDialog extends javax.swing.JDialog {
      *
      * @param   parent                  Frame where this dialog belongs
      * @param   modal                   Should the Dialog be modal or not
+     * @param   usedBeamlets            Bitset of all used beamlets(in case edit, the old ones have been xorred allready)
      * @param   selection               Vector of all Beam parameters
      * @param   directionTypeChoices    String with all possible choices + default for combobox
      * @param   edit                    indicates edit or add mode
      * @param   show                    indicates show only mode
      */
-    public BeamDialog(java.awt.Frame parent, String treeType, boolean modal,Beam aBeam, boolean edit, boolean show ) {
+    public BeamDialog(java.awt.Frame parent, String treeType, boolean modal,BitSet usedBeamlets, Beam aBeam, boolean edit, boolean show ) {
 
         super(parent, modal);
         initComponents();
         LofarUtils.setPopupComboChoices(inputDirectionTypes,aBeam.getDirectionTypeChoices());
         itsBeam = aBeam;
+        itsSavedBeamlets=(BitSet)usedBeamlets.clone();
+        itsUsedBeamlets=(BitSet)usedBeamlets.clone();
         editting=edit;
         showing=show;
         itsTreeType = treeType;
@@ -95,6 +99,29 @@ public class BeamDialog extends javax.swing.JDialog {
         return true;
     }
 
+    // check if Beamlets are spelled correctly and if Beamlets are not used by other Beams'
+    private boolean checkBeamlets(){
+        if (inputBeamletList.getText().length() <=2) {
+            return true;
+        }
+        
+        BitSet aBitSet = LofarUtils.beamletToBitSet(LofarUtils.expandedArrayString(inputBeamletList.getText()));
+        if(itsUsedBeamlets.intersects(aBitSet)) {
+            return false;
+        } else {
+            itsUsedBeamlets.or(aBitSet);
+        }
+        return true;
+    }
+
+    // check if nr of beamlets used and nr of subbands used are equal
+    private boolean checkNrOfBeamletsAndSubbands() {
+        if (LofarUtils.nrArrayStringElements(inputBeamletList.getText())!= LofarUtils.nrArrayStringElements(inputSubbandList.getText()) ) {
+            return false;
+        }
+
+        return true;
+    }
     
     private void initialize() {
         
@@ -117,6 +144,7 @@ public class BeamDialog extends javax.swing.JDialog {
         inputAngle2.setText(itsBeam.getAngle2());
         coordTypeChange.setSelectedItem(itsBeam.getCoordType());
         inputSubbandList.setText(itsBeam.getSubbandList());
+        inputBeamletList.setText(itsBeam.getBeamletList());
         inputDuration.setText(itsBeam.getDuration());
         inputTarget.setText(itsBeam.getTarget());
         inputStartTime.setText(itsBeam.getStartTime());
@@ -143,6 +171,7 @@ public class BeamDialog extends javax.swing.JDialog {
         inputAngle2.setEnabled(flag);
         coordTypeChange.setEnabled(flag);
         inputSubbandList.setEnabled(flag);
+        inputBeamletList.setEnabled(flag);
         inputDuration.setEnabled(flag);
         inputTarget.setEnabled(flag);
         inputStartTime.setEnabled(flag);
@@ -154,6 +183,10 @@ public class BeamDialog extends javax.swing.JDialog {
         return isChanged;
     }
     
+    public BitSet getBeamletList() {
+        return itsUsedBeamlets;
+    }
+    
     public void setBorderTitle(String text) {
         TitledBorder aBorder=(TitledBorder)jPanel1.getBorder();
         aBorder.setTitle(text);
@@ -179,6 +212,8 @@ public class BeamDialog extends javax.swing.JDialog {
         inputAngle2 = new javax.swing.JTextField();
         labelSubbandList = new javax.swing.JLabel();
         inputSubbandList = new javax.swing.JTextField();
+        labelBeamletList = new javax.swing.JLabel();
+        inputBeamletList = new javax.swing.JTextField();
         cancelButton = new javax.swing.JButton();
         saveButton = new javax.swing.JButton();
         labelDirectionTypes = new javax.swing.JLabel();
@@ -220,6 +255,8 @@ public class BeamDialog extends javax.swing.JDialog {
 
         labelSubbandList.setText("Subbands :");
 
+        labelBeamletList.setText("Beamlets :");
+
         cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nl/astron/lofar/sas/otb/icons/16_cancel.png"))); // NOI18N
         cancelButton.setText("Cancel");
         cancelButton.addActionListener(new java.awt.event.ActionListener() {
@@ -301,7 +338,7 @@ public class BeamDialog extends javax.swing.JDialog {
         jPanel3Layout.setVerticalGroup(
             jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
             .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3Layout.createSequentialGroup()
-                .add(TABConfigurationPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
+                .add(TABConfigurationPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE)
                 .add(18, 18, 18)
                 .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                     .add(addTiedArrayBeamButton)
@@ -361,13 +398,20 @@ public class BeamDialog extends javax.swing.JDialog {
                             .add(org.jdesktop.layout.GroupLayout.LEADING, labelNrTabRings, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                         .addContainerGap())
                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
-                        .add(labelSubbandList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)
-                        .add(18, 18, 18)
-                        .add(inputSubbandList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1077, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+                            .add(jPanel1Layout.createSequentialGroup()
+                                .add(labelSubbandList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
+                                .add(18, 18, 18))
+                            .add(jPanel1Layout.createSequentialGroup()
+                                .add(labelBeamletList)
+                                .add(45, 45, 45)))
+                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
+                            .add(inputBeamletList)
+                            .add(inputSubbandList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1077, Short.MAX_VALUE))
                         .add(665, 665, 665))
                     .add(jPanel1Layout.createSequentialGroup()
                         .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1201, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
-                        .addContainerGap(661, Short.MAX_VALUE))))
+                        .addContainerGap(646, Short.MAX_VALUE))))
         );
         jPanel1Layout.setVerticalGroup(
             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
@@ -404,7 +448,11 @@ public class BeamDialog extends javax.swing.JDialog {
                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                     .add(labelSubbandList)
                     .add(inputSubbandList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
-                .add(49, 49, 49)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
+                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                    .add(labelBeamletList)
+                    .add(inputBeamletList, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+                .add(18, 18, 18)
                 .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 267, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                 .add(94, 94, 94)
                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
@@ -434,12 +482,33 @@ public class BeamDialog extends javax.swing.JDialog {
     private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
         //check if input is correct
         checkChanged();
-        if (hasChanged() && !checkSubbands()) {
-            if (JOptionPane.showConfirmDialog(this,"There is an error in the SubbandsList , Only subbands 1-511 can be used. continueing discards all changes. Continue?","SubbandNr Error",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+        if (hasChanged() && !checkBeamlets()) {
+            if (JOptionPane.showConfirmDialog(this,"There is an error in the beamletList, some of them are allready in use by other Beams. continueing discards all changes. Continue?","Beamlet Error",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+                itsUsedBeamlets=(BitSet)itsSavedBeamlets.clone();
+                isChanged=false;
+                setVisible(false);
+                dispose();
+            } else {
+                itsUsedBeamlets=(BitSet)itsSavedBeamlets.clone();
+                return;
+            }
+        } else if (hasChanged() && !checkSubbands()) {
+            if (JOptionPane.showConfirmDialog(this,"There is an error in the SubbandsList , Only subbands 1-511 can be used. continueing discards all changes. Continue?","Beamlet Error",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+                itsUsedBeamlets=(BitSet)itsSavedBeamlets.clone();
                 isChanged=false;
                 setVisible(false);
                 dispose();
             } else {
+                itsUsedBeamlets=(BitSet)itsSavedBeamlets.clone();
+                return;
+            }
+
+        } else if (hasChanged() && !checkNrOfBeamletsAndSubbands() ) {
+            if (JOptionPane.showConfirmDialog(this,"The number of beamlets and subbands differ.","Beamlet-subband amount differ  Error",JOptionPane.OK_CANCEL_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.OK_OPTION ) {
+                setVisible(false);
+                dispose();
+            } else {
+                itsUsedBeamlets=(BitSet)itsSavedBeamlets.clone();
                 return;
             }
 
@@ -454,6 +523,7 @@ public class BeamDialog extends javax.swing.JDialog {
 
     private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
         isChanged=false;
+        itsUsedBeamlets=(BitSet)itsSavedBeamlets.clone();
         setVisible(false);
         TABConfigurationPanel=null;
         itsTABConfigurationTableModel = null;
@@ -556,6 +626,10 @@ public class BeamDialog extends javax.swing.JDialog {
             isChanged=true;
             return;
         }
+        if (!itsBeam.getBeamletList().equals(inputBeamletList.getText())) {
+            isChanged=true;
+            return;
+        }
         if (!itsBeam.getDuration().equals(inputDuration.getText())) {
             isChanged=true;
             return;
@@ -595,6 +669,7 @@ public class BeamDialog extends javax.swing.JDialog {
         itsBeam.setDuration(inputDuration.getText());
         itsBeam.setStartTime(inputStartTime.getText());
         itsBeam.setSubbandList(LofarUtils.compactedArrayString(inputSubbandList.getText()));
+        itsBeam.setBeamletList(LofarUtils.compactedArrayString(inputBeamletList.getText()));
         itsBeam.setNrTabRings(inputNrTabRings.getText());
         itsBeam.setTabRingSize(inputTabRingSize.getText());
         itsBeam.setNrTiedArrayBeams(Integer.toString(itsTiedArrayBeams.size()-offset));
@@ -605,6 +680,7 @@ public class BeamDialog extends javax.swing.JDialog {
     private void deleteTiedArrayBeam() {
         itsSelectedRow = TABConfigurationPanel.getSelectedRow();
         if (JOptionPane.showConfirmDialog(this,"Are you sure you want to delete this TAB ?","Delete TAB",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+            // if removed then the old Beamlets's should be removed form the checklist also
             if (itsSelectedRow > -1) {
                 itsTABConfigurationTableModel.removeRow(itsSelectedRow);
                 // No selection anymore after delete, so buttons disabled again
@@ -661,6 +737,8 @@ public class BeamDialog extends javax.swing.JDialog {
     private boolean   editTiedArrayBeam = false;
     private boolean   editting          = false;
     private boolean   showing           = false;
+    private BitSet    itsUsedBeamlets   = null;
+    private BitSet    itsSavedBeamlets  = null;
     private String    itsTreeType       = null;
     
     private TiedArrayBeamConfigurationTableModel itsTABConfigurationTableModel = null;
@@ -675,6 +753,7 @@ public class BeamDialog extends javax.swing.JDialog {
     private javax.swing.JButton editTiedArrayBeamButton;
     private javax.swing.JTextField inputAngle1;
     private javax.swing.JTextField inputAngle2;
+    private javax.swing.JTextField inputBeamletList;
     private javax.swing.JComboBox inputDirectionTypes;
     private javax.swing.JTextField inputDuration;
     private javax.swing.JTextField inputNrTabRings;
@@ -687,6 +766,7 @@ public class BeamDialog extends javax.swing.JDialog {
     private javax.swing.JScrollPane jScrollPane1;
     private javax.swing.JLabel labelAngle1;
     private javax.swing.JLabel labelAngle2;
+    private javax.swing.JLabel labelBeamletList;
     private javax.swing.JLabel labelDirectionTypes;
     private javax.swing.JLabel labelDuration;
     private javax.swing.JLabel labelNrTabRings;
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CreateDefaultTemplateDialog.form b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CreateDefaultTemplateDialog.form
index 290ea233931b17d8da87eea60f54a0a5ca4730fe..85269c318866506307d3ce92ab90a6ce9061750a 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CreateDefaultTemplateDialog.form
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CreateDefaultTemplateDialog.form
@@ -75,7 +75,7 @@
     <Component class="javax.swing.JTextField" name="nameInput">
       <Constraints>
         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
-          <AbsoluteConstraints x="220" y="200" width="300" height="-1"/>
+          <AbsoluteConstraints x="170" y="200" width="300" height="-1"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -92,7 +92,7 @@
     <Component class="javax.swing.JTextField" name="processTypeInput">
       <Constraints>
         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
-          <AbsoluteConstraints x="220" y="230" width="300" height="-1"/>
+          <AbsoluteConstraints x="170" y="230" width="300" height="-1"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -109,7 +109,7 @@
     <Component class="javax.swing.JTextField" name="processSubtypeInput">
       <Constraints>
         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
-          <AbsoluteConstraints x="220" y="260" width="300" height="-1"/>
+          <AbsoluteConstraints x="170" y="260" width="300" height="-1"/>
         </Constraint>
       </Constraints>
     </Component>
@@ -126,7 +126,7 @@
     <Component class="javax.swing.JTextField" name="strategyInput">
       <Constraints>
         <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
-          <AbsoluteConstraints x="220" y="290" width="300" height="-1"/>
+          <AbsoluteConstraints x="170" y="290" width="300" height="-1"/>
         </Constraint>
       </Constraints>
     </Component>
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CreateDefaultTemplateDialog.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CreateDefaultTemplateDialog.java
index c19b6155fffdb1bf1b2d0d701ac587d0f06c88a0..d94e66c2b686c0fc0cfcedba5bc6f0da7356f251 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CreateDefaultTemplateDialog.java
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/CreateDefaultTemplateDialog.java
@@ -116,21 +116,21 @@ public class CreateDefaultTemplateDialog extends javax.swing.JDialog {
             }
         });
         getContentPane().add(jButtonOK, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 350, -1, -1));
-        getContentPane().add(nameInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 200, 300, -1));
+        getContentPane().add(nameInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 200, 300, -1));
 
         jLabel2.setText("ProcessType:");
         getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 230, -1, -1));
-        getContentPane().add(processTypeInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 230, 300, -1));
+        getContentPane().add(processTypeInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 230, 300, -1));
 
         jLabel3.setText("ProcessSubtype:");
         getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 260, -1, -1));
-        getContentPane().add(processSubtypeInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 260, 300, -1));
+        getContentPane().add(processSubtypeInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 260, 300, -1));
 
         jLabel4.setText("Strategy:");
         getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 290, -1, -1));
-        getContentPane().add(strategyInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 290, 300, -1));
+        getContentPane().add(strategyInput, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 290, 300, -1));
 
-        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14));
+        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
         jLabel5.setText("Create new Default Template");
         getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 10, 220, -1));
 
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParamExtensionDialog.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParamExtensionDialog.java
index b338925e885d1babf8551c3f2ad5c9e09e8b0735..d6236d16c01480b65211c71d1e85a2f1a4a75992 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParamExtensionDialog.java
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParamExtensionDialog.java
@@ -1,4 +1,4 @@
-/* ParamExtensionDialog.java
+/* BeamDialog.java
  *
  *  Copyright (C) 2002-2007
  *  ASTRON (Netherlands Foundation for Research in Astronomy)
@@ -40,7 +40,10 @@ public class ParamExtensionDialog extends javax.swing.JDialog {
      *
      * @param   parent                  Frame where this dialog belongs
      * @param   modal                   Should the Dialog be modal or not
+     * @param   usedBeamlets            Bitset of all used beamlets(in case edit, the old ones have been xorred allready)
      * @param   selection               Vector of all Beam parameters
+     * @param   directionTypeChoices    String with all possible choices + default for combobox
+     * @param   edit                    indicates edit or add mode
      */
     public ParamExtensionDialog(java.awt.Frame parent, boolean modal, String[] selection) {
 
diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java
index 0266542a67dea7a472673e9d0d3f0d0a2c49f208..f9a0411a9e6d4c47e92492143fa82480d1e0d0e0 100644
--- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java
+++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/userpanels/ObservationPanel.java
@@ -32,6 +32,7 @@ import java.io.IOException;
 import java.rmi.RemoteException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.BitSet;
 import java.util.Collection;
 import javax.swing.DefaultListModel;
 import javax.swing.JFileChooser;
@@ -486,6 +487,12 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
                    } else {
                         itsActiveBeam.setStartTime(aNode.limits);
                    }break;
+                case "beamletList":
+                    if (isRef && aParam != null) {
+                        itsActiveBeam.setBeamletList(aNode.limits + " : " + aParam.limits);
+                   } else {
+                        itsActiveBeam.setBeamletList(aNode.limits);
+                   }break;
                 case "subbandList":
                     if (isRef && aParam != null) {
                         itsActiveBeam.setSubbandList(aNode.limits + " : " + aParam.limits);
@@ -714,8 +721,13 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
       inputDescription.setText("");
       inputTreeDescription.setText(itsOldTreeDescription);
     
-      // set tables back to initial values
-      boolean fillTable = itsBeamConfigurationTableModel.fillTable(itsTreeType,itsBeamList,false);
+      if (!itsTreeType.equals("VHtree")) {
+         // Observation Beam parameters
+         // create original Beamlet Bitset
+         fillBeamletBitset();
+      }
+        // set tables back to initial values
+        boolean fillTable = itsBeamConfigurationTableModel.fillTable(itsTreeType,itsBeamList,false);
       itsAnaBeamConfigurationTableModel.fillTable(itsTreeType,itsAnaBeamList,false);
       
       itsBeamformerConfigurationTableModel.fillTable(itsTreeType, itsStations);
@@ -750,7 +762,27 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
      // also restore antennaConfigPanel
       antennaConfigPanel.restore();
     }
-   
+
+    
+    /** fill the Beamlet bitset to see what Beamlets have been set. To be able to determine later if a given Beamlet is indeed free.
+     */
+    private void fillBeamletBitset() {
+        itsUsedBeamlets.clear();
+        for (Beam b : itsBeamList) {
+            BitSet aNewBitSet=b.getBeamletBitSet();
+            // check if no duplication between the two bitsets
+            if (itsUsedBeamlets.intersects(aNewBitSet)) {
+                String errorMsg = "ERROR:  This BeamletList has beamlets defined that are allready used in a prior BeamConfiguration!!!!!  Beam: "+b;
+                JOptionPane.showMessageDialog(this,errorMsg,"BeamletError",JOptionPane.ERROR_MESSAGE);
+                logger.debug(errorMsg );
+                return;
+            }
+            
+            // No intersection, both bitsets can be or
+            itsUsedBeamlets.or(aNewBitSet);
+        }
+    }
+    
      
     private void initialize() {
         buttonPanel1.addButton("Restore");
@@ -771,6 +803,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
         beamConfigurationPanel.setColumnSize("coordtype",24);
         beamConfigurationPanel.setColumnSize("#TAB",24);
         beamConfigurationPanel.setColumnSize("subbands",65);
+        beamConfigurationPanel.setColumnSize("beamlets",65);
         beamConfigurationPanel.repaint();
         
         itsAnaBeamConfigurationTableModel = new AnaBeamConfigurationTableModel();
@@ -829,6 +862,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
         }
         
         // set defaults
+        // create initial beamletBitset
         // create initial table
         restore();
         
@@ -1092,6 +1126,9 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
                                 case "subbandList" :
                                     n.limits=b.getSubbandList();
                                     break;
+                                case "beamletList" :
+                                    n.limits=b.getBeamletList();
+                                    break;
                                 case "momID" :
                                     n.limits=b.getMomID();
                                     break;
@@ -1440,8 +1477,11 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
     private void deleteBeam() {
         int row = beamConfigurationPanel.getSelectedRow();
         if (JOptionPane.showConfirmDialog(this,"Are you sure you want to delete this Beam ?","Delete Beam",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION ) {
+            // if removed then the old Beamlets's should be removed form the checklist also
+            BitSet beamletSet = itsBeamConfigurationTableModel.getSelection(row).getBeamletBitSet();
             if (row > -1) {
                 itsBeamConfigurationTableModel.removeRow(row);
+                itsUsedBeamlets.xor(beamletSet);
                 // No selection anymore after delete, so buttons disabled again
                 this.editBeamButton.setEnabled(false);
                 this.deleteBeamButton.setEnabled(false);
@@ -1482,6 +1522,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
 
     private void addBeam() {
      
+        BitSet aBS=itsUsedBeamlets;
         itsSelectedRow=-1;
         itsSelectedRow = beamConfigurationPanel.getSelectedRow();
         // set selection to defaults.
@@ -1489,8 +1530,10 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
         if (editBeam) {
             selection = itsBeamConfigurationTableModel.getSelection(itsSelectedRow);
                        
+            BitSet oldBeamlets = selection.getBeamletBitSet();
+            aBS.xor(oldBeamlets);
         }
-        beamDialog = new BeamDialog(itsMainFrame,itsTreeType,true,selection.clone(),editBeam,showBeam);
+        beamDialog = new BeamDialog(itsMainFrame,itsTreeType,true,aBS,selection.clone(),editBeam,showBeam);
         
         beamDialog.setLocationRelativeTo(this);
         if (editBeam) {
@@ -1507,6 +1550,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
         // check if something has changed 
         if (beamDialog.hasChanged()) {
             Beam newBeam = beamDialog.getBeam();
+            itsUsedBeamlets=beamDialog.getBeamletList();
             // check if we are editting an entry or adding a new entry
             if (editBeam) {
                 itsBeamConfigurationTableModel.updateRow(newBeam,itsSelectedRow);
@@ -1604,6 +1648,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
         // beam0.directionType=AZEL
         // beam0.duration=300
         // beam0.subbandList=[1,2,3,4,5]
+        // beam0.beamletList[1,2,3,4,5]
         // beam0.tiedarraybeam0.angle1 = 1
         // #
         // beam1.target=test2
@@ -1613,6 +1658,7 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
         // beam1.directionType=LMN
         // beam1.duration=360
         // beam1.subbandList=[6..10]
+        // beam1.beamletList[6..10]
         //
         if (choice.equals("AnaBeams") || choice.equals("Beams")) {
             File aNewFile=null;
@@ -1867,6 +1913,17 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
                                 break;
                         }
                         break;
+                    case "beamletlist" :
+                        switch (check) {
+                            case "beam" :
+                                readBeams.get(idx+1).setBeamletList(keyVal[1]);
+                                break;
+                            case "anabeam" :
+                                break;
+                            case "tiedarraybeam" :
+                                break;
+                        }
+                        break;
                     case "nrtiedarraybeams" :
                         switch (check) {
                             case "beam" :
@@ -2704,6 +2761,8 @@ public class ObservationPanel extends javax.swing.JPanel implements IViewPanel{
     // keeps lists of available (unused)  and all used stations for Beamformer creation
     private ArrayList<String>    itsAvailableBeamformStations       = new ArrayList<>();
     private ArrayList<String>    itsUsedBeamformStations            = new ArrayList<>();
+    // each beamlet has its bit in the bitset
+    private BitSet   itsUsedBeamlets = new BitSet(216);
     private boolean  editBeam = false;
     private boolean  editAnaBeam = false;
     private boolean  showBeam = false;
diff --git a/SAS/OTB/jOTDB3/dist-src/startServerOTB b/SAS/OTB/jOTDB3/dist-src/startServerOTB
index 318ea8b5b9a7616dbc9608dca0777a99b2500cd9..2a9ffb964ac4d96ec432b502d3818a1276a4ef89 100755
--- a/SAS/OTB/jOTDB3/dist-src/startServerOTB
+++ b/SAS/OTB/jOTDB3/dist-src/startServerOTB
@@ -1,24 +1,13 @@
 #!/bin/sh
 
-# Check if portnumber is added to commandline; if yes, use it.
-if [ -z $1 ]; then
-  port1=12500
-  port2=12501
-else
-  port1=$1
-  let port2=port1+1
-fi
-echo "Using port $port1 and $port2 for this server"
-
 export OTB_DIR=/opt/sas/otb/server
 export JAVA_HOME=/usr/java/jdk1.7.0_02
 
 echo
 echo --- Starting OTB Server ---
 
-jotdb3file=`ls $OTB_DIR/jOTDB3*.jar | grep -v javadoc | grep -v sources`
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTB_DIR
-export OTB_APP=$OTB_DIR/`basename $jotdb3file`
+export OTB_APP=$OTB_DIR/`basename $OTB_DIR/jOTDB3*.jar`
 export CLASSPATH=$OTB_APP
 
 for JAR_DEPENDENCY in $OTB_DIR/lib/*.jar
@@ -29,15 +18,11 @@ done
 
 echo Starting up ...
 
-curdate=`date +%Y%m%dT%H%M%S`
-logfile="/localhome/log/OTBServer_${port1}_${curdate}.log"
-echo "Logging serverlogs to file $logfile"
 serverpid=0
-ps -ef | grep -v grep | grep java | grep $port1 2>&1 1>/dev/null
+ps -ef | grep -v grep | grep java | grep 12500 2>&1 1>/dev/null
 if [ $? -ne 0 ]; then
-    $JAVA_HOME/bin/java -cp $CLASSPATH nl.astron.lofar.sas.otb.jotdb3.jOTDBserver -s sas001 -d sas001 -p $port1 -o $port2 2>&1 1>&$logfile &
+    $JAVA_HOME/bin/java -cp $CLASSPATH nl.astron.lofar.sas.otb.jotdb3.jOTDBserver -s sas001 -d sas001 -p 12500 -o 12501 &
     serverpid=$!
-    echo Started server with PID: $serverpid
-else
-    echo "Server for port $port1 already running!"
 fi
+
+echo OTB Server stopped.
diff --git a/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jOTDBserver.java b/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jOTDBserver.java
index 4832d9facd8b53a38cb997abcdb7bb554c6e5ce5..f02325806b09ee5bfa215a8f8e9838b432cf91c9 100644
--- a/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jOTDBserver.java
+++ b/SAS/OTB/jOTDB3/src/nl/astron/lofar/sas/otb/jotdb3/jOTDBserver.java
@@ -23,7 +23,6 @@ package nl.astron.lofar.sas.otb.jotdb3;
 
 import com.darwinsys.lang.GetOpt;
 import com.darwinsys.lang.GetOptDesc;
-import java.io.File;
 import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
@@ -68,30 +67,17 @@ public class jOTDBserver {
 
     public static void main(String[] argv)  {
 
-        String logConfig = "jOTDB3.log_prop";
-
         try {
-            File f = new File(logConfig);
-            if (f.exists()) {
-                PropertyConfigurator.configure(logConfig);
-            } else {
-                logConfig = File.separator+"opt"+File.separator+"sas"+File.separator+"otb"+File.separator+"etc"+File.separator+logConfig;
-                f = new File(logConfig);
-                if (f.exists()) {
-                    PropertyConfigurator.configure(logConfig);
-                } else {
-                    logger.error("jOTDB3.log_prop not found.");
-                }
-            }
-            logger.info("jOTDBServer started. LogPropFile: "+ logConfig);
-            logger.info("java.library.path:"+ System.getProperty("java.library.path"));
-            
+            String logConfig = "jOTDB3.log_prop";
             
+            PropertyConfigurator.configure(logConfig);
             try {
                 jInitCPPLogger aCPPLogger= new jInitCPPLogger(logConfig);
             } catch (Exception ex) {
                 System.out.println("Error: "+ ex);
             }
+            logger.info("jOTDBServer started. LogPropFile: "+ logConfig);
+            logger.info("java.library.path:"+ System.getProperty("java.library.path"));
 
 /*
 	    if (System.getSecurityManager () == null) {
diff --git a/SAS/OTDB/bin/copyTree.py b/SAS/OTDB/bin/copyTree.py
index 6dd2fb7316d9c6ed87b56b649c2a2d2e9c5bb39d..fec00c366e69fb5ddd288e9b19392ec7a88d9d6b 100755
--- a/SAS/OTDB/bin/copyTree.py
+++ b/SAS/OTDB/bin/copyTree.py
@@ -24,12 +24,12 @@ def copyVICtree(treeID):
         newNodeIDmap[node['nodeid']] = newNodeID
         if node['value'] == None:
             node['value'] = ''
-        print "%s = %s (id:%d -> %d)" % (node['name'], node['value'][0:30], node['nodeid'], newNodeID)
         query = "insert into VIChierarchy(treeid,nodeid,parentID,paramRefID,name,index,leaf,value) \
           values (%d,%d,%d,%d,'%s',%d,'%s','%s')" %  \
           (treeID, newNodeID, newNodeIDmap[node['parentid']], compIDmap[node['paramrefid']], \
            node['name'], node['index'], node['leaf'], node['value'])
         dummy = toDB.query(query)
+        print "%s = %s (id:%d -> %d)" % (node['name'], node['value'][0:30], node['nodeid'], newNodeID)
 
     # Finally copy the parameters
     fromParList = fromDB.query("select * from VIChierarchy where treeid=%d and leaf='true' order by nodeid" % treeID).dictresult()
@@ -40,55 +40,13 @@ def copyVICtree(treeID):
         newNodeIDmap[par['nodeid']] = newNodeID
         if par['value'] == None:
             par['value'] = ''
-        print "%s = %s (id:%d -> %d)" % (par['name'], par['value'][0:30], par['nodeid'], newNodeID)
         query = "insert into VIChierarchy(treeid,nodeid,parentID,paramRefID,name,index,leaf,value) \
           values (%d,%d,%d,%d,'%s',%d,'%s','%s')" %  \
           (treeID, newNodeID, newNodeIDmap[par['parentid']], parIDmap[par['paramrefid']], \
            par['name'], par['index'], par['leaf'], par['value'])
         dummy = toDB.query(query)
+        print "%s = %s (id:%d -> %d)" % (par['name'], par['value'][0:30], par['nodeid'], newNodeID)
 
-#
-# copyTemplateTree(treeID)
-#
-def copyTemplateTree(treeID):
-    """
-    Copy the Template tree by first copying the nodes and then the parameters.
-    """
-    # Unfortunately there are no suitable stored procedures for the functionality we need.
-
-    # First copy all nodes in order of original creation so the parentID can be set in the new DB
-    fromNodeList = fromDB.query("select * from VICtemplate where treeid=%d and leaf='false' order by nodeid" % treeID).dictresult()
-    print "Found %d nodes in the tree" % len(fromNodeList)
-    newNodeIDmap = {}
-    newNodeIDmap[0] = 0
-    for node in fromNodeList:
-        # copy node
-        newNodeID = toDB.query("select * from nextval('VICtemplateID')").getresult()[0][0]
-        newNodeIDmap[node['nodeid']] = newNodeID
-        if node['limits'] == None:
-            node['limits'] = ''
-        print "%s = %s (id:%d -> %d)" % (node['name'], node['limits'][0:30], node['nodeid'], newNodeID)
-        query = "insert into VICtemplate(treeid,nodeid,parentID,originID,name,index,leaf,instances,limits) \
-          values (%d,%d,%d,%d,'%s',%d,'%s',%d,'%s')" %  \
-          (treeID, newNodeID, newNodeIDmap[node['parentid']], compIDmap[node['originid']], \
-           node['name'], node['index'], node['leaf'], node['instances'], node['limits'])
-        dummy = toDB.query(query)
-
-    # Finally copy the parameters
-    fromParList = fromDB.query("select * from VICtemplate where treeid=%d and leaf='true' order by nodeid" % treeID).dictresult()
-    print "Found %d parameters in the tree" % len(fromParList)
-    for par in fromParList:
-        # copy parameter
-        newNodeID = toDB.query("select * from nextval('VICtemplateID')").getresult()[0][0]
-        newNodeIDmap[par['nodeid']] = newNodeID
-        if par['limits'] == None:
-            par['limits'] = ''
-        print "%s = %s (id:%d -> %d)" % (par['name'], par['limits'][0:30], par['nodeid'], newNodeID)
-        query = "insert into VICtemplate(treeid,nodeid,parentID,originID,name,index,leaf,instances,limits) \
-          values (%d,%d,%d,%d,'%s',%d,'%s',%d,'%s')" %  \
-          (treeID, newNodeID, newNodeIDmap[par['parentid']], parIDmap[par['originid']], \
-           par['name'], par['index'], par['leaf'], par['instances'], par['limits'])
-        dummy = toDB.query(query)
 
        
 #
@@ -100,69 +58,20 @@ def copyTreeMetaData(treeID, campID):
     """
     # First create the tree. Unfortunately there are no suitable stored procedures to do this in a nice way...
 	# TODO: Funerable in the current implementation are groupid and pt+pst+strategy
-    #       The name is always left empty so we cannot accidently create a default template
+    #       the name is always left empty so we cannot accidently create a default template
     fromTree = fromDB.query("select * from otdbtree where treeid=%d" % treeID).dictresult()[0]
-    query = ''
-    if fromTree['treetype'] == '20':
-      query = "insert into otdbtree(treeid,momid,originid,classif,treetype,state,creator, \
+    query = "insert into otdbtree(treeid,momid,originid,classif,treetype,state,creator, \
       campaign,starttime,stoptime,owner,description,groupid,processtype,processsubtype,strategy) values \
       (%d,%d,0,%d::int2,%d::int2,%d::int2,%d,%d::int2,'%s','%s',%d,'%s',%d,'%s','%s','%s')" %  \
       (treeID, fromTree['momid'], fromTree['classif'], fromTree['treetype'], fromTree['state'],  \
       fromTree['creator'], campID, fromTree['starttime'], fromTree['stoptime'],  \
       fromTree['owner'], fromTree['description'], fromTree['groupid'],  \
       fromTree['processtype'], fromTree['processsubtype'], fromTree['strategy'])
-    else:
-      query = "insert into otdbtree(treeid,momid,originid,classif,treetype,state,creator, \
-      campaign,owner,description,groupid,processtype,processsubtype,strategy) values \
-      (%d,%d,0,%d::int2,%d::int2,%d::int2,%d,%d::int2,%d,'%s',%d,'%s','%s','%s')" %  \
-      (treeID, fromTree['momid'], fromTree['classif'], fromTree['treetype'], fromTree['state'],  \
-      fromTree['creator'], campID, \
-      fromTree['owner'], fromTree['description'], fromTree['groupid'],  \
-      fromTree['processtype'], fromTree['processsubtype'], fromTree['strategy'])
-    print query
     result = toDB.query(query)  # void function
     print "Created metadata for tree %d" % treeID
     return
 
 
-#
-# copyStateHistory(treeID)
-#
-def copyStateHistory(treeID):
-    """
-    Copy the state-history of the tree.
-    """
-    # Unfortunately there are no suitable stored procedures to do this in a nice way...
-    fromStateList = fromDB.query("select * from statehistory where treeid=%d" % treeID).dictresult()
-    for fromState in fromStateList:
-        # copy state
-        query = "insert into StateHistory(treeID,momID,state,userID,timestamp) values \
-          (%d,%d,%d::int2,%d,'%s')" %  \
-          (treeID, fromState['momid'], fromState['state'], fromState['userid'], fromState['timestamp'])
-        result = toDB.query(query)  # void function
-    print "Copied state-history for tree %d" % treeID
-    return
-
-
-#
-# copyVICkvt(treeID)
-#
-def copyVICkvt(treeID):
-    """
-    Copy the key-value information of this tree.
-    """
-    # Unfortunately there are no suitable stored procedures to do this in a nice way...
-    fromKvtList = fromDB.query("select * from vickvt where treeid=%d" % treeID).dictresult()
-    for fromkvt in fromKvtList:
-        # copy kvt
-        query = "insert into vickvt(treeID,paramname,value,time) values \
-          (%d,'%s','%s','%s')" %  \
-          (treeID, fromkvt['paramname'], fromkvt['value'], fromkvt['timestamp'])
-        result = toDB.query(query)  # void function
-    print "Copied key-value information for tree %d" % treeID
-    return
-
-
 #
 # checkCampaign(campaignName) : newCampaignID
 #
@@ -179,7 +88,7 @@ def	checkCampaign(campaignName):
         print "Campaign '%s' already exists (id=%d)" % (fromCamp['name'], toCamp[0]['id'])
         return toCamp[0]['id']
     except:
-        newID = toDB.query("select * from saveCampaign(0,'%s','%s','%s','%s','%s')" % 
+        newID = toDB.query("select * from saveCampaign(0,%s,%s,%s,%s,%s)" %
           (fromCamp['name'],fromCamp['title'],fromCamp['pi'],fromCamp['co_i'],fromCamp['contact'])).getresult()[0][0]
         print "Campaign '%s' copied (id=%d) => %d" % (fromCamp['name'], fromCamp['id'], newID)
         return newID
@@ -195,7 +104,7 @@ def copyOrMapComponents(version):
 
     # get all nodes with this version
     nodeList = fromDB.query("select * from getVCNodeList('%%', %d, 'false')" % version).dictresult()
-    print "Found %d components to map" % len(nodeList)
+    print "Found %d components to" % len(nodeList)
     for comp in nodeList:
         newNodeID = toDB.query("select * from saveVCnode(1, %d, '%s', %d, 3::int2, '%s', '%s')" % 
                 (comp['nodeid'], comp['name'], version, comp['constraints'], comp['description'])).getresult()[0][0]
@@ -226,11 +135,11 @@ if __name__ == '__main__':
     """
 
     # check syntax of invocation
-    # Expected syntax: copyTree treeID fromDB toDB
+    # Expected syntax: copyTree momID fromDB toDB
     if (len(sys.argv) != 4):
-        print "Syntax: %s treeID fromDB toDB" % sys.argv[0]
+        print "Syntax: %s MoMID fromDB toDB" % sys.argv[0]
         sys.exit(1)
-    treeID     = int(sys.argv[1])
+    momID      = int(sys.argv[1])
     fromDBname = sys.argv[2]
     toDBname   = sys.argv[3]
     
@@ -241,20 +150,21 @@ if __name__ == '__main__':
     print "Connected to database", toDBname
 
     # Check for tree-existance in both databases.
-    fromDBtree = fromDB.query("select * from OTDBtree t INNER JOIN campaign c ON c.ID = t.campaign where treeID=%d" % treeID).dictresult()
-    toDBtree = toDB.query("select * from otdbtree where treeID=%d" % treeID).dictresult()
+    fromDBtree = fromDB.query("select * from gettreelist(0::int2,3::int2,0,'','','') where momid=%d" % momID).dictresult()
+    toDBtree = toDB.query("select * from gettreelist(0::int2,3::int2,0,'','','') where momid=%d" % momID).dictresult()
     if len(fromDBtree) == 0:
-        print "Tree with treeID %d not found in database %s" % (treeID, fromDBname)
+        print "Tree with MoMId %d not found in database %s" % (momID, fromDBname)
         sys.exit(1)
     if len(toDBtree) != 0:
-        print "Tree with treeID %d already exists in database %s" % (treeID, toDBname)
+        print "Tree with MoMId %d already exists in database %s" % (momID, toDBname)
         # TODO: implement -f option to copy the tree under a different number.
         sys.exit(1)
-    if fromDBtree[0]['treetype'] == 10:	# PIC tree?
+    if fromDBtree[0]['type'] == 10:	# PIC tree?
         print "PIC trees cannot be copied"
         sys.exit(1)
 
     # What's the version of this tree?
+    treeID    = fromDBtree[0]['treeid']
     nodeDefID = fromDB.query("select * from getTopNode(%d)" % treeID).dictresult()[0]
     nodeInfo  = fromDB.query("select * from getVICnodedef(%s)" % nodeDefID['paramdefid']).dictresult()[0]
     version   = nodeInfo['version']
@@ -272,22 +182,22 @@ if __name__ == '__main__':
     # components are now in the new database for sure and the node and par ID's are in the map dicts.
 
 	# make sure the campaign exists also
-    print fromDBtree
-    newCampaignID = checkCampaign(fromDBtree[0]['name'])
+    newCampaignID = checkCampaign(fromDBtree[0]['campaign'])
 
     # TODO: check user table (owner of tree must exist)
 
     # copy the trees metadata first
     copyTreeMetaData(treeID, newCampaignID)
 
-    if fromDBtree[0]['treetype'] == 20:	# template?
-        copyTemplateTree(treeID)
+    if fromDBtree[0]['type'] == 20:	# template?
+        print "Copy of template trees is not supported yet"
+        sys.exit(2)
     else:	# type must be 30 (VIC tree)
         copyVICtree(treeID)
 
-    copyStateHistory(treeID)
+    # TODO: copy treeState table also
 
-    copyVICkvt(treeID)
+    # TODO: copy vickvt table also
 
     toDB.close()
     fromDB.close()
diff --git a/SAS/OTDB/bin/database.py b/SAS/OTDB/bin/database.py
index 900f9c8a1292fa4953083fcd1876e3e3c6af7be9..bab0435633ce8344100da5093e7a618c2df6df2f 100644
--- a/SAS/OTDB/bin/database.py
+++ b/SAS/OTDB/bin/database.py
@@ -2,8 +2,8 @@
 #coding: iso-8859-15
 
 ## database info
-dbName="LOFAR_4"
-dbHost="sas001"
+dbName="BBSbwcomp"
+dbHost="rs005"
 
 def getDBname():
     return(dbName)
diff --git a/SAS/OTDB/sql/addComponentToVT_func.sql b/SAS/OTDB/sql/addComponentToVT_func.sql
index 18d947d140c77449735de45bab43feed63689fad..dbee0148484fdcb9878004cbf175b61da179ff86 100644
--- a/SAS/OTDB/sql/addComponentToVT_func.sql
+++ b/SAS/OTDB/sql/addComponentToVT_func.sql
@@ -38,7 +38,6 @@
 --
 CREATE OR REPLACE FUNCTION instanciateVTleafNode(INT4, INT4, INT4, VARCHAR(150), INT2)
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 		vNode		RECORD;
 		vNewNodeID	VICtemplate.nodeID%TYPE;
@@ -79,7 +78,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION addComponentToVT(INT4, INT4, INT4, INT4, VARCHAR(150))
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 	  vFunction  		CONSTANT INT2 := 1;
 	  TTtemplate 		CONSTANT INT2 := 20;
diff --git a/SAS/OTDB/sql/addKVT_func.sql b/SAS/OTDB/sql/addKVT_func.sql
index bd6c5ac6727ba222ba2c961663b252124fc7fbac..0e6dfd70609e1d05a01168a42f41225fd08269e2 100644
--- a/SAS/OTDB/sql/addKVT_func.sql
+++ b/SAS/OTDB/sql/addKVT_func.sql
@@ -39,11 +39,9 @@
 --
 CREATE OR REPLACE FUNCTION addKVT (INT, VARCHAR(150), VARCHAR(150), VARCHAR(20))
   RETURNS BOOLEAN AS '
-    --  $Id$
 	DECLARE
 		vParRefID	PICparamref.paramID%TYPE;
 		vTime		timestamp := NULL;
-		vLastValue	TEXT;
 
 	BEGIN
 	  -- convert timestamp
@@ -64,19 +62,6 @@ CREATE OR REPLACE FUNCTION addKVT (INT, VARCHAR(150), VARCHAR(150), VARCHAR(20))
 
 	  IF FOUND THEN
 		-- its a PIC parameter
-		IF $3::integer <= 10 THEN	
-		  -- plain ON/OFF only register if last one was a serious problem
-		  vLastValue := 100;
-		  SELECT value
-		  INTO	 vLastValue
-		  FROM   PICkvt
-		  WHERE  paramID = vParRefID
-		  ORDER BY time DESC
-		  LIMIT 1;
-	      IF vLastValue::integer <= 10 THEN
-		  	RETURN FALSE;
-		  END IF;
-	    END IF;
 	    INSERT INTO PICkvt(paramID, value, time)
 		VALUES (vParRefID, $3, vTime);
 		RETURN TRUE;
diff --git a/SAS/OTDB/sql/addPICparam_func.sql b/SAS/OTDB/sql/addPICparam_func.sql
index 8c3d019c02f469af0f8ca6e41f9b43fd9bcb152a..bd0869f0dbe9140725476f4b50a99c5540dd05c6 100644
--- a/SAS/OTDB/sql/addPICparam_func.sql
+++ b/SAS/OTDB/sql/addPICparam_func.sql
@@ -38,7 +38,6 @@
 --
 CREATE OR REPLACE FUNCTION addPICparam (INT4, VARCHAR(150), INT2)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vParRefID	PICparamref.paramID%TYPE;
 		vNodeID		PIChierarchy.nodeID%TYPE;
diff --git a/SAS/OTDB/sql/addTreeState_func.sql b/SAS/OTDB/sql/addTreeState_func.sql
index 0962f9bb1e208461a55df2f20a7022c96ed24a61..f1461a5c5118e88b202193ae725f1ef1c2b548df 100644
--- a/SAS/OTDB/sql/addTreeState_func.sql
+++ b/SAS/OTDB/sql/addTreeState_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION addTreeState (INT4, INT4, INT2, INT4, VARCHAR(20))
   RETURNS VOID AS '
-    --  $Id$
 	DECLARE
 		vTime		timestamp := NULL;
 
diff --git a/SAS/OTDB/sql/assignProcessType_func.sql b/SAS/OTDB/sql/assignProcessType_func.sql
index 5e7fa8831df684d18051f98c160ff140c5ecfcd5..32cff01089d92d3c1d9f969fe9a18d072f81216c 100644
--- a/SAS/OTDB/sql/assignProcessType_func.sql
+++ b/SAS/OTDB/sql/assignProcessType_func.sql
@@ -37,7 +37,6 @@
 --
 CREATE OR REPLACE FUNCTION assignProcessType(INT4, INT4, VARCHAR(20), VARCHAR(50), VARCHAR(30))
   RETURNS BOOLEAN AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		TTtemplate  CONSTANT	INT2 := 20;
 		vFunction   CONSTANT	INT2 := 1;
@@ -126,7 +125,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION copyProcessType(INT4, INT4)
   RETURNS BOOLEAN AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vProcessType		OTDBtree.processType%TYPE;
 		vProcessSubtype		OTDBtree.processSubtype%TYPE;
@@ -171,7 +169,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION exportProcessType(INT4, INT4)
   RETURNS TEXT AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vResult			    TEXT := '';
 		vPrefix     		TEXT;
diff --git a/SAS/OTDB/sql/buildTemplateTree_func.sql b/SAS/OTDB/sql/buildTemplateTree_func.sql
index 93dd697172ec99545d9e21255ea781cfda780924..d653b1e3fd0c64566902c0c9c2567f861e9d366a 100644
--- a/SAS/OTDB/sql/buildTemplateTree_func.sql
+++ b/SAS/OTDB/sql/buildTemplateTree_func.sql
@@ -39,7 +39,6 @@
 --
 CREATE OR REPLACE FUNCTION instanciateVTparams(INT4, INT4, INT4)
   RETURNS VOID AS $$
-    --  $Id$
 	DECLARE
 		vParam		RECORD;
 		dfltValue	VARCHAR(200);
@@ -88,7 +87,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION instanciateVTleafNode(INT4, INT4, INT4)
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 		vNode		RECORD;
 		vNewNodeID	VICtemplate.nodeID%TYPE;
@@ -145,7 +143,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION instanciateVTsubTree(INT4, INT4, INT4)
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 	  vNode				RECORD;
 	  vNodeID			VICnodeDef.nodeID%TYPE;
@@ -199,7 +196,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION instanciateVTtree(INT4, INT4, INT2)
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 		vFunction   CONSTANT	INT2 := 1;
 		TTtemplate  CONSTANT	INT2 := 20;
diff --git a/SAS/OTDB/sql/campaignAPI.sql b/SAS/OTDB/sql/campaignAPI.sql
index a0e30778e946a7862c7b71fdc052f4322535aee7..b7c20cac65537652813a7a7710cee321b9530f82 100644
--- a/SAS/OTDB/sql/campaignAPI.sql
+++ b/SAS/OTDB/sql/campaignAPI.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getCampaign(INT4)
   RETURNS campaignInfo AS '
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vCampaign	RECORD;
 
@@ -65,7 +64,6 @@ CREATE OR REPLACE FUNCTION getCampaign(INT4)
 --
 CREATE OR REPLACE FUNCTION getCampaign(VARCHAR(20))
   RETURNS campaignInfo AS '
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vCampaign	RECORD;
 
@@ -95,7 +93,6 @@ CREATE OR REPLACE FUNCTION getCampaign(VARCHAR(20))
 --
 CREATE OR REPLACE FUNCTION getCampaignList()
   RETURNS SETOF campaignInfo AS '
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
     DECLARE
         vRecord     RECORD;
 
@@ -124,7 +121,6 @@ CREATE OR REPLACE FUNCTION getCampaignList()
 --
 CREATE OR REPLACE FUNCTION saveCampaign(INT4, VARCHAR(30), VARCHAR(100), VARCHAR(80), VARCHAR(80), VARCHAR(120))
   RETURNS INT4 AS '
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vID			campaign.ID%TYPE;
 		vName		TEXT;
@@ -191,7 +187,6 @@ CREATE OR REPLACE FUNCTION saveCampaign(INT4, VARCHAR(30), VARCHAR(100), VARCHAR
 --
 CREATE OR REPLACE FUNCTION exportCampaign(INT4, INT4)
   RETURNS TEXT AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
     DECLARE
 		vResult		TEXT := '';
 		vPrefix		TEXT;
diff --git a/SAS/OTDB/sql/classify_func.sql b/SAS/OTDB/sql/classify_func.sql
index f409354f15539770a7afadcfe4beb3ad30175077..3faf53cbf8d6b53061ae2f803198183041d701ab 100644
--- a/SAS/OTDB/sql/classify_func.sql
+++ b/SAS/OTDB/sql/classify_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION classify(INT4, INT4, INT2)
   RETURNS BOOLEAN AS '
-    --  $Id$
 	DECLARE
 		vFunction				INT2 := 1;
 		vTreeID					OTDBtree.treeID%TYPE;
diff --git a/SAS/OTDB/sql/copyTree_func.sql b/SAS/OTDB/sql/copyTree_func.sql
index 1a1a5eba896320ed2a82c74390ec603f85ff758f..3561769dfdd949f2a0e6863175472bca76f4d3ad 100644
--- a/SAS/OTDB/sql/copyTree_func.sql
+++ b/SAS/OTDB/sql/copyTree_func.sql
@@ -38,7 +38,6 @@
 --
 CREATE OR REPLACE FUNCTION copyTree(INT4, INT4)
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 		vFunction		INT2 := 1;
 		TThardware 		CONSTANT INT2 := 10;
diff --git a/SAS/OTDB/sql/copyVHtree_func.sql b/SAS/OTDB/sql/copyVHtree_func.sql
index c9fefab06dea12fa6087ebb87ba4e3ef92becda8..b90b01e1935185c1063a5e9658ebda119c659a15 100644
--- a/SAS/OTDB/sql/copyVHtree_func.sql
+++ b/SAS/OTDB/sql/copyVHtree_func.sql
@@ -38,7 +38,6 @@
 --
 CREATE OR REPLACE FUNCTION copyVHparams(INT4, INT4, INT4)
   RETURNS VOID AS '
-    --  $Id$
 	DECLARE
 		vParam	RECORD;
 
@@ -74,7 +73,6 @@ CREATE OR REPLACE FUNCTION copyVHparams(INT4, INT4, INT4)
 --
 CREATE OR REPLACE FUNCTION copyVHleafNode(INT4, INT4, INT4)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vRow		RECORD;
 		vNewNodeID	VIChierarchy.nodeID%TYPE;
@@ -116,7 +114,6 @@ CREATE OR REPLACE FUNCTION copyVHleafNode(INT4, INT4, INT4)
 --
 CREATE OR REPLACE FUNCTION copyVHsubTree(INT4, INT4, INT4)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 	  vNewNodeID	VIChierarchy.nodeID%TYPE;
 	  vDummy		VIChierarchy.nodeID%TYPE;
diff --git a/SAS/OTDB/sql/copyVTtree_func.sql b/SAS/OTDB/sql/copyVTtree_func.sql
index 5713219f3d7ffb7948d23fb6682caccb2bd674f7..295f4d224b817b603e0476bb21124bddb584d595 100644
--- a/SAS/OTDB/sql/copyVTtree_func.sql
+++ b/SAS/OTDB/sql/copyVTtree_func.sql
@@ -39,7 +39,6 @@
 --
 CREATE OR REPLACE FUNCTION copyVTparams(INT4, INT4, INT4)
   RETURNS VOID AS '
-    --  $Id$
 	DECLARE
 		vParam	RECORD;
 
@@ -78,7 +77,6 @@ CREATE OR REPLACE FUNCTION copyVTparams(INT4, INT4, INT4)
 --
 CREATE OR REPLACE FUNCTION copyVTleafNode(INT4, INT4, INT4)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vNode		RECORD;
 		vNewNodeID	VICtemplate.nodeID%TYPE;
@@ -125,7 +123,6 @@ CREATE OR REPLACE FUNCTION copyVTleafNode(INT4, INT4, INT4)
 --
 CREATE OR REPLACE FUNCTION copyVTsubTree(INT4, INT4, INT4)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 	  vNewNodeID		VICtemplate.nodeID%TYPE;
 	  vDummy			VICtemplate.nodeID%TYPE;
diff --git a/SAS/OTDB/sql/create_PIC_tables.sql b/SAS/OTDB/sql/create_PIC_tables.sql
index d7bcb2ebe5239c84c3cb4132bf35ef217e52d97a..b825c8846bdadac806fc2b377f01d3d333f85761 100644
--- a/SAS/OTDB/sql/create_PIC_tables.sql
+++ b/SAS/OTDB/sql/create_PIC_tables.sql
@@ -58,7 +58,6 @@ DROP INDEX pic_kvt_time;
 CREATE SEQUENCE PICparamrefID;
 
 CREATE TABLE PICparamref (
-    --  $Id$
 	paramID		INT4			NOT NULL DEFAULT nextval('PICparamrefID'),
 	PVSSname	VARCHAR(150)	NOT NULL,
 	par_type	INT2			REFERENCES param_type(ID),
@@ -66,7 +65,8 @@ CREATE TABLE PICparamref (
 	pruning		INT2			DEFAULT 10,
 	description	TEXT,
 
-	CONSTRAINT	paramID_uniq		PRIMARY KEY(paramID),
+	CONSTRAINT      param_PK	 	PRIMARY KEY (paramID),
+	CONSTRAINT	paramID_uniq		UNIQUE(paramID),
 	CONSTRAINT	paramname_uniq		UNIQUE(PVSSname)
 ) WITHOUT OIDS;
 
@@ -80,7 +80,6 @@ CREATE TABLE PICparamref (
 CREATE SEQUENCE	PIChierarchID;
 
 CREATE TABLE PIChierarchy (
-    --  $Id$
 	treeID		INT4			NOT NULL REFERENCES OTDBtree(treeID),
 	nodeID		INT4			NOT NULL DEFAULT nextval('PIChierarchID'),
 	parentID	INT4			NOT NULL, --  REFERENCES PIChierachy(nodeID),
@@ -89,11 +88,12 @@ CREATE TABLE PIChierarchy (
 	index		INT2			NOT NULL DEFAULT -1,
 	leaf		BOOLEAN			DEFAULT TRUE,
 
-	CONSTRAINT	param_uniq_in_tree	PRIMARY KEY(treeID, nodeID)
+	CONSTRAINT	param_uniq_in_tree	UNIQUE(treeID, nodeID)
 ) WITHOUT OIDS;
 
 -- Index: pichierarchy_treeid_nodeid_indx
---CREATE UNIQUE INDEX PIChierarchy_treeid_nodeid_indx ON PIChierarchy(treeid, nodeid);
+
+CREATE UNIQUE INDEX PIChierarchy_treeid_nodeid_indx ON PIChierarchy(treeid, nodeid);
 
 --
 -- PIC Key Values Time sets.
@@ -103,14 +103,16 @@ CREATE TABLE PIChierarchy (
 -- because in simultaneous observations different PIC reference trees
 -- can be used. A change in value is important for all observations.
 CREATE TABLE PICkvt (
-    --  $Id$
 	paramID		INT4			NOT NULL REFERENCES PICparamref(paramID), 
 	value		TEXT			NOT NULL,
 	time		TIMESTAMP		DEFAULT now(),
 
-	CONSTRAINT	pickvt_uniq		PRIMARY KEY(paramID, time)
+	CONSTRAINT	pickvt_uniq		UNIQUE(paramID, time)
 ) WITHOUT OIDS;
 
 CREATE INDEX PIC_kvt_id   ON PICkvt(paramID);
 CREATE INDEX PIC_kvt_time ON PICkvt(time);
---CREATE UNIQUE INDEX PIC_kvt_id_time_indx ON pickvt(paramid, "time");
+CREATE UNIQUE INDEX PIC_kvt_id_time_indx ON pickvt(paramid, "time");
+
+
+
diff --git a/SAS/OTDB/sql/create_VIC_tables.sql b/SAS/OTDB/sql/create_VIC_tables.sql
index b56821521c504943ad19a1de9071b9ca0de44598..a30ca64d58cda4119b593f53d7d31b3dcc5e65fa 100644
--- a/SAS/OTDB/sql/create_VIC_tables.sql
+++ b/SAS/OTDB/sql/create_VIC_tables.sql
@@ -74,7 +74,6 @@ DROP INDEX VIChierarchy_treeid_nodeid_indx;
 CREATE SEQUENCE	VICnodedefID;
 
 CREATE TABLE VICnodedef (
-    --  $Id$
 	nodeID		INT4			NOT NULL DEFAULT nextval('VICnodedefID'),
 	name		VARCHAR(40)		NOT NULL,
 	version		INT4			NOT NULL DEFAULT 010000,
@@ -100,7 +99,6 @@ CREATE UNIQUE INDEX Vnodedef_node_indx ON VICnodedef(nodeID);
 CREATE SEQUENCE VICparamdefID;
 
 CREATE TABLE VICparamdef (
-    --  $Id$
 	paramID		INT4			NOT NULL DEFAULT nextval('VICparamdefID'),
 	nodeID		INT4			NOT NULL REFERENCES VICnodedef(nodeID),
 	name		VARCHAR(40)		NOT NULL,
@@ -134,7 +132,6 @@ CREATE TABLE VICparamdef (
 CREATE SEQUENCE	VICtemplateID;
 
 CREATE TABLE VICtemplate (
-    --  $Id$
 	treeID		INT4			NOT NULL REFERENCES OTDBtree(treeID),
 	nodeID		INT4			NOT NULL DEFAULT nextval('VICtemplateID'),
 	parentID	INT4			NOT NULL,  -- REFERENCES VICtemplate(nodeID),
@@ -185,7 +182,6 @@ CREATE INDEX VTempl_treeid_parentid_indx ON VICTemplate(treeid, parentid);
 CREATE SEQUENCE	VIChierarchID;
 
 CREATE TABLE VIChierarchy (
-    --  $Id$
 	treeID		INT4			NOT NULL REFERENCES OTDBtree(treeID),
 	nodeID		INT4			NOT NULL DEFAULT nextval('VIChierarchID'),
 	parentID	INT4			NOT NULL, -- REFERENCES VIChierachy(nodeID),
@@ -217,7 +213,6 @@ CREATE UNIQUE INDEX VIChierarchy_treeid_nodeid_indx ON VIChierarchy( treeid, nod
 -- parametername is set to NULL.
 --
 CREATE TABLE VICkvt (
-    --  $Id$
 	treeID		INT4			NOT NULL REFERENCES OTDBtree(treeID),
 	paramName	VARCHAR(150)	DEFAULT NULL, -- for shared applications
 	value		TEXT			NOT NULL,
diff --git a/SAS/OTDB/sql/create_base_tables.sql b/SAS/OTDB/sql/create_base_tables.sql
index 3e204e95382ba36cbd4fed039524a6fcd9842a3d..1882d1088b52a8c2443e11358684e5ed9bdf6249 100644
--- a/SAS/OTDB/sql/create_base_tables.sql
+++ b/SAS/OTDB/sql/create_base_tables.sql
@@ -40,7 +40,6 @@ DROP TABLE operator 	  CASCADE;
 -- Assigns a level of 'maturity' to a node or tree
 --
 CREATE TABLE classification (
-    --  $Id$
 	ID			INT2			NOT NULL,
 	name		VARCHAR(15)		NOT NULL,
 
@@ -58,7 +57,6 @@ INSERT INTO classification VALUES (4, 'example');
 -- Defines the ways the node+parameter constraints can be checked.
 --
 CREATE TABLE constr_type (
-    --  $Id$
 	ID			INT2			NOT NULL,
 	name		VARCHAR(10)		NOT NULL,
 
@@ -77,7 +75,6 @@ INSERT INTO constr_type VALUES (3, 'exec');
 -- so that it can check the values that are entered.
 --
 CREATE TABLE param_type (
-    --  $Id$
 	ID			INT2			NOT NULL,
 	name		VARCHAR(5)		NOT NULL,
 
@@ -137,7 +134,6 @@ INSERT INTO param_type VALUES (315, 'pdate');
 -- in the param_type table.
 --
 CREATE TABLE pvss_type (
-    --  $Id$
 	ID			INT2			NOT NULL,
 	name		VARCHAR(5)		NOT NULL REFERENCES param_type(name),
 
@@ -165,7 +161,6 @@ INSERT INTO pvss_type VALUES (25, 'text');
 -- TODO: Check contents of the table.
 --
 CREATE TABLE validation (
-    --  $Id$
 	ID			INT2			NOT NULL,
 	name		VARCHAR(10)		NOT NULL,
 
@@ -186,7 +181,6 @@ INSERT INTO validation VALUES (3, 'resource');
 -- TODO: Extend table with a lot more records.
 --
 CREATE TABLE unit (
-    --  $Id$
 	ID			INT2			NOT NULL,
 	name 		VARCHAR(10)		NOT NULL,
 	label		VARCHAR(5),
@@ -218,7 +212,6 @@ INSERT INTO unit values (15, 'degrees',  'deg', '',			false);
 -- 
 -- Define the kind of tree the information refers to.
 CREATE TABLE treetype (
-    --  $Id$
 	ID			INT2			NOT NULL,
 	name		VARCHAR(10)		NOT NULL,
 
@@ -235,7 +228,6 @@ INSERT INTO treetype VALUES (30, 'VHtree');
 -- Define states for trees that indicate the phase of the
 -- lifecycle the tree is in.
 CREATE TABLE treestate (
-    --  $Id$
 	ID			INT2			NOT NULL,
 	name		VARCHAR(20)		NOT NULL,
 
@@ -266,7 +258,6 @@ INSERT INTO treestate VALUES (1200, 'obsolete');
 --
 CREATE SEQUENCE	campaignID;
 CREATE TABLE campaign (
-    --  $Id$
 	ID			INT2			NOT NULL DEFAULT NEXTVAL('campaignID'),
 	name		VARCHAR(30)		NOT NULL,
 	title		VARCHAR(100)	NOT NULL,
@@ -285,7 +276,6 @@ INSERT INTO campaign(id, name, title, PI) VALUES (0, 'no campaign', 'not related
 -- Names and ID of the operater allowed to manage the trees.
 --
 CREATE TABLE operator (
-    --  $Id$
 	ID			INT4			NOT NULL,
 	name		VARCHAR(30)		NOT NULL,
 	telephone	VARCHAR(10)		NOT NULL,
diff --git a/SAS/OTDB/sql/create_event_action.sql b/SAS/OTDB/sql/create_event_action.sql
index d168cedea377e631d214d38d5f78440643a9c019..e36431481f5020d511390b6f862104968d4c50a2 100644
--- a/SAS/OTDB/sql/create_event_action.sql
+++ b/SAS/OTDB/sql/create_event_action.sql
@@ -42,7 +42,6 @@ DROP SEQUENCE	OTDBactionID;
 -- TODO: Check if table contents is complete
 --
 CREATE TABLE eventStatus (
-    --  $Id$
 	status		INT2			NOT NULL,
 	name		VARCHAR(20)		NOT NULL,
 
@@ -65,7 +64,6 @@ INSERT INTO eventStatus VALUES ( 32, 'maintenance');
 -- TODO: Check if table contents is complete
 --
 CREATE TABLE actionStatus (
-    --  $Id$
 	status		INT2			NOT NULL,
 	name		VARCHAR(20)		NOT NULL,
 
@@ -87,7 +85,6 @@ INSERT INTO actionStatus VALUES ( 32, 'closed');
 CREATE SEQUENCE	OTDBeventID;
 
 CREATE TABLE OTDBevent (
-    --  $Id$
 	eventID		INT4			NOT NULL DEFAULT nextval('OTDBeventID'),
 	nodename	VARCHAR(80)		NOT NULL,
 	status		INT2			NOT NULL REFERENCES eventStatus(status),
@@ -108,7 +105,6 @@ CREATE TABLE OTDBevent (
 CREATE SEQUENCE	OTDBactionID;
 
 CREATE TABLE OTDBaction (
-    --  $Id$
 	actionID	INT4			NOT NULL DEFAULT nextval('OTDBactionID'),
 	eventID		INT4			NOT NULL REFERENCES OTDBevent(eventID),
 	userID		INT4			NOT NULL REFERENCES OTDBuser(userID),
diff --git a/SAS/OTDB/sql/create_log_system.sql b/SAS/OTDB/sql/create_log_system.sql
index 087c2fa84fed7e325033d24ab7bb8dab61dbb704..8b367a33cd768a6a2e3109bca6d4d00f10d11bde 100644
--- a/SAS/OTDB/sql/create_log_system.sql
+++ b/SAS/OTDB/sql/create_log_system.sql
@@ -25,13 +25,11 @@
 DROP TABLE log CASCADE;
 
 CREATE TABLE log (
-    --  $Id$
 	msg		TEXT
 ) WITH OIDS;
 
 CREATE OR REPLACE FUNCTION logmsg(TEXT)
   RETURNS VOID AS '
-    --  $Id$
 	BEGIN
 		INSERT INTO log VALUES ($1);
 		RETURN;
@@ -40,7 +38,6 @@ CREATE OR REPLACE FUNCTION logmsg(TEXT)
 
 CREATE OR REPLACE FUNCTION clearlog()
   RETURNS VOID AS '
-    --  $Id$
 	BEGIN
 	  DELETE FROM log;
 	  RETURN;
diff --git a/SAS/OTDB/sql/create_rules.sql b/SAS/OTDB/sql/create_rules.sql
index 75d6f474c7aff6926d854d5961ab743c00c1c1da..be51b38a6ad2ea43129bab690479b4b01f2c8444 100644
--- a/SAS/OTDB/sql/create_rules.sql
+++ b/SAS/OTDB/sql/create_rules.sql
@@ -26,8 +26,8 @@
 -- Creates a rule for updating the modificationDate of the OTDBtree table.
 --
 
-DROP RULE ruleUpdateVIC on vichierarchy;
-DROP RULE ruleUpdateTemplate on victemplate;
+DROP RULE ruleUpdateVIC;
+DROP RULE ruleUpdateTemplate;
 
 CREATE RULE ruleUpdateVIC AS ON UPDATE
 	TO vichierarchy WHERE NEW.value <> OLD.value
diff --git a/SAS/OTDB/sql/create_security.sql b/SAS/OTDB/sql/create_security.sql
index 4e63d463a39eceeb8f9d43042e20d1a91bd24495..142e0dad1c9cf257ccf21d4af214c0db111e6617 100644
--- a/SAS/OTDB/sql/create_security.sql
+++ b/SAS/OTDB/sql/create_security.sql
@@ -37,7 +37,6 @@ DROP SEQUENCE	OTDBuserID;
 CREATE SEQUENCE	OTDBuserID;
 
 CREATE TABLE OTDBuser (
-    --  $Id$
 	userID		INT4			NOT NULL DEFAULT nextval('OTDBuserID'),
 	username	VARCHAR(20)		NOT NULL,
 	password	VARCHAR(20)		NOT NULL,
@@ -63,7 +62,6 @@ INSERT INTO OTDBuser (username, password, role)
 -- what arguments
 --
 CREATE TABLE OTDBaccess (
-    --  $Id$
 	userID		INT4			NOT NULL REFERENCES OTDBuser(userID),
 	task		INT4			NOT NULL DEFAULT 0,
 	value		INT4			NOT NULL DEFAULT 0
diff --git a/SAS/OTDB/sql/create_tree_table.sql b/SAS/OTDB/sql/create_tree_table.sql
index c3aa751fc866261888b8663b55192ebe162542ba..20591909ae163017dcb1a8d80226c541805149be 100644
--- a/SAS/OTDB/sql/create_tree_table.sql
+++ b/SAS/OTDB/sql/create_tree_table.sql
@@ -42,7 +42,6 @@ CREATE SEQUENCE	OTDBtreeID START 6112;
 CREATE SEQUENCE	OTDBgroupID START 1;
 
 CREATE TABLE OTDBtree (
-    --  $Id$
 	-- required info
 	treeID		INT4			NOT NULL DEFAULT nextval('OTDBtreeID'),
 	momID 		INT4			NOT NULL DEFAULT 0,
@@ -77,7 +76,6 @@ CREATE TABLE OTDBtree (
 ) WITHOUT OIDS;
 
 CREATE OR REPLACE FUNCTION newGroupID()
-    --  $Id$
   RETURNS INT4 AS $$
   BEGIN
    RETURN nextval('OTDBgroupID');
@@ -89,7 +87,6 @@ $$ LANGUAGE plpgsql;
 CREATE INDEX otdbtree_treeid_indx ON otdbtree(treeid);
 
 CREATE TABLE StateHistory (
-    --  $Id$
 	treeID		INT4			NOT NULL,
 	momID		INT4			NOT NULL,
 	state		INT2			NOT NULL,
diff --git a/SAS/OTDB/sql/create_types.sql b/SAS/OTDB/sql/create_types.sql
index 5a542ca75ad70c5d273b5511aa7d61859e5b8f62..415617513368bdf0f7a66bddd251c6c700073543 100644
--- a/SAS/OTDB/sql/create_types.sql
+++ b/SAS/OTDB/sql/create_types.sql
@@ -35,7 +35,6 @@ DROP TYPE	OTDBnodeDef		CASCADE;
 DROP TYPE	campaignInfo	CASCADE;
 
 CREATE TYPE treeInfo AS (
-    --  $Id$
 	treeID				INT4,			-- OTDBtree.treeID%TYPE,
 	momID				INT4,
 	groupID				INT4,
@@ -56,7 +55,6 @@ CREATE TYPE treeInfo AS (
 );
 
 CREATE TYPE stateInfo AS (
-    --  $Id$
 	treeID			INT4,			-- OTDBtree.treeID%TYPE,
 	momID			INT4,			-- OTDBtree.momID%TYPE,
 	state			INT2,			-- treestate.ID%TYPE,
@@ -65,7 +63,6 @@ CREATE TYPE stateInfo AS (
 );
 
 CREATE TYPE OTDBnode AS (
-    --  $Id$
 	nodeID			INT4,
 	parentID		INT4,
 	paramDefID		INT4,
@@ -80,7 +77,6 @@ CREATE TYPE OTDBnode AS (
 -- make constructor for OTDBnode
 CREATE OR REPLACE FUNCTION makeOTDBnode(INT4,INT4,INT4,VARCHAR(40),INT2,BOOLEAN,INT2,TEXT,TEXT)
   RETURNS OTDBnode AS $$
-    --  $Id$
 	DECLARE
 	  vResult	RECORD;
 
@@ -92,7 +88,6 @@ $$ LANGUAGE plpgsql;
 
 
 CREATE TYPE OTDBparamDef AS (
-    --  $Id$
 	paramID			INT4,
 	nodeID			INT4,
 	name			VARCHAR(40),
@@ -107,7 +102,6 @@ CREATE TYPE OTDBparamDef AS (
 
 
 CREATE TYPE OTDBvalue AS (
-    --  $Id$
 	paramID			INT4,
 	name			VARCHAR(150),
 	value			TEXT,
@@ -116,7 +110,6 @@ CREATE TYPE OTDBvalue AS (
 
 
 CREATE TYPE OTDBnodeDef AS (
-    --  $Id$
 	nodeID			INT4,
 	name			VARCHAR(40),
 	version			INT4,
@@ -126,7 +119,6 @@ CREATE TYPE OTDBnodeDef AS (
 );
 
 CREATE TYPE campaignInfo AS (
-    --  $Id$
     ID          INT2,
     name        VARCHAR(30),
     title       VARCHAR(100),
@@ -136,7 +128,6 @@ CREATE TYPE campaignInfo AS (
 );
 
 CREATE TYPE templateInfo AS (
-    --  $Id$
 	treeID			INT4,
 	name			VARCHAR(32),
 	processType		VARCHAR(20),
diff --git a/SAS/OTDB/sql/deleteTree_func.sql b/SAS/OTDB/sql/deleteTree_func.sql
index c66cd2d44d1271361eeb1b318dd3f2de843ec30b..517c2d21a7db8b709c7f838f24146cbd1081006e 100644
--- a/SAS/OTDB/sql/deleteTree_func.sql
+++ b/SAS/OTDB/sql/deleteTree_func.sql
@@ -38,7 +38,6 @@
 --
 CREATE OR REPLACE FUNCTION deleteTree(INT4, INT4)
   RETURNS VOID AS $$
-    --  $Id$
 	DECLARE
 		vFunction		INT2 := 1;
 		TThardware 		CONSTANT INT2 := 10;
diff --git a/SAS/OTDB/sql/deleteVCnode_func.sql b/SAS/OTDB/sql/deleteVCnode_func.sql
index 66e30f06fd8cc5f0edac3291f12f61002a709925..ab45c177e7e042fbb3c607effa9190fe62e19ab7 100644
--- a/SAS/OTDB/sql/deleteVCnode_func.sql
+++ b/SAS/OTDB/sql/deleteVCnode_func.sql
@@ -38,7 +38,6 @@
 --
 CREATE OR REPLACE FUNCTION removeVCnode(INT4, INT4)
   RETURNS BOOLEAN AS '
-    --  $Id$
 	DECLARE
 		vFunction		INT2 := 1;
 		vIsAuth			BOOLEAN;
diff --git a/SAS/OTDB/sql/deleteVTnode_func.sql b/SAS/OTDB/sql/deleteVTnode_func.sql
index 9cdeb895f1ec0120b7ea71009ec475c64459c089..e542d60cdcb71dec20a54266c3591cd6040afe3d 100644
--- a/SAS/OTDB/sql/deleteVTnode_func.sql
+++ b/SAS/OTDB/sql/deleteVTnode_func.sql
@@ -31,7 +31,6 @@
 --
 CREATE OR REPLACE FUNCTION removeVTparameters(INT4)
   RETURNS VOID AS '
-    --  $Id$
 	BEGIN
 		DELETE
 		FROM	VICtemplate
@@ -50,7 +49,6 @@ CREATE OR REPLACE FUNCTION removeVTparameters(INT4)
 --
 CREATE OR REPLACE FUNCTION removeVTleafNode(INT4)
   RETURNS VOID AS '
-    --  $Id$
 	BEGIN
 		-- remove parameters
 		PERFORM removeVTparameters($1);
@@ -73,7 +71,6 @@ CREATE OR REPLACE FUNCTION removeVTleafNode(INT4)
 --
 CREATE OR REPLACE FUNCTION removeVTsubTree(INT4)
   RETURNS VOID AS '
-    --  $Id$
 	DECLARE
 		vChild		RECORD;
 
@@ -108,7 +105,6 @@ CREATE OR REPLACE FUNCTION removeVTsubTree(INT4)
 --
 CREATE OR REPLACE FUNCTION removeVTnode(INT4, INT4, INT4)
   RETURNS BOOLEAN AS '
-    --  $Id$
 	DECLARE
 		vFunction		INT2 := 1;
 		vIsAuth			BOOLEAN;
diff --git a/SAS/OTDB/sql/dupVTnode_func.sql b/SAS/OTDB/sql/dupVTnode_func.sql
index c06e89342e3bf974cdd036de1e0697282d11b46c..c9c11590bd60dea9fe8d126aea26e559cfdefdca 100644
--- a/SAS/OTDB/sql/dupVTnode_func.sql
+++ b/SAS/OTDB/sql/dupVTnode_func.sql
@@ -31,7 +31,6 @@
 --
 CREATE OR REPLACE FUNCTION attachVTparameters(INT4, INT4)
   RETURNS VOID AS '
-    --  $Id$
 	DECLARE
 	  vParam		RECORD;
 
@@ -64,7 +63,6 @@ CREATE OR REPLACE FUNCTION attachVTparameters(INT4, INT4)
 --
 CREATE OR REPLACE FUNCTION dupVTleafNode(INT4, INT4, INT2)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vNodeID		INT4;
 		vOrgNode	RECORD;
@@ -129,7 +127,6 @@ CREATE OR REPLACE FUNCTION dupVTleafNode(INT4, INT4, INT2)
 --
 CREATE OR REPLACE FUNCTION dupVTsubTree(INT4, INT4, INT2)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vNodeID		INT4;
 		vChild		RECORD;
@@ -170,7 +167,6 @@ CREATE OR REPLACE FUNCTION dupVTsubTree(INT4, INT4, INT2)
 --
 CREATE OR REPLACE FUNCTION dupVTnode(INT4, INT4, INT4, INT2)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vFunction		INT2 := 1;
 		vIsAuth			BOOLEAN;
diff --git a/SAS/OTDB/sql/exportResultTree_func.sql b/SAS/OTDB/sql/exportResultTree_func.sql
index e526bf316d40843e65aa34f9a3ec7f61aee3ff50..78a31855cf4e79d6a40408713bf852a3b01ff851 100644
--- a/SAS/OTDB/sql/exportResultTree_func.sql
+++ b/SAS/OTDB/sql/exportResultTree_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION exportMDSubTree(INT4, INT4, INT4)
   RETURNS TEXT AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 	  vResult		TEXT := '';
 	  vRow			RECORD;
@@ -100,7 +99,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION exportResultTree(INT4, INT4, INT4)
   RETURNS TEXT AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vFunction		INT2 := 1;
 		vIsAuth			BOOLEAN;
diff --git a/SAS/OTDB/sql/exportTree_func.sql b/SAS/OTDB/sql/exportTree_func.sql
index fde3d84133b1283d9dfc6734150107656f1fa771..7145cc2a8fa75ac0c8d42cd8823cc487b69d985a 100644
--- a/SAS/OTDB/sql/exportTree_func.sql
+++ b/SAS/OTDB/sql/exportTree_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION fullTemplateNodeName(INT4, INT4, TEXT)
   RETURNS TEXT AS $$
-    --  $Id$
 	DECLARE
 	  vResult		TEXT;
 	  vName			VICtemplate.name%TYPE;
@@ -74,7 +73,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION exportTemplateSubTree(INT4, INT4, TEXT)
   RETURNS TEXT AS $$
-    --  $Id$
 	DECLARE
 	  vResult		TEXT := '';
 	  vRow			RECORD;
@@ -132,7 +130,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION exportVICSubTree(INT4, INT4, INT4)
   RETURNS TEXT AS $$
-    --  $Id$
 	DECLARE
 	  vResult		TEXT := '';
 	  vRow			RECORD;
@@ -181,7 +178,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION exportPICSubTree(INT4, INT4, INT4)
   RETURNS TEXT AS $$
-    --  $Id$
 	DECLARE
 	  vResult		TEXT := '';
 	  vRow			RECORD;
@@ -228,7 +224,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION exportTree(INT4, INT4, INT4)
   RETURNS TEXT AS $$
-    --  $Id$
 	DECLARE
 		vFunction		INT2 := 1;
 		vIsAuth			BOOLEAN;
diff --git a/SAS/OTDB/sql/getAllTaskID_func.sql b/SAS/OTDB/sql/getAllTaskID_func.sql
index 22f13b4847aef9d762b25aca8dbead17a07e8864..ce2c4c6e2a5545ec852e6453d550f0228fc95b75 100644
--- a/SAS/OTDB/sql/getAllTaskID_func.sql
+++ b/SAS/OTDB/sql/getAllTaskID_func.sql
@@ -23,7 +23,6 @@
 
 CREATE OR REPLACE FUNCTION getAllTaskID()
   RETURNS SETOF INTEGER AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getBrokenHardware_func.sql b/SAS/OTDB/sql/getBrokenHardware_func.sql
index d419a5d7a8910682d8152140bc06cfe83b989e8b..c50b93ccb65ce306972dd2dc605c8138ca41d14e 100644
--- a/SAS/OTDB/sql/getBrokenHardware_func.sql
+++ b/SAS/OTDB/sql/getBrokenHardware_func.sql
@@ -47,7 +47,6 @@ $$ LANGUAGE SQL;
 
 CREATE OR REPLACE FUNCTION getBrokenHardware(VARCHAR(20), VARCHAR(20)) 
 	RETURNS SETOF OTDBvalue AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vRecord		RECORD;
 		vRecord2	RECORD;
diff --git a/SAS/OTDB/sql/getDefaultTemplates_func.sql b/SAS/OTDB/sql/getDefaultTemplates_func.sql
index 0bc0bf84d521ac6d9fb0d2acc55e2e457bb77897..af4d7cdb17fca804527852794064318b7a631559 100644
--- a/SAS/OTDB/sql/getDefaultTemplates_func.sql
+++ b/SAS/OTDB/sql/getDefaultTemplates_func.sql
@@ -37,7 +37,6 @@
 --
 CREATE OR REPLACE FUNCTION getDefaultTemplates()
   RETURNS SETOF templateInfo AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vRecord		RECORD;
 		TSobsolete	CONSTANT	INT2 := 1200;
@@ -73,7 +72,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION assignTemplateName(INT4, INT4, VARCHAR(32))
   RETURNS BOOLEAN AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		TSobsolete   		CONSTANT	INT2 := 1200;
 		TTtemplate  		CONSTANT	INT2 := 20;
diff --git a/SAS/OTDB/sql/getExecutableTrees_func.sql b/SAS/OTDB/sql/getExecutableTrees_func.sql
index 027c50ee576ee3a859c83c64baf2634f5919e6ae..adf8bb9cc79ef0e4118959d34570112cb29c2add 100644
--- a/SAS/OTDB/sql/getExecutableTrees_func.sql
+++ b/SAS/OTDB/sql/getExecutableTrees_func.sql
@@ -38,7 +38,6 @@
 --
 CREATE OR REPLACE FUNCTION getExecutableTrees(INT2)
   RETURNS SETOF treeInfo AS $$
-    --  $Id$
 	DECLARE
 		vRecord			RECORD;
 		TSscheduled		CONSTANT	INT2 := 400;
diff --git a/SAS/OTDB/sql/getModifiedTrees_func.sql b/SAS/OTDB/sql/getModifiedTrees_func.sql
index 259226e90b936ef7850ee790567f38f669b36274..598e3c87cc2f3b22867af8e4e2e49e8655405031 100644
--- a/SAS/OTDB/sql/getModifiedTrees_func.sql
+++ b/SAS/OTDB/sql/getModifiedTrees_func.sql
@@ -37,7 +37,6 @@
 --
 CREATE OR REPLACE FUNCTION getModifiedTrees(VARCHAR(20), INT2)
   RETURNS SETOF treeInfo AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vRecord		RECORD;
 		vQuery		TEXT;
diff --git a/SAS/OTDB/sql/getMomID2treeID_func.sql b/SAS/OTDB/sql/getMomID2treeID_func.sql
index 561284380ea7359fb1cda13cda2fb45061ddb93c..80b4a71e72004ae2363c8e0b88179ac09eb5d0b8 100644
--- a/SAS/OTDB/sql/getMomID2treeID_func.sql
+++ b/SAS/OTDB/sql/getMomID2treeID_func.sql
@@ -36,7 +36,6 @@ CREATE TYPE treeIDmomID AS (treeID INTEGER, momID INTEGER);
 
 CREATE OR REPLACE FUNCTION getMomID2treeID()
   RETURNS SETOF treeIDmomID AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getNode_func.sql b/SAS/OTDB/sql/getNode_func.sql
index 3587cef8ada82ccfe04985fa41bf95ddf86c5d82..07cb129058454a7249e59b10d8f2f474db827eea 100644
--- a/SAS/OTDB/sql/getNode_func.sql
+++ b/SAS/OTDB/sql/getNode_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getNode(INT4, INT4)
   RETURNS OTDBnode AS '
-    --  $Id$
 	DECLARE
 		TThardware CONSTANT	INT2 := 10;
 		TTtemplate CONSTANT	INT2 := 20;
diff --git a/SAS/OTDB/sql/getPICitemList_func.sql b/SAS/OTDB/sql/getPICitemList_func.sql
index 4321bf80198e05364294043006190dbbe9c4101e..219539d589d11beab4a28d89ec9b53a74691ec6b 100644
--- a/SAS/OTDB/sql/getPICitemList_func.sql
+++ b/SAS/OTDB/sql/getPICitemList_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION getPICitemList(INT4, INT4, INT4)
   RETURNS SETOF OTDBnode AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 		vFullname	VARCHAR(150);
@@ -101,7 +100,6 @@ CREATE OR REPLACE FUNCTION getPICitemList(INT4, INT4, INT4)
 --
 CREATE OR REPLACE FUNCTION getPICitemList(INT4, VARCHAR(150))
   RETURNS SETOF OTDBnode AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getPICparamDef_func.sql b/SAS/OTDB/sql/getPICparamDef_func.sql
index 3af44c4432cc05ac447ec508d9249e1ec2d5615d..6a6513a05ed52323955bec0c139940f3e010a4fa 100644
--- a/SAS/OTDB/sql/getPICparamDef_func.sql
+++ b/SAS/OTDB/sql/getPICparamDef_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getPICParamDef(INT4)
   RETURNS OTDBparamDef AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getStateList_func.sql b/SAS/OTDB/sql/getStateList_func.sql
index 1d96d64a6cd0ef6fc691d5aafebe9957807d1613..afceb4f2728cf5c7cbaf4a8683982274347927a0 100644
--- a/SAS/OTDB/sql/getStateList_func.sql
+++ b/SAS/OTDB/sql/getStateList_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION getStateList(INT4, BOOLEAN, TIMESTAMP, TIMESTAMP)
   RETURNS SETOF stateInfo AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 		vQuery		TEXT;
diff --git a/SAS/OTDB/sql/getTopNode_func.sql b/SAS/OTDB/sql/getTopNode_func.sql
index 0a95b209ff90af168cfb8ee661fa4576e862a8b2..c5c014ae229eb79e1587f46db78ffd3b12728a86 100644
--- a/SAS/OTDB/sql/getTopNode_func.sql
+++ b/SAS/OTDB/sql/getTopNode_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getTopNode(INT4)
   RETURNS OTDBnode AS '
-    --  $Id$
 	DECLARE
 		TThardware CONSTANT	INT2 := 10;
 		TTtemplate CONSTANT	INT2 := 20;
diff --git a/SAS/OTDB/sql/getTreeGroup_func.sql b/SAS/OTDB/sql/getTreeGroup_func.sql
index aed9af02b4121f614376a4699b21a8a7d21fa1a4..f569deec7c7bfbf7e9684f7dd30901f497583b68 100644
--- a/SAS/OTDB/sql/getTreeGroup_func.sql
+++ b/SAS/OTDB/sql/getTreeGroup_func.sql
@@ -43,7 +43,6 @@
 --
 CREATE OR REPLACE FUNCTION getTreeGroup(INT, INT)
   RETURNS SETOF treeInfo AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vRecord			RECORD;
 		TSscheduled		CONSTANT	INT2 := 400;
diff --git a/SAS/OTDB/sql/getTreeInfo_func.sql b/SAS/OTDB/sql/getTreeInfo_func.sql
index 1ce3214ef3923b8ffdd4f424e64f9478d455d428..dff545487c5bd025cd55bb6660ef33c22221c5ce 100644
--- a/SAS/OTDB/sql/getTreeInfo_func.sql
+++ b/SAS/OTDB/sql/getTreeInfo_func.sql
@@ -37,7 +37,6 @@
 --
 CREATE OR REPLACE FUNCTION getTreeInfo(INT4, BOOLEAN)
   RETURNS treeInfo AS $$
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getTreeList_func.sql b/SAS/OTDB/sql/getTreeList_func.sql
index 5ead542cab7f5fca4e8ca1d0385534fcb8aff3cb..6eb1dff9d9dcc04c7aaa8417b39274631045da0c 100644
--- a/SAS/OTDB/sql/getTreeList_func.sql
+++ b/SAS/OTDB/sql/getTreeList_func.sql
@@ -37,7 +37,6 @@
 --
 CREATE OR REPLACE FUNCTION getTreeList(INT2, INT2, INT4, VARCHAR(20), VARCHAR(50), VARCHAR(30))
   RETURNS SETOF treeInfo AS $$
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 		vQuery		TEXT;
diff --git a/SAS/OTDB/sql/getTreesInPeriod_func.sql b/SAS/OTDB/sql/getTreesInPeriod_func.sql
index d071a34bec5fff1b33e698d54eef7d9bfede5165..f01f8b8c68a3c99562933c5de99c71c9ca9414ff 100644
--- a/SAS/OTDB/sql/getTreesInPeriod_func.sql
+++ b/SAS/OTDB/sql/getTreesInPeriod_func.sql
@@ -37,7 +37,6 @@
 --
 CREATE OR REPLACE FUNCTION getTreesInPeriod(INT2, TIMESTAMP, TIMESTAMP)
   RETURNS SETOF treeInfo AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vRecord		RECORD;
 		vQuery		TEXT;
diff --git a/SAS/OTDB/sql/getVCNodeList_func.sql b/SAS/OTDB/sql/getVCNodeList_func.sql
index 6ac239f0205291f2e58097ea38eb9094f9dadd6c..63feb78404dfffe568df190c375d4c134311c979 100644
--- a/SAS/OTDB/sql/getVCNodeList_func.sql
+++ b/SAS/OTDB/sql/getVCNodeList_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getVCNodeList(VARCHAR(150), INT4, BOOLEAN)
   RETURNS SETOF OTDBnodeDef AS '
-    --  $Id$
 	DECLARE
 		vRecord			RECORD;
 		vRestriction	VARCHAR(200);
diff --git a/SAS/OTDB/sql/getVCparams_func.sql b/SAS/OTDB/sql/getVCparams_func.sql
index 29c4ae5283bea6a0fb5c8e4bf94c4c9ae70c43f1..90de833bbfc50d7a57aeb828cd8ac6b0b39bfa6a 100644
--- a/SAS/OTDB/sql/getVCparams_func.sql
+++ b/SAS/OTDB/sql/getVCparams_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getVCparams(INT4)
   RETURNS SETOF OTDBparamDef AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getVHitemList_func.sql b/SAS/OTDB/sql/getVHitemList_func.sql
index 6721449149d4bbfaa35f2c9922683e1534bd9864..73ea66cedba555c21632f437e76487a41a05693d 100644
--- a/SAS/OTDB/sql/getVHitemList_func.sql
+++ b/SAS/OTDB/sql/getVHitemList_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION getVHitemList(INT4, INT4, INT4)
   RETURNS SETOF OTDBnode AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 		vFullname	VARCHAR(250);
@@ -104,7 +103,6 @@ CREATE OR REPLACE FUNCTION getVHitemList(INT4, INT4, INT4)
 --
 CREATE OR REPLACE FUNCTION getVHitemList(INT4, VARCHAR(120))
   RETURNS SETOF OTDBnode AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getVICnodeDef_func.sql b/SAS/OTDB/sql/getVICnodeDef_func.sql
index 6a088f54a81d490603777176ece0099ca43ec21f..b29c15ea3127205dd1a2b99ebe569b449179734c 100644
--- a/SAS/OTDB/sql/getVICnodeDef_func.sql
+++ b/SAS/OTDB/sql/getVICnodeDef_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getVICnodedef(INT4)
   RETURNS OTDBnodeDef AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
@@ -71,7 +70,6 @@ CREATE OR REPLACE FUNCTION getVICnodedef(INT4)
 --
 CREATE OR REPLACE FUNCTION getVICnodedef(VARCHAR(40), INT4, INT2)
   RETURNS OTDBnodeDef AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
@@ -110,7 +108,6 @@ CREATE OR REPLACE FUNCTION getVICnodedef(VARCHAR(40), INT4, INT2)
 --
 CREATE OR REPLACE FUNCTION getVICnodedef(INT4, VARCHAR(150), VARCHAR(150))
   RETURNS OTDBnode AS '
-    --  $Id$
 	DECLARE
 		vNodeID		VICtemplate.nodeID%TYPE;
 		vRecord		RECORD;
diff --git a/SAS/OTDB/sql/getVICparamDef_func.sql b/SAS/OTDB/sql/getVICparamDef_func.sql
index 8ce28fd22f4fc6395b4caf613204c1c54e57db69..e4e8cc64ddbfa709dbf3bc108b1eaaad1605a3d4 100644
--- a/SAS/OTDB/sql/getVICparamDef_func.sql
+++ b/SAS/OTDB/sql/getVICparamDef_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getVICParamDef(INT4)
   RETURNS OTDBparamDef AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getVTchildren_func.sql b/SAS/OTDB/sql/getVTchildren_func.sql
index 86fdd605681f0608dfbca9e4de6853c131af2b9c..e37d563e952846b79412d10fe0c6bd23b5964ce2 100644
--- a/SAS/OTDB/sql/getVTchildren_func.sql
+++ b/SAS/OTDB/sql/getVTchildren_func.sql
@@ -37,7 +37,6 @@
 --
 CREATE OR REPLACE FUNCTION getVTChildren(INT4, TEXT)
   RETURNS SETOF OTDBnode AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getVTitemList_func.sql b/SAS/OTDB/sql/getVTitemList_func.sql
index a14cc456f7f1474bd915ce7f5d5ffabefa741cd8..961c843595666da3000f61cf7a9bc076d6caffd6 100644
--- a/SAS/OTDB/sql/getVTitemList_func.sql
+++ b/SAS/OTDB/sql/getVTitemList_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getVTitemList(INT4, VARCHAR(150))
   RETURNS SETOF OTDBnode AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 
diff --git a/SAS/OTDB/sql/getVTitem_func.sql b/SAS/OTDB/sql/getVTitem_func.sql
index 906e73f09eafc02c749e26e990eceecfd0c60845..3adcb3010be43875b361f048f8f139ab8766ae63 100644
--- a/SAS/OTDB/sql/getVTitem_func.sql
+++ b/SAS/OTDB/sql/getVTitem_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION getVTitemRecursive(INT4, VARCHAR(150), INT4)
   RETURNS OTDBnode AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		vRecord			RECORD;
 		vParentName		VARCHAR(150);
@@ -115,7 +114,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION getVTitem(INT4, VARCHAR(150))
   RETURNS OTDBnode AS $$
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
     DECLARE
 	  vRecord	RECORD;
 
diff --git a/SAS/OTDB/sql/hVICsearchParamID_func.sql b/SAS/OTDB/sql/hVICsearchParamID_func.sql
index adb7cce96f17f6746e086f5aa20ffa605d6bc9fb..5ad2644bcf059e10dd5d976299d292c58fb31f90 100644
--- a/SAS/OTDB/sql/hVICsearchParamID_func.sql
+++ b/SAS/OTDB/sql/hVICsearchParamID_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION hVICsearchParamID(VARCHAR(150))
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 	  vDotPos		INT4;
 	  vFieldnr		INT4;
diff --git a/SAS/OTDB/sql/instanciateTree_func.sql b/SAS/OTDB/sql/instanciateTree_func.sql
index 5da72dfb3ee08670f8044a2713984b9af7e8f802..39be36d681f9e6438690c7d0ebef980f1f8a21c5 100644
--- a/SAS/OTDB/sql/instanciateTree_func.sql
+++ b/SAS/OTDB/sql/instanciateTree_func.sql
@@ -37,7 +37,6 @@
 --
 CREATE OR REPLACE FUNCTION getTemplateOrigin(INT4)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vTemplateID		INT4;
 		vName			OTDBtree.name%TYPE;
@@ -78,7 +77,6 @@ CREATE OR REPLACE FUNCTION getTemplateOrigin(INT4)
 --
 CREATE OR REPLACE FUNCTION resolveVHparam(INT4, TEXT)
   RETURNS TEXT AS '
-    --  $Id$
 	DECLARE
 		vDotpos		INTEGER;
 		vNodeName	VARCHAR(200);
@@ -179,7 +177,6 @@ CREATE OR REPLACE FUNCTION resolveVHparam(INT4, TEXT)
 --
 CREATE OR REPLACE FUNCTION instanciateVHparams(INT4, INT4, INT4, TEXT)
   RETURNS VOID AS '
-    --  $Id$
 	DECLARE
 		vParam	RECORD;
 
@@ -218,7 +215,6 @@ CREATE OR REPLACE FUNCTION instanciateVHparams(INT4, INT4, INT4, TEXT)
 --
 CREATE OR REPLACE FUNCTION instanciateVHleafNode(INT4, INT4, INT4, INT2, TEXT)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vNode			RECORD;
 		vNewNodeID		VICtemplate.nodeID%TYPE;
@@ -282,7 +278,6 @@ CREATE OR REPLACE FUNCTION instanciateVHleafNode(INT4, INT4, INT4, INT2, TEXT)
 --
 CREATE OR REPLACE FUNCTION instanciateVHsubTree(INT4, INT4, INT4, TEXT)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 	  vNode				RECORD;
 	  vVTnode			RECORD;
@@ -371,7 +366,6 @@ CREATE OR REPLACE FUNCTION instanciateVHsubTree(INT4, INT4, INT4, TEXT)
 --
 CREATE OR REPLACE FUNCTION instanciateVHtree(INT4, INT4)
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 		vFunction  CONSTANT		INT2 := 1;
 		TTVHtree   CONSTANT		INT2 := 30;
diff --git a/SAS/OTDB/sql/isTopComponent_func.sql b/SAS/OTDB/sql/isTopComponent_func.sql
index 78b086471a75769b1737082aab9694f00ee0268b..002794b76e9e79ab6f404f48ed0c1c6080ba81fa 100644
--- a/SAS/OTDB/sql/isTopComponent_func.sql
+++ b/SAS/OTDB/sql/isTopComponent_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION isTopComponent(INT)
   RETURNS BOOLEAN AS '
-    --  $Id$
 	DECLARE
 		vNodeID		VICnodeDEF.nodeID%TYPE;
 
diff --git a/SAS/OTDB/sql/misc_func.sql b/SAS/OTDB/sql/misc_func.sql
index ceb3f5327380dd732706d7e277af53f4827449b2..8445079f97486fe826b840f0de7267a4400ff997 100644
--- a/SAS/OTDB/sql/misc_func.sql
+++ b/SAS/OTDB/sql/misc_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION isAuthorized(INT4, INT4, INT2, INT4)
   RETURNS BOOLEAN AS $$
-    --  $Id$
 	DECLARE
 		vTreeType		OTDBtree.treetype%TYPE;
 		vState			OTDBtree.state%TYPE;
@@ -83,7 +82,6 @@ $$ LANGUAGE plpgsql;
 --
 CREATE OR REPLACE FUNCTION whoIs(INT4)
   RETURNS INT4 AS '
-    --  $Id$
 	BEGIN
 		RETURN 1;		-- for now return userid 1
 	END;
@@ -103,7 +101,6 @@ CREATE OR REPLACE FUNCTION whoIs(INT4)
 --
 CREATE OR REPLACE FUNCTION VersionNrString(INT4)
   RETURNS VARCHAR(20) AS $$
-    --  $Id$
 	BEGIN
 		RETURN $1/10000 || '.' || ($1/100)%100 || '.' || $1%100;
 	END;
@@ -122,7 +119,6 @@ $$ LANGUAGE plpgsql IMMUTABLE;
 --
 CREATE OR REPLACE FUNCTION VersionNrValue(VARCHAR(50))
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 		vRelease		INT4;
 		vUpdate			INT4;
@@ -150,7 +146,6 @@ $$ LANGUAGE plpgsql IMMUTABLE;
 --
 CREATE OR REPLACE FUNCTION getVersionNr(VARCHAR(150))
   RETURNS INT4 AS $$
-    --  $Id$
 	BEGIN
 		RETURN VersionNrValue(substring($1 from '%{#"%#"}' for '#'));
 	END;
@@ -170,7 +165,6 @@ $$ LANGUAGE plpgsql IMMUTABLE;
 --
 CREATE OR REPLACE FUNCTION childNodeName(VARCHAR(150), INT4)
   RETURNS VARCHAR(150) AS $$
-    --  $Id$
 	BEGIN
 		RETURN '#' || $1 || '{' || VersionNrString($2) || '}';
 	END;
@@ -190,7 +184,6 @@ $$ LANGUAGE plpgsql IMMUTABLE;
 --
 CREATE OR REPLACE FUNCTION cleanNodeName(VARCHAR(150))
   RETURNS TEXT AS $$
-    --  $Id$
 	BEGIN
 		IF substr($1, length($1)) = '}' THEN
 			RETURN ltrim(substr($1, 1, strpos($1,'{')-1), '#');
@@ -215,7 +208,6 @@ $$ LANGUAGE plpgsql IMMUTABLE;
 --
 CREATE OR REPLACE FUNCTION strippedNodeName(VARCHAR(150))
   RETURNS TEXT AS $$
-    --  $Id$
 	DECLARE
 		vColonPos	INT;
 		vName		VARCHAR(150);
@@ -242,7 +234,6 @@ $$ LANGUAGE plpgsql IMMUTABLE;
 --
 CREATE OR REPLACE FUNCTION isReference(TEXT)
   RETURNS BOOLEAN AS $$
-    --  $Id$
 	BEGIN
 		RETURN substr($1, 1, 2) = '>>';
 	END;
@@ -259,7 +250,6 @@ $$ LANGUAGE plpgsql IMMUTABLE;
 --
 CREATE OR REPLACE FUNCTION calcArraySize(TEXT)
   RETURNS TEXT AS $$
-    --  $Id$
 	DECLARE
 		vSize		INTEGER;
 		vArray		TEXT;
diff --git a/SAS/OTDB/sql/newTree_func.sql b/SAS/OTDB/sql/newTree_func.sql
index b0495585eebc8cc5750bcd0fb09529f6c28c1419..fca8019d21a08e0b155dcd4747423b947936647e 100644
--- a/SAS/OTDB/sql/newTree_func.sql
+++ b/SAS/OTDB/sql/newTree_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION newTree(INT4, INT4, INT4, INT2, INT2, INT2, INT4)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vFunction		INT2 := 1;
 		vNewTreeID		OTDBtree.treeID%TYPE;
diff --git a/SAS/OTDB/sql/saveSchedulerInfo_func.sql b/SAS/OTDB/sql/saveSchedulerInfo_func.sql
index 26367abc81d4456d8d57a94af29a10bdca67e82f..a69cbd15f6194fb90783d3f6ffb112171d5d3302 100644
--- a/SAS/OTDB/sql/saveSchedulerInfo_func.sql
+++ b/SAS/OTDB/sql/saveSchedulerInfo_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION saveSchedulerInfo(INT4, INT4, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT)
   RETURNS BOOLEAN AS $$ 
-    --  $Id: addComponentToVT_func.sql 19935 2012-01-25 09:06:14Z mol $
 	DECLARE
 		TThierarchy CONSTANT	INT2 := 30;
 		vFunction   CONSTANT	INT2 := 1;
diff --git a/SAS/OTDB/sql/saveVCnode_func.sql b/SAS/OTDB/sql/saveVCnode_func.sql
index 63bbd27e833785b27b1c94dc96987655881c0c7b..7f346e1dacb6eec16a75a4a23d6deaf37e508438 100644
--- a/SAS/OTDB/sql/saveVCnode_func.sql
+++ b/SAS/OTDB/sql/saveVCnode_func.sql
@@ -37,7 +37,6 @@
 CREATE OR REPLACE FUNCTION saveVCnode(INT4, INT4, VARCHAR(150), INT4, 
 										INT2, TEXT, TEXT)
   RETURNS INT4 AS $$
-    --  $Id$
 	DECLARE
 		vNodeID			VICnodedef.nodeID%TYPE;
 		vName			VICnodedef.name%TYPE;
diff --git a/SAS/OTDB/sql/saveVICparamDef_func.sql b/SAS/OTDB/sql/saveVICparamDef_func.sql
index faf557cff7b8ca5edecb8bf681bf8998f2ed4048..cbe0c70521afb3b100bf145869a71d331e226680 100644
--- a/SAS/OTDB/sql/saveVICparamDef_func.sql
+++ b/SAS/OTDB/sql/saveVICparamDef_func.sql
@@ -37,7 +37,6 @@
 CREATE OR REPLACE FUNCTION saveVICparamDef(INT4, INT4, VARCHAR(150), INT2, 
 							INT2, INT2, INT2, BOOLEAN, TEXT, TEXT)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vParamID		VICparamDef.paramID%TYPE;
 		vName			VICparamDef.name%TYPE;
diff --git a/SAS/OTDB/sql/searchPICinPeriod_func.sql b/SAS/OTDB/sql/searchPICinPeriod_func.sql
index 8fd0e44ed820440e5c9551ba4fe8c396f25b92c1..7796b166ca155677d292884d0bfa3ec51276b69b 100644
--- a/SAS/OTDB/sql/searchPICinPeriod_func.sql
+++ b/SAS/OTDB/sql/searchPICinPeriod_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION searchPICinPeriod(INT4, INT4, INT4, TIMESTAMP, TIMESTAMP)
   RETURNS SETOF OTDBvalue AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 		vFullname	VARCHAR(150);
diff --git a/SAS/OTDB/sql/searchVHinPeriod_func.sql b/SAS/OTDB/sql/searchVHinPeriod_func.sql
index cbbf4fbf2b0fa079a93bae13f4a00c56c55cb1e5..3ae3bca4a2b0a87168659428136b5f126eb3aa86 100644
--- a/SAS/OTDB/sql/searchVHinPeriod_func.sql
+++ b/SAS/OTDB/sql/searchVHinPeriod_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION searchVHinPeriod(INT4, INT4, INT4, TIMESTAMP, TIMESTAMP)
   RETURNS SETOF OTDBvalue AS '
-    --  $Id$
 	DECLARE
 		vRecord		RECORD;
 		vFullname	VARCHAR(150);
diff --git a/SAS/OTDB/sql/security_func.sql b/SAS/OTDB/sql/security_func.sql
index bfed36af51aec07de38cebc51abe66f9cf2669e2..cf76ce9047f7361bee512b72b16b2261880deca6 100644
--- a/SAS/OTDB/sql/security_func.sql
+++ b/SAS/OTDB/sql/security_func.sql
@@ -26,7 +26,6 @@
 -- Check is to given combination of username and password is valid
 CREATE OR REPLACE FUNCTION OTDBlogin(VARCHAR(80), VARCHAR(80))
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 		vUserNr		INT4;
 
@@ -55,7 +54,6 @@ CREATE OR REPLACE FUNCTION OTDBlogin(VARCHAR(80), VARCHAR(80))
 -- Check if the user is allowed to perform a task
 CREATE OR REPLACE FUNCTION OTDBauthenticate(INTEGER, INTEGER, INTEGER)
   RETURNS INT4 AS '
-    --  $Id$
 	DECLARE
 
 	BEGIN
diff --git a/SAS/OTDB/sql/setDescription_func.sql b/SAS/OTDB/sql/setDescription_func.sql
index d9e9a597c57c648ab83f7be2ff56f4ae0969a856..19691a43a148d28202691d299c1c093d8a010199 100644
--- a/SAS/OTDB/sql/setDescription_func.sql
+++ b/SAS/OTDB/sql/setDescription_func.sql
@@ -33,7 +33,6 @@
 --
 CREATE OR REPLACE FUNCTION setDescription(INT4, INT4, TEXT)
   RETURNS BOOLEAN AS '
-    --  $Id$
 	DECLARE
 		vFunction				INT2 := 1;
 		vIsAuth					BOOLEAN;
diff --git a/SAS/OTDB/sql/setMomInfo_func.sql b/SAS/OTDB/sql/setMomInfo_func.sql
index caaac5c1bf836ad40a94698bae2f4fbb4d84270d..17267e110427eb7cd767adc3fa170ce33b6df7c5 100644
--- a/SAS/OTDB/sql/setMomInfo_func.sql
+++ b/SAS/OTDB/sql/setMomInfo_func.sql
@@ -33,7 +33,6 @@
 --
 CREATE OR REPLACE FUNCTION setMomInfo(INT4, INT4, INT4, INT4, TEXT)
   RETURNS BOOLEAN AS $$
-    --  $Id$
 	DECLARE
 		vFunction				INT2 := 1;
 		vIsAuth					BOOLEAN;
diff --git a/SAS/OTDB/sql/setSchedule_func.sql b/SAS/OTDB/sql/setSchedule_func.sql
index 7b2ece031b7de6890fbf28af2a1afa3ef808eff7..f64b4ca83ca27ad9723e51ccdd857de40c50cc0e 100644
--- a/SAS/OTDB/sql/setSchedule_func.sql
+++ b/SAS/OTDB/sql/setSchedule_func.sql
@@ -33,7 +33,6 @@
 --
 CREATE OR REPLACE FUNCTION setSchedule(INT4, INT4, VARCHAR(20), VARCHAR(20))
   RETURNS BOOLEAN AS $$
-    --  $Id$
 	DECLARE
 		vFunction				INT2 := 1;
 		TSactive				CONSTANT INT2 := 600;
diff --git a/SAS/OTDB/sql/setTreeState_func.sql b/SAS/OTDB/sql/setTreeState_func.sql
index 1975e6a45fd55aa4686de852659dfa9011320da4..116eafb77c362e0a2f501b23e7949077f9b6d559 100644
--- a/SAS/OTDB/sql/setTreeState_func.sql
+++ b/SAS/OTDB/sql/setTreeState_func.sql
@@ -35,7 +35,6 @@
 --
 CREATE OR REPLACE FUNCTION setTreeState(INT4, INT4, INT2)
   RETURNS BOOLEAN AS '
-    --  $Id$
 	DECLARE
 		vFunction				INT2 := 1;
 		vTreeState				OTDBtree.state%TYPE;
diff --git a/SAS/OTDB/sql/updateVTnode_func.sql b/SAS/OTDB/sql/updateVTnode_func.sql
index b47ea4ffd95c10e2ef8693a489310541fa69f615..3b1eb2cda0144dee1c82be1a3e2afda8b21551e2 100644
--- a/SAS/OTDB/sql/updateVTnode_func.sql
+++ b/SAS/OTDB/sql/updateVTnode_func.sql
@@ -36,7 +36,6 @@
 --
 CREATE OR REPLACE FUNCTION updateVTnode(INT4, INT4, INT4, INT2, TEXT)
   RETURNS BOOLEAN AS '
-    --  $Id$
 	DECLARE
 		TTtemplate  CONSTANT	INT2 := 20;
 		TThierarchy CONSTANT	INT2 := 30;
diff --git a/lofar_config.h.cmake b/lofar_config.h.cmake
index 901d33f20771617c31a4353b92837aa818243921..bc66715589fb890db06f5b1da9045001c9a40314 100644
--- a/lofar_config.h.cmake
+++ b/lofar_config.h.cmake
@@ -172,6 +172,3 @@
 
 /* Define to 1 if you have a declaration for the `getprotobyname_r' function. */
 #cmakedefine HAVE_GETPROTOBYNAME_R 1
-
-/* Define to 1 if you have a declaration for the `strnlen' function. */
-#cmakedefine HAVE_STRNLEN 1