diff --git a/src/lib/eyd_uncompressor.cpp b/src/lib/eyd_uncompressor.cpp
index cc8823c..13a88df 100644
--- a/src/lib/eyd_uncompressor.cpp
+++ b/src/lib/eyd_uncompressor.cpp
@@ -4,25 +4,26 @@
 namespace EydLib {
 
 	/*
-	class BitUncompressor {
-		private:
-			BitGroup _last_group;
-			int _last_count;
-			std::list<BitGroup> _uncompressed;
+	   class BitUncompressor {
+	   private:
+	   BitGroup _last_group;
+	   int _last_count;
+	   std::list<BitGroup> _uncompressed;
 
-		public:
-			BitUncompressor();
+	   public:
+	   BitUncompressor();
 
-			void clear();
-			void append(BitGroup bg);
-			std::list<BitGroup> flush();
-			bool hasContent();
-	};
-	*/
+	   void clear();
+	   void append(BitGroup bg);
+	   std::list<BitGroup> flush();
+	   bool hasContent();
+	   };
+	   */
 
 	BitUncompressor::BitUncompressor(int size) : _rle(size) {
 		_group_size = size;
 		_last_count = 0;
+		_status = UNCOMPRESSOR_STATUS_NORMAL;
 	}
 
 	void BitUncompressor::clear(){
@@ -31,60 +32,44 @@ namespace EydLib {
 		_uncompressed.clear();
 	}
 
-	void BitUncompressor::flushRleData(){
-		BitGroup len(_group_size);  
-		_uncompressed.push_back(_rle);
-		printf("Last count %d\n", _last_count);
-		printf("Max cellsize %d\n", len.maxValue());
-		len.setValue(_last_count);
-		_uncompressed.push_back(len);
-		_uncompressed.push_back(_last_group);	
-		_last_count = 0;
-	}
-
-	void BitUncompressor::flushRawData(){
-		int i;
-		for (i=0; i<_last_count; i++){
-			// on duplique les RLE trouv�s
-			if (_last_group == _rle) {
-				_uncompressed.push_back(_last_group);
-			}
-			_uncompressed.push_back(_last_group);
-		}
-		_last_count = 0;
-	}
-
 	void BitUncompressor::append(BitGroup data){
-		// take the data and make it smaller...
-		if (_last_count > 0) {
-			// there are data in the compressor
-			if (data != _last_group){
-				// we have to empty the compressed list
-				if (_last_count < 4){
-					// not efficient
-					if ((_last_count > 1) && (_last_group == _rle)) {
-						// 1 RLE gives 2 RLE
-						// 2 RLE gives 4 RLE... let compress it...
-						this->flushRleData();
-					} else {
-						this->flushRawData();
-					}
+		switch (_status){
+			case UNCOMPRESSOR_STATUS_NORMAL: 
+				printf("STATUS NORMAL : %s\n", data.toString().c_str());
+				if (data == _rle){
+					// on change le status et on n'�crit rien
+					_status = UNCOMPRESSOR_STATUS_GOTRLE;
 				} else {
-					// efficient ! lets compress it !
-					this->flushRleData();
+					// on �crit directement le resultat non d�compress�	
+					_uncompressed.push_back(data);
 				}
-			} else {
-				// nothing to do... wait for another different data...
-				// maybe the count is bigger than the len-cell can store ?
-				if (_last_count >= _rle.maxValue()){
-					this->flushRleData();
+				break;
+			case UNCOMPRESSOR_STATUS_GOTRLE:
+				printf("STATUS GOT RLE : %s\n", data.toString().c_str() );
+				if (data == _rle){
+					// deux RLE c'est 1 RLE 
+					// on �crit juste un RLE
+					_uncompressed.push_back(data);
+					_status = UNCOMPRESSOR_STATUS_NORMAL;
+				} else {
+					// un RLE et un diff�rent c'est une longueur
+					// sauf si �gal � 1 ou 2
+					_status = UNCOMPRESSOR_STATUS_GOTLEN; // sauf si �gal � RLE
+					_last_count = data.getValue(); // on stocke la value
 				}
-			}
-		} else {
-			// it is the first bitgroup
+				break;
+			case UNCOMPRESSOR_STATUS_GOTLEN:
+				printf("STATUS GOT LEN : %s\n", data.toString().c_str() );
+				// ce qu'on lit est la valeur
+				// on �crit donc _last_count fois data
+				for (int i=0; i<_last_count; i++){
+					_uncompressed.push_back(data);
+				}
+				_status = UNCOMPRESSOR_STATUS_NORMAL;
+				_last_count = 0;
+				break;
+
 		}
-		_last_group = data;
-		_last_count++;
 	}
 
 	std::list<BitGroup> BitUncompressor::flush(){
diff --git a/src/lib/eyd_uncompressor.hh b/src/lib/eyd_uncompressor.hh
index 079409d..eabc3be 100644
--- a/src/lib/eyd_uncompressor.hh
+++ b/src/lib/eyd_uncompressor.hh
@@ -14,15 +14,15 @@
 
 
 namespace EydLib {
+	typedef enum {UNCOMPRESSOR_STATUS_NORMAL, UNCOMPRESSOR_STATUS_GOTLEN, UNCOMPRESSOR_STATUS_GOTRLE} uncompressor_status_t;
 
 	class BitUncompressor {
 		private:
 			BitGroup _rle;
-			BitGroup _last_group;
 			int _last_count;
 			int _group_size;
 			std::list<BitGroup> _uncompressed;
-
+			uncompressor_status_t _status;
 
 		public:
 			BitUncompressor::BitUncompressor(int size);
diff --git a/src/tools/bitcompress.cpp b/src/tools/bitcompress.cpp
index f746dca..5b22719 100644
--- a/src/tools/bitcompress.cpp
+++ b/src/tools/bitcompress.cpp
@@ -53,7 +53,12 @@ int main(int argc, char ** argv){
 			// TODO: on flushe le contenu de record
 			compressor.flushRleData();
 			std::list<EydLib::BitGroup> compressedData = compressor.flush();
-
+			std::list<EydLib::BitGroup>::iterator cmpDataIt;
+			for(cmpDataIt = compressedData.begin();
+					cmpDataIt != compressedData.end();
+					cmpDataIt++){
+				bitwrite.write((*cmpDataIt)); // cellule
+			}
 		} catch (std::exception& e){
 			printf("ERROR\n");
 		}
diff --git a/src/tools/bitdecompress.cpp b/src/tools/bitdecompress.cpp
index 1d96d84..fb2a820 100644
--- a/src/tools/bitdecompress.cpp
+++ b/src/tools/bitdecompress.cpp
@@ -18,7 +18,7 @@ int main(int argc, char ** argv){
 	cell_size = atoi(argv[1]);
 	original = argv[2];
 
-	copy = original + ".rl1";
+	copy = original + ".rl2";
 
 	EydLib::BitReader bitread(cell_size, 256);
 	bitread.open(original);
@@ -53,9 +53,15 @@ int main(int argc, char ** argv){
 		} catch (EydLib::eBitReaderEndOfFile& e) {
 			done = true;		
 			// on flushe le contenu de record
-			uncompressor.flushRleData();
+			// FIXME: trouver un moyen de flusher la fin du fichier
+			// uncompressor.flushRleData();
 			std::list<EydLib::BitGroup> uncompressedData = uncompressor.flush();
-
+			std::list<EydLib::BitGroup>::iterator uncmpDataIt;
+				for(uncmpDataIt = uncompressedData.begin();
+						uncmpDataIt != uncompressedData.end();
+						uncmpDataIt++){
+					bitwrite.write((*uncmpDataIt)); // cellule
+				}
 		} catch (std::exception& e){
 			printf("ERROR\n");
 		}