Index: code/branches/network/src/network/Client.cc
===================================================================
--- code/branches/network/src/network/Client.cc	(revision 889)
+++ code/branches/network/src/network/Client.cc	(revision 891)
@@ -184,5 +184,5 @@
     while(!(client_connection.queueEmpty())){
       packet = client_connection.getPacket();
-      //std::cout << "tick packet size " << packet->dataLength << std::endl;
+      COUT(5) << "tick gamestate packet size " << packet->dataLength << std::endl;
       elaborate(packet, 0); // ================= i guess we got to change this .... (client_ID is always same = server)
     }
@@ -192,5 +192,5 @@
   void Client::processGamestate( GameStateCompressed *data){
     gamestate.pushGameState(data);
-    std::cout << "received gamestate id: " << data->id << std::endl;
+    COUT(5) << "received gamestate id: " << data->id << std::endl;
     client_connection.addPacket(pck_gen.acknowledgement(data->id));
     client_connection.sendPackets();
@@ -207,5 +207,5 @@
 
   void Client::processChat( chat *data){
-    std::cout << "Server: " << data->message << std::endl;
+    COUT(0) << "Server: " << data->message << std::endl;
   }
 
Index: code/branches/network/src/network/ClientConnection.cc
===================================================================
--- code/branches/network/src/network/ClientConnection.cc	(revision 889)
+++ code/branches/network/src/network/ClientConnection.cc	(revision 891)
@@ -43,4 +43,5 @@
 
 #include "util/Sleep.h"
+#include "orxonox/core/Debug.h"
 #include "ClientConnection.h"
 
Index: code/branches/network/src/network/GameStateManager.cc
===================================================================
--- code/branches/network/src/network/GameStateManager.cc	(revision 889)
+++ code/branches/network/src/network/GameStateManager.cc	(revision 891)
@@ -72,9 +72,9 @@
       GameState *server = reference;
       //head_->findClient(clientID)->setGamestateID(id);
-      return encode(client, server);
+      return *encode(client, server);
     } else {
       GameState *server = reference;
       //head_->findClient(clientID)->setGamestateID(id);
-      return encode(server);
+      return *encode(server);
       // return an undiffed gamestate and set appropriate flags
     }
@@ -142,18 +142,18 @@
   }
 
-  GameStateCompressed GameStateManager::encode(GameState *a, GameState *b) {
+  GameStateCompressed *GameStateManager::encode(GameState *a, GameState *b) {
     //GameState r = diff(a,b);
     //r.diffed = true;
-    GameState r = *b;
-    r.diffed = false;
-    return compress_(&r);
-  }
-
-  GameStateCompressed GameStateManager::encode(GameState *a) {
+    GameState *r = b;
+    r->diffed = false;
+    return compress_(r);
+  }
+
+  GameStateCompressed *GameStateManager::encode(GameState *a) {
     a->diffed=false;
     return compress_(a);
   }
 
-  GameState GameStateManager::diff(GameState *a, GameState *b) {
+  GameState *GameStateManager::diff(GameState *a, GameState *b) {
     unsigned char *ap = a->data, *bp = b->data;
     int of=0; // pointers offset
@@ -182,11 +182,14 @@
       }
     }
-    // should be finished now
-    // FIXME: is it true or false now? (struct has changed, producing warnings)
-    GameState r = {b->id, dest_length, true, dp};
+    
+    GameState *r = new GameState;
+    r->id = b->id;
+    r->size = dest_length;
+    r->diffed = true;
+    r->data = dp;
     return r;
   }
 
