 +
 +    // Generate the LU decomposition of the matrix
 +    void GenerateLDUDecomposition(uint8_t* matrix_L, uint8_t* diag_D, uint8_t* matrix_U);
++  CM256Decoder();
 +};
 +
++CM256Decoder::CM256Decoder()
++  : Params(),
++    Recovery(),
++    RecoveryCount(0),
++    Original(),
++    OriginalCount(0),
++    ErasuresIndices()
++{
++}
 +bool CM256Decoder::Initialize(cm256_encoder_params& params, cm256_block* blocks)
 +{
 +    Params = params;

+    return 0;
+}
diff --git a/gf256.cpp b/gf256.cpp
index 510146b..cad3a43 100644
--- a/gf256.cpp
+++ b/gf256.cpp
@@ -27,7 +27,7 @@
     POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include "gf256.h"
+#include <wirehair/gf256.h>
 
 #ifdef LINUX_ARM
 #include <unistd.h>
diff --git a/include/wirehair/cm256.h b/include/wirehair/cm256.h
new file mode 100644
index 0000000..72a8415
--- /dev/null
+++ b/include/wirehair/cm256.h
@@ -0,0 +1,170 @@
+/*
+	Copyright (c) 2015 Christopher A. Taylor.  All rights reserved.
+

+install(EXPORT ${targetsFile} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake ${nameSpace})
+install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+install(DIRECTORY python DESTINATION ${CMAKE_INSTALL_PREFIX} ${optionalInstall})
diff --git a/WirehairCodec.cpp b/WirehairCodec.cpp
index c1ec664..6523aa0 100644
--- a/WirehairCodec.cpp
+++ b/WirehairCodec.cpp
@@ -1149,26 +1149,30 @@ bool Codec::TriangleNonHeavy()
 
 #if defined(CAT_HEAVY_WIN_MULT)
 
-#if defined(CAT_ENDIAN_BIG)
-
+  namespace
+  {
+    bool isLittleEndian()
+    {
+      short int number = 0x1;
+      char* numPtr = (char*)&number;
+      return (numPtr[0] == 1);
+    }
+  }
 // Flip endianness at compile time if possible
-static uint32_t GF256_MULT_LOOKUP[16] = {
+  static uint32_t GF256_MULT_LOOKUP_BIG[16] = {
     0x00000000, 0x01000000, 0x00010000, 0x01010000, 
     0x00000100, 0x01000100, 0x00010100, 0x01010100, 
     0x00000001, 0x01000001, 0x00010001, 0x01010001, 
     0x00000101, 0x01000101, 0x00010101, 0x01010101, 
 };
 
-#else
-
 // Little-endian or unknown bit order:
-static uint32_t GF256_MULT_LOOKUP[16] = {
+  static uint32_t GF256_MULT_LOOKUP_LITTLE[16] = {
     0x00000000, 0x00000001, 0x00000100, 0x00000101, 
     0x00010000, 0x00010001, 0x00010100, 0x00010101, 
     0x01000000, 0x01000001, 0x01000100, 0x01000101, 
     0x01010000, 0x01010001, 0x01010100, 0x01010101, 
 };
-#endif
 
 #endif // CAT_HEAVY_WIN_MULT
 
@@ -1178,7 +1182,8 @@ bool Codec::Triangle()
     CAT_IF_DUMP(cout << endl << "---- Triangle ----" << endl << endl;)
 
     const unsigned first_heavy_column = _first_heavy_column;
-
+    uint32_t* GF256_MULT_LOOKUP =
+      isLittleEndian() ? GF256_MULT_LOOKUP_LITTLE : GF256_MULT_LOOKUP_BIG;
     // If next pivot is not heavy:
     if (_next_pivot < first_heavy_column &&
         !TriangleNonHeavy())
@@ -1281,7 +1286,7 @@ bool Codec::Triangle()
                         rem_row[ge_column_i - first_heavy_column] ^= code_value;
                     }
                 }
-#else // CAT_HEAVY_WIN_MULT
+#else  // CAT_HEAVY_WIN_MULT
                 const unsigned odd_count = pivot_i & 3;
                 unsigned ge_column_i = pivot_i + 1;
                 uint64_t temp_mask = ge_mask;
@@ -1329,11 +1334,8 @@ bool Codec::Triangle()
                 {
                     // Look up 4 bit window
                     const uint32_t bits = (uint32_t)(pivot_row[ge_column_i >> 6] >> (ge_column_i & 63)) & 15;
-#if defined(CAT_ENDIAN_UNKNOWN)
-                    const uint32_t window = getLE(GF256_MULT_LOOKUP[bits]);
-#else
+
                     const uint32_t window = GF256_MULT_LOOKUP[bits];
-#endif
 
                     CAT_IF_DUMP(cout << " " << ge_column_i << "x" << hex << setw(8) << setfill('0') << window << dec;)
 
@@ -2523,7 +2525,9 @@ void Codec::BackSubstituteAboveDiagonal()
             } // end if contains heavy
 
             // Only add window table entries for rows under this limit
-            const uint16_t window_row_limit = (pivot_i >= first_heavy_column) ? first_heavy_row : 0x7fff;
+          const uint16_t window_row_limit = (pivot_i >= first_heavy_column)
+                                              ? first_heavy_row
+                                              : uint16_t(0x7fff);
 
             const uint32_t first_word = backsub_i >> 6;
             const uint32_t shift0 = backsub_i & 63;
@@ -2709,7 +2713,7 @@ void Codec::BackSubstituteAboveDiagonal()
             }
         } // next pivot above
 
-        if (pivot_i <= 0) {
+      if (pivot_i == 0) {
             break;
         }
         --pivot_i;
diff --git a/WirehairTools.cpp b/WirehairTools.cpp
index dfd6585..84ccb24 100644
--- a/WirehairTools.cpp
+++ b/WirehairTools.cpp
@@ -331,7 +331,7 @@ void AddInvertibleGF2Matrix(
         target -= written0;
         prev = word0;
 
-        if (target <= 0) {
+      if (target == 0) {
             continue;
         }
 
@@ -388,9 +388,8 @@ void ShuffleDeck16(
             uint32_t jj, rv = prng.Next();
 
             // 8-bit unroll
-            switch (count - ii)
+        if (count - ii == 3)
             {
-            default:
                 jj = (uint8_t)rv % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
@@ -402,29 +401,48 @@ void ShuffleDeck16(
                 jj = (uint8_t)(rv >> 16) % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
-                ++ii;
-                jj = (uint8_t)(rv >> 24) % ii;
+          return;
+        }
+        else if (count - ii == 2)
+        {
+          jj = (uint8_t)(rv >> 8) % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
                 ++ii;
-                break;
-
-            case 3:
+          jj = (uint8_t)(rv >> 16) % ii;
+          deck[ii] = deck[jj];
+          deck[jj] = (uint16_t)ii;
+          return;
+        }
+        else if (count - ii == 1)
+        {
+          jj = (uint8_t)(rv >> 16) % ii;
+          deck[ii] = deck[jj];
+          deck[jj] = (uint16_t)ii;
+          return;
+        }
+        else if (count - ii == 0)
+        {
+          return;
+        }
+        else
+        {
                 jj = (uint8_t)rv % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
                 ++ii;
-            case 2:
                 jj = (uint8_t)(rv >> 8) % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
                 ++ii;
-            case 1:
                 jj = (uint8_t)(rv >> 16) % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
-            case 0:
-                return;
+          ++ii;
+          jj = (uint8_t)(rv >> 24) % ii;
+          deck[ii] = deck[jj];
+          deck[jj] = (uint16_t)ii;
+          ++ii;
             }
         }
     }
@@ -436,25 +454,27 @@ void ShuffleDeck16(
             uint32_t jj, rv = prng.Next();
 
             // 16-bit unroll
-            switch (count - ii)
+        if (count - ii == 1)
             {
-            default:
                 jj = (uint16_t)rv % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
-                ++ii;
-                jj = (uint16_t)(rv >> 16) % ii;
+          return;
+        }
+        else if (count - ii == 0)
+        {
+          return;
+        }
+        else
+        {
+          jj = (uint16_t)rv % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
                 ++ii;
-                break;
-
-            case 1:
-                jj = (uint16_t)rv % ii;
+          jj = (uint16_t)(rv >> 16) % ii;
                 deck[ii] = deck[jj];
                 deck[jj] = (uint16_t)ii;
-            case 0:
-                return;
+          ++ii;
             }
         }
     }
diff --git a/WirehairTools.h b/WirehairTools.h
index 8340df5..f8b3251 100644
--- a/WirehairTools.h
