Index: branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs	(revision 13538)
@@ -1,115 +1,95 @@
-﻿using DistributedGA.Core.Domain;
-using System;
+﻿using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.ServiceModel;
-using System.Text;
-using System.Threading.Tasks;
 using System.Timers;
+using DistributedGA.Core.Domain;
 
-namespace DistributedGA.ContactServer
-{
+namespace DistributedGA.ContactServer {
 
-    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
-    public class ContactServiceImpl : IContactService
-    {
+  [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
+  public class ContactServiceImpl : IContactService {
 
-        private ConcurrentDictionary<PeerInfo, DateTime> allPeers = null;
+    private ConcurrentDictionary<PeerInfo, DateTime> allPeers = null;
 
-        private Timer timer = null;
+    private Timer timer = null;
 
-        public ContactServiceImpl()
-        {
-            allPeers = new ConcurrentDictionary<PeerInfo, DateTime>();
+    private Object logLock = new Object();
 
-            timer = new Timer(60 * 1000); //each hour
-            timer.Elapsed += CleanUpContactTable;
-            timer.Start();
+    public ContactServiceImpl() {
+      allPeers = new ConcurrentDictionary<PeerInfo, DateTime>();
+
+      timer = new Timer(60 * 1000); //each hour
+      timer.Elapsed += CleanUpContactTable;
+      timer.Start();
+    }
+
+    public void RegisterPeer(PeerInfo source) {
+      try {
+        UpdateHeartbeat(source);
+      } catch (Exception ex) {
+        AddError("ContactServiceImpl.RegisterPeer", ex);
+      }
+    }
+
+    public List<PeerInfo> GetPeerList(PeerInfo source) {
+      try {
+        UpdateHeartbeat(source);
+        //only return peers of the same work group and not the sender itself
+        return allPeers.Keys.Where(x => {
+          if (source.ProblemInstance.Equals(x.ProblemInstance) &&
+              (!(x.IpAddress.Equals(source.IpAddress) && (x.Port.Equals(source.Port)))))
+            return true;
+          else
+            return false;
+        }).ToList();
+      } catch (Exception ex) {
+        AddError("ContactServiceImpl.GetPeerList", ex);
+        return null;
+      }
+    }
+
+    public void MakeLog(PeerInfo source, string msg) {
+      try {
+        // TODO 
+        lock (logLock) {
+          File.AppendAllText("Log.txt", string.Concat(source.IpAddress, ":", source.Port, ",", source.ProblemInstance, ",", msg, Environment.NewLine));
         }
+      } catch (Exception ex) {
+        //Nothing to do because maybe called from adderror
+      }
+    }
 
-        public void RegisterPeer(PeerInfo source)
-        {
-            try
-            {
-                UpdateHeartbeat(source);
-            }
-            catch (Exception ex)
-            {
-                AddError("ContactServiceImpl.RegisterPeer", ex);
-            }
+    private void UpdateHeartbeat(PeerInfo source) {
+      DateTime now = DateTime.Now;
+      allPeers.AddOrUpdate(source, now, (k, v) => v = now);
+    }
+
+    private void CleanUpContactTable(object sender, ElapsedEventArgs e) {
+      DateTime deadline = DateTime.Now;
+      //collect items to remove
+      List<PeerInfo> itemsToDelete = new List<PeerInfo>();
+      foreach (PeerInfo pi in allPeers.Keys) {
+        DateTime tmp;
+        if (allPeers.TryGetValue(pi, out tmp)) {
+          //if (tmp.AddHours(1f) < deadline)
+          if (tmp < deadline.AddHours(1f)) {
+            itemsToDelete.Add(pi);
+          }
         }
+      }
+      //remove items
+      foreach (PeerInfo pi in itemsToDelete) {
+        DateTime tmp;
+        allPeers.TryRemove(pi, out tmp);
+      }
+    }
 
-        public List<PeerInfo> GetPeerList(PeerInfo source)
-        {
-            try
-            {
-                UpdateHeartbeat(source);
-                //only return peers of the same work group and not the sender itself
-                return allPeers.Keys.Where(x =>
-                {
-                    if (source.ProblemInstance.Equals(x.ProblemInstance) &&
-                        (!(x.IpAddress.Equals(source.IpAddress) && (x.Port.Equals(source.Port)))))
-                        return true;
-                    else
-                        return false;
-                }).ToList();
-            }
-            catch (Exception ex)
-            {
-                AddError("ContactServiceImpl.GetPeerList", ex);
-                return null;
-            }
-        }
+    private void AddError(string source, Exception ex) {
+      MakeLog(new PeerInfo() { ProblemInstance = "ContactServer  Error at " + source }, ex.Message);
+    }
 
-        public void MakeLog(PeerInfo source, string msg)
-        {
-            try
-            {
-                // TODO 
-
-            }
-            catch (Exception ex)
-            {
-                AddError("ContactServiceImpl.GetPeerList", ex);
-            }
-        }
-
-        private void UpdateHeartbeat(PeerInfo source)
-        {
-            DateTime now = DateTime.Now;
-            allPeers.AddOrUpdate(source, now, (k, v) => v = now);
-        }
-
-        private void CleanUpContactTable(object sender, ElapsedEventArgs e)
-        {
-            DateTime deadline = DateTime.Now;
-            //collect items to remove
-            List<PeerInfo> itemsToDelete = new List<PeerInfo>();
-            foreach (PeerInfo pi in allPeers.Keys)
-            {
-                DateTime tmp;
-                if (allPeers.TryGetValue(pi, out tmp))
-                {
-                    //if (tmp.AddHours(1f) < deadline)
-                    if (tmp < deadline.AddHours(1f))
-                    {
-                        itemsToDelete.Add(pi);
-                    }
-                }
-            }
-            //remove items
-            foreach (PeerInfo pi in itemsToDelete)
-            {
-                DateTime tmp;
-                allPeers.TryRemove(pi, out tmp);
-            }
-        }
-
-        private void AddError(string source, Exception ex)
-        {
-            MakeLog(new PeerInfo() { ProblemInstance = "ContactServer  Error at " + source }, ex.Message);
-        }
-
-    }
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.ContactServer/obj/Debug/WcfConfigValidationData.tmp
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.ContactServer/obj/Debug/WcfConfigValidationData.tmp	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.ContactServer/obj/Debug/WcfConfigValidationData.tmp	(revision 13538)
@@ -1,1 +1,1 @@
-<ValidationRecord xmlns="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.ServiceModel.Validation" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><TimeStamps xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><a:dateTime>2016-01-18T09:27:09.7709563Z</a:dateTime><a:dateTime>2016-01-18T09:31:18.4519841Z</a:dateTime><a:dateTime>2015-04-01T13:05:26.8346639Z</a:dateTime></TimeStamps></ValidationRecord>
+<ValidationRecord xmlns="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.ServiceModel.Validation" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><TimeStamps xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><a:dateTime>2016-01-18T10:18:36.7404261Z</a:dateTime><a:dateTime>2016-01-18T12:23:29.9363892Z</a:dateTime><a:dateTime>2015-04-01T13:05:26.8346639Z</a:dateTime></TimeStamps></ValidationRecord>
Index: branches/thasling/DistributedGA/DistributedGA.Core.Host/App.config
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core.Host/App.config	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core.Host/App.config	(revision 13538)
@@ -4,3 +4,6 @@
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
     </startup>
+  <appSettings>
+    <add key="ContactServerURL" value="http://localhost:9090/DistributedGA.ContactServer/ContactService"/>
+  </appSettings>
 </configuration>
Index: branches/thasling/DistributedGA/DistributedGA.Core.Host/bin/Debug/DistributedGA.Core.Host.exe.config
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core.Host/bin/Debug/DistributedGA.Core.Host.exe.config	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core.Host/bin/Debug/DistributedGA.Core.Host.exe.config	(revision 13538)
@@ -4,3 +4,6 @@
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
     </startup>
+  <appSettings>
+    <add key="ContactServerURL" value="http://localhost:9090/DistributedGA.ContactServer/ContactService"/>
+  </appSettings>
 </configuration>
Index: branches/thasling/DistributedGA/DistributedGA.Core.Host/bin/Debug/DistributedGA.Core.Host.vshost.exe.config
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core.Host/bin/Debug/DistributedGA.Core.Host.vshost.exe.config	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core.Host/bin/Debug/DistributedGA.Core.Host.vshost.exe.config	(revision 13538)
@@ -4,3 +4,7 @@
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
     </startup>
+  <appSettings>
+    <add key="ContactServerURL" value="http://localhost:9090/DistributedGA.ContactServer/ContactService"/>
+
+  </appSettings>
 </configuration>
Index: branches/thasling/DistributedGA/DistributedGA.Core/DistributedGA.Core.csproj
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/DistributedGA.Core.csproj	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core/DistributedGA.Core.csproj	(revision 13538)
@@ -32,4 +32,5 @@
   <ItemGroup>
     <Reference Include="System" />
+    <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
     <Reference Include="System.Runtime.Serialization" />
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/MessageContractImpl.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/MessageContractImpl.cs	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/MessageContractImpl.cs	(revision 13538)
@@ -1,27 +1,20 @@
-﻿using DistributedGA.Core.Domain;
+﻿using System;
+using System.ServiceModel;
+using DistributedGA.Core.Domain;
 using DistributedGA.Core.Interface;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.ServiceModel;
-using System.Text;
-using System.Threading.Tasks;
 
-namespace DistributedGA.Core.Implementation
-{
-    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
-    public class MessageContractImpl : IMessageContract
-    {
-        public void SendPopulation(PeerInfo sender, SolutionInfo[] population)
-        {
-            MessageRecieveEventArgs args = new MessageRecieveEventArgs() { Sender = sender, Population = population };
+namespace DistributedGA.Core.Implementation {
+  [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
+  public class MessageContractImpl : IMessageContract {
+    public void SendPopulation(PeerInfo sender, SolutionInfo[] population) {
+      MessageRecieveEventArgs args = new MessageRecieveEventArgs() { Sender = sender, Population = population };
 
-            if (MessageRecieved != null)
-            {
-                MessageRecieved(this, args);
-            }
-        }
+      if (MessageRecieved != null) {
+        MessageRecieved(this, args);
+      }
+    }
 
-        public event EventHandler<MessageRecieveEventArgs> MessageRecieved;
-    }
+    public event EventHandler<MessageRecieveEventArgs> MessageRecieved;
+
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13538)
@@ -1,177 +1,145 @@
-﻿using DistributedGA.Core.Domain;
-using DistributedGA.Core.Interface;
-using System;
+﻿using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
-using System.Linq;
 using System.Net;
-using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
+using DistributedGA.Core.Domain;
+using DistributedGA.Core.Interface;
 
-namespace DistributedGA.Core.Implementation
-{
-    public class PeerNetworkMessageHandler : IMessageHandler
-    {
-        //own peer-instance Information
-        private PeerInfo ownInstance = null;
+namespace DistributedGA.Core.Implementation {
+  public class PeerNetworkMessageHandler : IMessageHandler {
+    //own peer-instance Information
+    private PeerInfo ownInstance = null;
 
-        //uses peer-list from IPeerListManager to decide which peers to contact
-        private IPeerListManager peerListManager;
+    //uses peer-list from IPeerListManager to decide which peers to contact
+    private IPeerListManager peerListManager;
 
-        //uses IMessageSender to send populations to peers
-        private IMessageSender sender = null;
+    //uses IMessageSender to send populations to peers
+    private IMessageSender sender = null;
 
-        //provides current population for the higher layer IMigrationOperator
-        //to queues are used to gather and and provide population more efficiently
-        private ConcurrentQueue<SolutionInfo> collectedResults1;
-        private ConcurrentQueue<SolutionInfo> collectedResults2;
-        private bool collectingInFirstQueue = true; //currently first queue is filled with recieved populations
+    //provides current population for the higher layer IMigrationOperator
+    //to queues are used to gather and and provide population more efficiently
+    private ConcurrentQueue<SolutionInfo> collectedResults1;
+    private ConcurrentQueue<SolutionInfo> collectedResults2;
+    private bool collectingInFirstQueue = true; //currently first queue is filled with recieved populations
 
-        //uses IMessageService for recieving population from one peer at once
-        private IMessageService host = null;
+    //uses IMessageService for recieving population from one peer at once
+    private IMessageService host = null;
 
-        public void Init()
-        {
-            try
-            {
-                ownInstance = new PeerInfo()
-                {
-                    IpAddress = GetExternalIpAddress(),
-                    Port = 0,
-                    ProblemInstance = "TestProblem"
-                }; // TODO: get own peerinfo
+    public void Init() {
+      try {
+        ownInstance = new PeerInfo() {
+          IpAddress = GetExternalIpAddress(),
+          Port = 0,
+          ProblemInstance = "TestProblem"
+        }; // TODO: get own peerinfo
 
-                collectedResults1 = new ConcurrentQueue<SolutionInfo>();
-                collectedResults2 = new ConcurrentQueue<SolutionInfo>();
+        collectedResults1 = new ConcurrentQueue<SolutionInfo>();
+        collectedResults2 = new ConcurrentQueue<SolutionInfo>();
 
-                host = new WcfMessageService();
-                ownInstance.Port = host.Init(ownInstance.IpAddress); //getting port, on which service is hostet
-                host.OnPopulationRecieved += new EventHandler<MessageRecieveEventArgs>(OnPopulationRecieved);
+        host = new WcfMessageService();
+        ownInstance.Port = host.Init(ownInstance.IpAddress); //getting port, on which service is hostet
+        host.OnPopulationRecieved += new EventHandler<MessageRecieveEventArgs>(OnPopulationRecieved);
 
-                peerListManager = new WcfPeerListManager();
-                //peerListManager = new TestPeerListManager();
-                peerListManager.Init(ownInstance);
+        peerListManager = new WcfPeerListManager();
+        //peerListManager = new TestPeerListManager();
+        peerListManager.Init(ownInstance);
 
-                sender = new WcfMessageSender();
-                sender.Init(ownInstance);
+        sender = new WcfMessageSender();
+        sender.Init(ownInstance);
 
+      } catch (Exception ex) {
+        AddError("PeerNetworkMessageHandler.Init", ex);
+      }
+    }
+
+    public void PublishMigrationInfo(SolutionInfo[] population) {
+      try {
+        foreach (PeerInfo peer in peerListManager.GetPeerList()) {
+          //HACK: manipulate for monitoring in test
+          foreach (SolutionInfo si in population) {
+            si.IterationNumber = ownInstance.Port;
+          }
+          //maybe something will go wrong during network communication...
+          try {
+            //TODO: NEEDED WHEN PEER IS IN LAN, TOO????
+            //Note: If IP is same as own: it is a "localhost"
+            if (peer.IpAddress.Equals(ownInstance.IpAddress)) {
+              peer.IpAddress = "localhost";
             }
-            catch (Exception ex)
-            {
-                AddError("PeerNetworkMessageHandler.Init", ex);
-            }
+            sender.SendPopulation(peer, population);
+
+          } catch (Exception ex) {
+            //TBD
+          }
         }
+      } catch (Exception ex) {
+        AddError("PeerNetworkMessageHandler.PublishMigrationInfo", ex);
+      }
+    }
 
-        public void PublishMigrationInfo(SolutionInfo[] population)
-        {
-            try
-            {
-                foreach (PeerInfo peer in peerListManager.GetPeerList())
-                {
-                    //maybe something will go wrong during network communication...
-                    try
-                    {
-                        //TODO: NEEDED WHEN PEER IS IN LAN, TOO????
-                        //Note: If IP is same as own: it is a "localhost"
-                        if(peer.IpAddress.Equals(ownInstance.IpAddress))
-                        {
-                            peer.IpAddress = "localhost";
-                        }
-                        sender.SendPopulation(peer, population);
+    public SolutionInfo[] GetMigrationInfo() {
+      try {
+        List<SolutionInfo> res = new List<SolutionInfo>();
+        ConcurrentQueue<SolutionInfo> source = null;
+        SolutionInfo item = null;
+        if (collectingInFirstQueue) {
+          collectingInFirstQueue = false; //switching queue
+          source = collectedResults1;
+        } else {
+          collectingInFirstQueue = true; //switching queue
+          source = collectedResults2;
+        }
+        //creating resultset
+        while (!source.IsEmpty) {
+          if (source.TryDequeue(out item)) {
+            res.Add(item);
+          }
+        }
+        return res.ToArray();
+      } catch (Exception ex) {
+        AddError("PeerNetworkMessageHandler.GetMigrationInfo", ex);
+        return null;
+      }
+    }
 
-                    }
-                    catch (Exception ex)
-                    {
-                        //TBD
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                AddError("PeerNetworkMessageHandler.PublishMigrationInfo", ex);
-            }
+    public PeerInfo GetPeerInfo() {
+      return ownInstance;
+    }
+
+    public List<PeerInfo> GetCurrentNetwork() {
+      return peerListManager.GetPeerList();
+    }
+
+    private string GetExternalIpAddress() {
+      try {
+        string externalIP;
+        externalIP = (new WebClient()).DownloadString("http://checkip.dyndns.org/");
+        externalIP = (new Regex(@"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"))
+                     .Matches(externalIP)[0].ToString();
+        return externalIP;
+      } catch { return null; }
+    }
+
+    private void OnPopulationRecieved(object sender, MessageRecieveEventArgs e) {
+      if (e != null) {
+        foreach (SolutionInfo si in e.Population) {
+          if (collectingInFirstQueue) {
+            collectedResults1.Enqueue(si);
+          } else {
+            collectedResults2.Enqueue(si);
+          }
         }
+      }
+    }
 
-        public SolutionInfo[] GetMigrationInfo()
-        {
-            try
-            {
-                List<SolutionInfo> res = new List<SolutionInfo>();
-                ConcurrentQueue<SolutionInfo> source = null;
-                SolutionInfo item = null;
-                if (collectingInFirstQueue)
-                {
-                    collectingInFirstQueue = false; //switching queue
-                    source = collectedResults1;
-                }
-                else
-                {
-                    collectingInFirstQueue = true; //switching queue
-                    source = collectedResults2;
-                }
-                //creating resultset
-                while (!source.IsEmpty)
-                {
-                    if (source.TryDequeue(out item))
-                    {
-                        res.Add(item);
-                    }
-                }
-                return res.ToArray();
-            }
-            catch (Exception ex)
-            {
-                AddError("PeerNetworkMessageHandler.GetMigrationInfo", ex);
-                return null;
-            }
-        }
+    private void AddError(string source, Exception ex) {
+      if (peerListManager != null) {
+        try {
+          peerListManager.SendLogToServer(string.Concat("Source: ", source, ", Exception: ", ex.Message));
+        } catch { }
+      }
+    }
 
-        public PeerInfo GetPeerInfo()
-        {
-            return ownInstance;
-        }
-
-        public List<PeerInfo> GetCurrentNetwork()
-        {
-            return peerListManager.GetPeerList();
-        }
-
-        private string GetExternalIpAddress()
-        {
-            try
-            {
-                string externalIP;
-                externalIP = (new WebClient()).DownloadString("http://checkip.dyndns.org/");
-                externalIP = (new Regex(@"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"))
-                             .Matches(externalIP)[0].ToString();
-                return externalIP;
-            }
-            catch { return null; }
-        }
-
-        private void OnPopulationRecieved(object sender, MessageRecieveEventArgs e)
-        {
-            if (e != null)
-            {
-                foreach (SolutionInfo si in e.Population)
-                {
-                    if (collectingInFirstQueue)
-                    {
-                        collectedResults1.Enqueue(si);
-                    }
-                    else
-                    {
-                        collectedResults2.Enqueue(si);
-                    }
-                }
-            }
-        }
-
-        private void AddError(string source, Exception ex)
-        {
-            throw new NotImplementedException();
-        }
-
-    }
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs	(revision 13538)
@@ -1,74 +1,60 @@
-﻿using DistributedGA.Core.Domain;
-using DistributedGA.Core.Interface;
-using System;
-using System.Collections.Generic;
-using System.Linq;
+﻿using System;
 using System.Net;
-using System.Net.NetworkInformation;
 using System.Net.Sockets;
 using System.ServiceModel;
-using System.ServiceModel.Description;
-using System.Text;
 using System.Threading;
-using System.Threading.Tasks;
+using DistributedGA.Core.Domain;
+using DistributedGA.Core.Interface;
 
-namespace DistributedGA.Core.Implementation
-{
-    public class WcfMessageService : IMessageService
-    {
-        public event EventHandler<MessageRecieveEventArgs> OnPopulationRecieved;
+namespace DistributedGA.Core.Implementation {
+  public class WcfMessageService : IMessageService {
+    public event EventHandler<MessageRecieveEventArgs> OnPopulationRecieved;
 
-        private static ManualResetEvent _ResetEvent = new ManualResetEvent(false);
+    private static ManualResetEvent _ResetEvent = new ManualResetEvent(false);
 
-        private IMessageContract messageContract = null;
+    private IMessageContract messageContract = null;
 
-        public int Init(string ip)
-        {
-            int port = 0;
-            //port = GetRanodmFreePort();
-            port = FreeTcpPort();
+    public int Init(string ip) {
+      int port = 0;
+      //port = GetRanodmFreePort();
+      port = FreeTcpPort();
 
-            messageContract = new MessageContractImpl();
-            messageContract.MessageRecieved += new EventHandler<MessageRecieveEventArgs>(OnMessageRecieved);
+      messageContract = new MessageContractImpl();
+      messageContract.MessageRecieved += new EventHandler<MessageRecieveEventArgs>(OnMessageRecieved);
 
-            var serviceUrl = "DistributedGA.svc";
-            new Thread(() =>
-            {
-                var baseUri = new Uri(string.Concat("http://", ip, ":", port, "/DistributedGA"));
-                var serviceUri = new Uri(baseUri, serviceUrl);
-                BasicHttpBinding binding = new BasicHttpBinding();
-                //using (var host = new ServiceHost(typeof(MessageContractImpl), serviceUri))
+      var serviceUrl = "DistributedGA.svc";
+      new Thread(() => {
+        var baseUri = new Uri(string.Concat("http://", ip, ":", port, "/DistributedGA"));
+        var serviceUri = new Uri(baseUri, serviceUrl);
+        BasicHttpBinding binding = new BasicHttpBinding();
+        //using (var host = new ServiceHost(typeof(MessageContractImpl), serviceUri))
 
-                using (var host = new ServiceHost(messageContract, serviceUri))
-                {
-                    host.AddServiceEndpoint(typeof(IMessageContract), binding, serviceUri);
+        using (var host = new ServiceHost(messageContract, serviceUri)) {
+          host.AddServiceEndpoint(typeof(IMessageContract), binding, serviceUri);
 
-                    host.Open();
+          host.Open();
 
-                    _ResetEvent.WaitOne();
-                }
-            }).Start();
-            //close service again:
-            //  _ResetEvent.Set();
-            return port;
+          _ResetEvent.WaitOne();
         }
+      }).Start();
+      //close service again:
+      //  _ResetEvent.Set();
+      return port;
+    }
 
-        private int FreeTcpPort()
-        {
-            TcpListener l = new TcpListener(IPAddress.Loopback, 0);
-            l.Start();
-            int port = ((IPEndPoint)l.LocalEndpoint).Port;
-            l.Stop();
-            return port;
-        }
+    private int FreeTcpPort() {
+      TcpListener l = new TcpListener(IPAddress.Loopback, 0);
+      l.Start();
+      int port = ((IPEndPoint)l.LocalEndpoint).Port;
+      l.Stop();
+      return port;
+    }
 
-        private void OnMessageRecieved(object sender, MessageRecieveEventArgs e)
-        {
-            if (OnPopulationRecieved != null)
-            {
-                OnPopulationRecieved(this, e);
-            }
-        }
+    private void OnMessageRecieved(object sender, MessageRecieveEventArgs e) {
+      if (OnPopulationRecieved != null) {
+        OnPopulationRecieved(this, e);
+      }
+    }
 
-    }
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs	(revision 13538)
@@ -1,88 +1,76 @@
-﻿using DistributedGA.Core.Domain;
-using DistributedGA.Core.Interface;
-using System;
+﻿using System;
 using System.Collections.Generic;
+using System.Configuration;
 using System.Linq;
 using System.ServiceModel;
-using System.Text;
-using System.Threading.Tasks;
+using DistributedGA.Core.Domain;
+using DistributedGA.Core.Interface;
 
-namespace DistributedGA.Core.Implementation
-{
-    public class WcfPeerListManager : IPeerListManager
-    {
-        private const string SERVER_STRING = "http://localhost:9090/DistributedGA.ContactServer/ContactService";
+namespace DistributedGA.Core.Implementation {
+  public class WcfPeerListManager : IPeerListManager {
+    private string SERVER_STRING = null;
 
-        private IContactService client = null;
+    private IContactService client = null;
 
-        private PeerInfo myself = null;
+    private PeerInfo myself = null;
 
-        List<PeerInfo> allPeers = null;
-        List<PeerInfo> peersForMessaging = null;
+    List<PeerInfo> allPeers = null;
+    List<PeerInfo> peersForMessaging = null;
 
-        public void Init(PeerInfo source)
-        {
-            client = CreateClient();
-            myself = source;
-            client.RegisterPeer(source);
+    public void Init(PeerInfo source) {
+      SERVER_STRING = ConfigurationManager.AppSettings["ContactServerURL"];
+      client = CreateClient();
+      myself = source;
+      client.RegisterPeer(source);
+    }
+
+    public List<PeerInfo> GetPeerList() {
+      //TODO: maybe always request a new list from the contact server so that he can refresh the heartbeat...
+      if (allPeers == null) {
+        allPeers = client.GetPeerList(myself);
+        peersForMessaging = ChoosePeersForMessaging(allPeers);
+      }
+      //return peersForMessaging;
+      return allPeers; //TODO: Enable 10% list communication
+    }
+
+    public void SendLogToServer(string msg) {
+      client.MakeLog(myself, msg);
+    }
+
+    private IContactService CreateClient() {
+      var binding = new BasicHttpBinding();
+      var endpoint = new EndpointAddress(SERVER_STRING);
+      var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint);
+
+      IContactService client = null;
+      client = myChannelFactory.CreateChannel();
+      return client;
+    }
+
+    private List<PeerInfo> ChoosePeersForMessaging(List<PeerInfo> allPeers) {
+      //communicate with 10% of the network
+      int noOfPeers = allPeers.Count / 10;
+      List<Int32> indexList = GetRandomItemIndexes(noOfPeers, 0, allPeers.Count - 1);
+      List<PeerInfo> res = new List<PeerInfo>();
+      foreach (Int32 index in indexList) {
+        res.Add(allPeers.ElementAt(index));
+      }
+      return allPeers;
+    }
+
+    private List<Int32> GetRandomItemIndexes(int noOfItems, int minValue, int maxValue) {
+      List<Int32> res = new List<Int32>();
+      Random rnd = new Random();
+      int tmp = -1;
+      while (res.Count < noOfItems) {
+        tmp = rnd.Next(minValue, maxValue);
+        if (!res.Contains(tmp)) {
+          res.Add(tmp);
         }
+      }
+      return res;
+    }
 
-        public List<PeerInfo> GetPeerList()
-        {
-            //TODO: maybe always request a new list from the contact server so that he can refresh the heartbeat...
-            if (allPeers == null)
-            {
-                allPeers = client.GetPeerList(myself);
-                peersForMessaging = ChoosePeersForMessaging(allPeers);
-            }
-            //return peersForMessaging;
-            return allPeers; //TODO: Enable 10% list communication
-        }
-
-        public void SendLogToServer(string msg)
-        {
-            client.MakeLog(myself, msg);
-        }
-
-        private IContactService CreateClient()
-        {
-            var binding = new BasicHttpBinding();
-            var endpoint = new EndpointAddress(SERVER_STRING);
-            var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint);
-
-            IContactService client = null;
-            client = myChannelFactory.CreateChannel();
-            return client;
-        }
-
-        private List<PeerInfo> ChoosePeersForMessaging(List<PeerInfo> allPeers)
-        {
-            //communicate with 10% of the network
-            int noOfPeers = allPeers.Count / 10; 
-            List<Int32> indexList = GetRandomItemIndexes(noOfPeers, 0, allPeers.Count - 1);
-            List<PeerInfo> res = new List<PeerInfo>();
-            foreach (Int32 index in indexList)
-            {
-                res.Add(allPeers.ElementAt(index));
-            }
-            return allPeers;
-        }
-
-        private List<Int32> GetRandomItemIndexes(int noOfItems, int minValue, int maxValue)
-        {
-            List<Int32> res = new List<Int32>();
-            Random rnd = new Random();
-            int tmp = -1;
-            while (res.Count < noOfItems)
-            {
-                tmp = rnd.Next(minValue, maxValue);
-                if (!res.Contains(tmp))
-                {
-                    res.Add(tmp);
-                }
-            }
-            return res;
-        }
-
-    }
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageContract.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageContract.cs	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageContract.cs	(revision 13538)
@@ -1,19 +1,13 @@
-﻿using DistributedGA.Core.Domain;
-using System;
-using System.Collections.Generic;
-using System.Linq;
+﻿using System;
 using System.ServiceModel;
-using System.Text;
-using System.Threading.Tasks;
+using DistributedGA.Core.Domain;
 
-namespace DistributedGA.Core.Interface
-{
-    [ServiceContract]
-    public interface IMessageContract
-    {
-        [OperationContract]
-        void SendPopulation(PeerInfo sender, SolutionInfo[] population);
+namespace DistributedGA.Core.Interface {
+  [ServiceContract]
+  public interface IMessageContract {
+    [OperationContract]
+    void SendPopulation(PeerInfo sender, SolutionInfo[] population);
 
-        event EventHandler<MessageRecieveEventArgs> MessageRecieved;
-    }
+    event EventHandler<MessageRecieveEventArgs> MessageRecieved;
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Core/obj/Debug/DistributedGA.Core.csproj.FileListAbsolute.txt
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Core/obj/Debug/DistributedGA.Core.csproj.FileListAbsolute.txt	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Core/obj/Debug/DistributedGA.Core.csproj.FileListAbsolute.txt	(revision 13538)
@@ -10,5 +10,4 @@
 C:\Public\SVN\DistributedGA\DistributedGA.Core\bin\Debug\DistributedGA.Core.dll
 C:\Public\SVN\DistributedGA\DistributedGA.Core\bin\Debug\DistributedGA.Core.pdb
-C:\Public\SVN\DistributedGA\DistributedGA.Core\obj\Debug\DistributedGA.Core.csprojResolveAssemblyReference.cache
 C:\Public\SVN\DistributedGA\DistributedGA.Core\obj\Debug\DistributedGA.Core.dll
 C:\Public\SVN\DistributedGA\DistributedGA.Core\obj\Debug\DistributedGA.Core.pdb
Index: branches/thasling/DistributedGA/DistributedGA.Operator/obj/Debug/DistributedGA.Operator.csproj.FileListAbsolute.txt
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Operator/obj/Debug/DistributedGA.Operator.csproj.FileListAbsolute.txt	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Operator/obj/Debug/DistributedGA.Operator.csproj.FileListAbsolute.txt	(revision 13538)
@@ -13,2 +13,9 @@
 P:\_DATA\SVN\thasling\DistributedGA\DistributedGA.Operator\obj\Debug\DistributedGA.Operator.dll
 P:\_DATA\SVN\thasling\DistributedGA\DistributedGA.Operator\obj\Debug\DistributedGA.Operator.pdb
+C:\Public\SVN\DistributedGA\DistributedGA.Operator\bin\Debug\DistributedGA.Operator.dll
+C:\Public\SVN\DistributedGA\DistributedGA.Operator\bin\Debug\DistributedGA.Operator.pdb
+C:\Public\SVN\DistributedGA\DistributedGA.Operator\bin\Debug\DistributedGA.Core.dll
+C:\Public\SVN\DistributedGA\DistributedGA.Operator\bin\Debug\DistributedGA.Core.pdb
+C:\Public\SVN\DistributedGA\DistributedGA.Operator\obj\Debug\DistributedGA.Operator.csprojResolveAssemblyReference.cache
+C:\Public\SVN\DistributedGA\DistributedGA.Operator\obj\Debug\DistributedGA.Operator.dll
+C:\Public\SVN\DistributedGA\DistributedGA.Operator\obj\Debug\DistributedGA.Operator.pdb
Index: branches/thasling/DistributedGA/DistributedGA.Test/App.config
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Test/App.config	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Test/App.config	(revision 13538)
@@ -4,3 +4,6 @@
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
     </startup>
+  <appSettings>
+    <add key="ContactServerURL" value="http://localhost:9090/DistributedGA.ContactServer/ContactService"/>
+  </appSettings>
 </configuration>
Index: branches/thasling/DistributedGA/DistributedGA.Test/Form1.cs
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Test/Form1.cs	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Test/Form1.cs	(revision 13538)
@@ -1,133 +1,105 @@
-﻿using DistributedGA.Core;
+﻿using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using DistributedGA.Core;
 using DistributedGA.Core.Domain;
 using DistributedGA.Core.Implementation;
 using DistributedGA.Core.Interface;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Forms;
 
-namespace DistributedGA.Test
-{
-    public partial class Form1 : Form
-    {
-        public Form1()
-        {
-            InitializeComponent();
+namespace DistributedGA.Test {
+  public partial class Form1 : Form {
+    public Form1() {
+      InitializeComponent();
+    }
+
+    private void button1_Click(object sender, EventArgs e) {
+      IMessageService s = new WcfMessageService();
+      s.Init("");
+    }
+
+    private void button2_Click(object sender, EventArgs e) {
+      IMessageSender c = new WcfMessageSender();
+      c.Init(null);
+      c.SendPopulation(null, null);
+    }
+
+    private void button3_Click(object sender, EventArgs e) {
+      IMessageHandler h1 = new PeerNetworkMessageHandler();
+      h1.Init();
+      IMessageHandler h2 = new PeerNetworkMessageHandler();
+      h2.Init();
+      IMessageHandler h3 = new PeerNetworkMessageHandler();
+      h3.Init();
+      IMessageHandler h4 = new PeerNetworkMessageHandler();
+      h4.Init();
+      IMessageHandler h5 = new PeerNetworkMessageHandler();
+      h5.Init();
+      var pop1 = CreatePopulation();
+      h1.PublishMigrationInfo(pop1);
+      h1.PublishMigrationInfo(pop1);
+      var res1 = h1.GetMigrationInfo();
+      var res2 = h2.GetMigrationInfo();
+      h1.PublishMigrationInfo(pop1);
+      h1.PublishMigrationInfo(pop1);
+      var res3 = h1.GetMigrationInfo();
+      var res4 = h2.GetMigrationInfo();
+      h1.PublishMigrationInfo(pop1);
+      h1.PublishMigrationInfo(pop1);
+      var res5 = h1.GetMigrationInfo();
+      var res6 = h2.GetMigrationInfo();
+      int i = 0;
+    }
+
+    private void button4_Click(object sender, EventArgs e) {
+      var l = new WcfPeerListManager();
+      l.Init(CreatePeerInfo());
+      l.GetPeerList();
+    }
+
+    private void button5_Click(object sender, EventArgs e) {
+      Dictionary<string, int> d1 = new Dictionary<string, int>();
+      d1.Add("test", 5);
+      if (d1.ContainsKey("test")) {
+        int i = 0;
+      } else {
+        int j = 0;
+      }
+      Dictionary<PeerInfo, int> d2 = new Dictionary<PeerInfo, int>();
+      PeerInfo p1 = CreatePeerInfo();
+      PeerInfo p2 = CreatePeerInfo();
+      d2.Add(p1, 5);
+      if (d2.ContainsKey(p1)) {
+        int i = 0;
+      }
+      if (d2.ContainsKey(p2)) {
+        int i = 0;
+      }
+    }
+
+    private PeerInfo CreatePeerInfo() {
+      return new PeerInfo() { IpAddress = "192.168.0.4", Port = 3030 };
+    }
+
+    private SolutionInfo[] CreatePopulation() {
+      SolutionInfo si1 = new SolutionInfo() {
+        IterationNumber = 1,
+        Quality = 3.5f,
+        Solution = new Solution() {
         }
-
-        private void button1_Click(object sender, EventArgs e)
-        {
-            IMessageService s = new WcfMessageService();
-            s.Init("");
+      };
+      SolutionInfo si2 = new SolutionInfo() {
+        IterationNumber = 2,
+        Quality = 3.5f,
+        Solution = new Solution() {
         }
-
-        private void button2_Click(object sender, EventArgs e)
-        {
-            IMessageSender c = new WcfMessageSender();
-            c.Init(null);
-            c.SendPopulation(null, null);
+      };
+      SolutionInfo si3 = new SolutionInfo() {
+        IterationNumber = 3,
+        Quality = 3.5f,
+        Solution = new Solution() {
         }
-
-        private void button3_Click(object sender, EventArgs e)
-        {
-            IMessageHandler h1 = new PeerNetworkMessageHandler();
-            h1.Init();
-            IMessageHandler h2 = new PeerNetworkMessageHandler();
-            h2.Init();
-            IMessageHandler h3 = new PeerNetworkMessageHandler();
-            h3.Init();
-            IMessageHandler h4 = new PeerNetworkMessageHandler();
-            h4.Init();
-            IMessageHandler h5 = new PeerNetworkMessageHandler();
-            h5.Init();
-            var pop1 = CreatePopulation();
-            h1.PublishMigrationInfo(pop1);
-            h1.PublishMigrationInfo(pop1);
-            var res1 = h1.GetMigrationInfo();
-            var res2 = h2.GetMigrationInfo();
-            h1.PublishMigrationInfo(pop1);
-            h1.PublishMigrationInfo(pop1);
-            var res3 = h1.GetMigrationInfo();
-            var res4 = h2.GetMigrationInfo();
-            h1.PublishMigrationInfo(pop1);
-            h1.PublishMigrationInfo(pop1);
-            var res5 = h1.GetMigrationInfo();
-            var res6 = h2.GetMigrationInfo();
-            int i = 0;
-        }
-
-        private void button4_Click(object sender, EventArgs e)
-        {
-            var l = new WcfPeerListManager();
-            l.Init(CreatePeerInfo());
-            l.GetPeerList();
-        }      
-
-        private void button5_Click(object sender, EventArgs e)
-        {
-            Dictionary<string, int> d1 = new Dictionary<string, int>();
-            d1.Add("test", 5);
-            if(d1.ContainsKey("test"))
-            {
-                int i = 0;
-            }
-            else
-            {
-                int j = 0;
-            }
-            Dictionary<PeerInfo, int> d2 = new Dictionary<PeerInfo, int>();
-            PeerInfo p1 = CreatePeerInfo();
-            PeerInfo p2 = CreatePeerInfo();
-            d2.Add(p1, 5);
-            if (d2.ContainsKey(p1))
-            {
-                int i = 0;
-            }
-            if(d2.ContainsKey(p2))
-            {
-                int i = 0;
-            }
-        }
-
-        private PeerInfo CreatePeerInfo()
-        {
-            return new PeerInfo() { IpAddress = "192.168.0.4", Port = 3030 };
-        }
-
-        private  SolutionInfo[] CreatePopulation()
-        {
-            SolutionInfo si1 = new SolutionInfo()
-            {
-                IterationNumber = 1,
-                Quality = 3.5f,
-                Solution = new Solution()
-                {
-                }
-            };
-            SolutionInfo si2 = new SolutionInfo()
-            {
-                IterationNumber = 2,
-                Quality = 3.5f,
-                Solution = new Solution()
-                {
-                }
-            };
-            SolutionInfo si3 = new SolutionInfo()
-            {
-                IterationNumber = 3,
-                Quality = 3.5f,
-                Solution = new Solution()
-                {
-                }
-            };
-            return new SolutionInfo[] { si1, si2, si3 };
-        }
+      };
+      return new SolutionInfo[] { si1, si2, si3 };
     }
+  }
 }
Index: branches/thasling/DistributedGA/DistributedGA.Test/bin/Debug/DistributedGA.Test.exe.config
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Test/bin/Debug/DistributedGA.Test.exe.config	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Test/bin/Debug/DistributedGA.Test.exe.config	(revision 13538)
@@ -4,3 +4,6 @@
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
     </startup>
+  <appSettings>
+    <add key="ContactServerURL" value="http://localhost:9090/DistributedGA.ContactServer/ContactService"/>
+  </appSettings>
 </configuration>
Index: branches/thasling/DistributedGA/DistributedGA.Test/obj/Debug/DistributedGA.Test.csproj.FileListAbsolute.txt
===================================================================
--- branches/thasling/DistributedGA/DistributedGA.Test/obj/Debug/DistributedGA.Test.csproj.FileListAbsolute.txt	(revision 13537)
+++ branches/thasling/DistributedGA/DistributedGA.Test/obj/Debug/DistributedGA.Test.csproj.FileListAbsolute.txt	(revision 13538)
@@ -24,2 +24,10 @@
 C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.exe
 C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.pdb
+C:\Public\SVN\DistributedGA\DistributedGA.Test\bin\Debug\DistributedGA.Test.exe
+C:\Public\SVN\DistributedGA\DistributedGA.Test\bin\Debug\DistributedGA.Test.pdb
+C:\Public\SVN\DistributedGA\DistributedGA.Test\bin\Debug\DistributedGA.Core.dll
+C:\Public\SVN\DistributedGA\DistributedGA.Test\bin\Debug\DistributedGA.Core.pdb
+C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.csprojResolveAssemblyReference.cache
+C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.Form1.resources
+C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.Properties.Resources.resources
+C:\Public\SVN\DistributedGA\DistributedGA.Test\obj\Debug\DistributedGA.Test.csproj.GenerateResource.Cache