-  GameStateCompressed GameStateManager::compress_(GameState *a) {
+  GameStateCompressed *GameStateManager::compress_(GameState *a) {
     COUT(5) << "compressing gamestate" << std::endl;
     int size = a->size;
@@ -199,18 +202,21 @@
 
     switch ( retval ) {
-      case Z_OK: std::cout << "successfully compressed" << std::endl; break;
-      case Z_MEM_ERROR: std::cout << "not enough memory available" << std::endl; break;
-      case Z_BUF_ERROR: std::cout << "not enough memory available in the buffer" << std::endl; break;
-      case Z_DATA_ERROR: std::cout << "decompress: data corrupted" << std::endl; break;
-    }
-
-    GameStateCompressed compressedGamestate;
-    compressedGamestate.compsize = buffer;
+      case Z_OK: COUT(5) << "successfully compressed" << std::endl; break;
+      case Z_MEM_ERROR: COUT(1) << "not enough memory available in gamestate.compress" << std::endl; 
+      return NULL;
+      case Z_BUF_ERROR: COUT(2) << "not enough memory available in the buffer in gamestate.compress" << std::endl;
+      return NULL;
+      case Z_DATA_ERROR: COUT(2) << "decompress: data corrupted in gamestate.compress" << std::endl;
+      return NULL;
+    }
+
+    GameStateCompressed *compressedGamestate = new GameStateCompressed;
+    compressedGamestate->compsize = buffer;
 //     std::cout << "compressedGamestate.compsize = buffer; " << buffer << std::endl;
-    compressedGamestate.normsize = size;
+    compressedGamestate->normsize = size;
 //     std::cout << "compressedGamestate.normsize = size; " << size << std::endl;
-    compressedGamestate.id = a->id;
-    compressedGamestate.data = dest;
-    compressedGamestate.diffed = a->diffed;
+    compressedGamestate->id = a->id;
+    compressedGamestate->data = dest;
+    compressedGamestate->diffed = a->diffed;
 
     return compressedGamestate;
Index: code/branches/network/src/network/GameStateManager.h
===================================================================
--- code/branches/network/src/network/GameStateManager.h	(revision 889)
+++ code/branches/network/src/network/GameStateManager.h	(revision 891)
@@ -48,8 +48,8 @@
   private:
     GameState *getSnapshot(int id);
-    GameStateCompressed encode(GameState *a, GameState *b);
-    GameStateCompressed encode(GameState *a);
-    GameState diff(GameState *a, GameState *b);
-    GameStateCompressed compress_(GameState *a);
+    GameStateCompressed *encode(GameState *a, GameState *b);
+    GameStateCompressed *encode(GameState *a);
+    GameState *diff(GameState *a, GameState *b);
+    GameStateCompressed *compress_(GameState *a);
     bool deleteUnusedGameState(int gamestateID);
 
Index: code/branches/network/src/network/PacketDecoder.cc
===================================================================
--- code/branches/network/src/network/PacketDecoder.cc	(revision 889)
+++ code/branches/network/src/network/PacketDecoder.cc	(revision 891)
@@ -38,4 +38,5 @@
 #include "PacketTypes.h"
 #include "PacketManager.h"
+#include "orxonox/core/Debug.h"
 
 namespace network
Index: code/branches/network/src/network/dummyclient3.cc
===================================================================
--- code/branches/network/src/network/dummyclient3.cc	(revision 889)
+++ code/branches/network/src/network/dummyclient3.cc	(revision 891)
@@ -13,8 +13,8 @@
   network::PacketGenerator pck;
   const int PORT = 55556;
-  std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
+  COUT(0) << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
   std::string str;
   std::getline(std::cin, str);
-  std::cout << "You entered: " << str << std::endl;
+  COUT(3) << "You entered: " << str << std::endl;
   if(str.compare("")==0)
     str="127.0.0.1";
@@ -22,6 +22,6 @@
   Client client( str, PORT );
   if ( client.establishConnection() )
-    std::cout << "connection established" << std::endl;
-  else std::cout << "problems establishing connection" << std::endl;
+    COUT(3) << "connection established" << std::endl;
+  else COUT(0) << "problems establishing connection" << std::endl;
   char message[10000];
   char signs[] = "abcdefghijklmnopqrstuvwxy";
