diff --git a/scripts/tcd/Troubled_Cell_Detector.py b/scripts/tcd/Troubled_Cell_Detector.py
index 422db3a4b1ce8d753d561ecbfe28a242d274a96f..6d168ac67b2a6cf67fbdb8de469616461ae91197 100644
--- a/scripts/tcd/Troubled_Cell_Detector.py
+++ b/scripts/tcd/Troubled_Cell_Detector.py
@@ -237,13 +237,8 @@ class WaveletDetector(TroubledCellDetector):
             Matrix of multiwavelet coefficients.
 
         """
-        output_matrix = []
-        for i in range(self._mesh.num_cells):
-            new_entry = 0.5*(
-                    projection[:, i+1] @ self._wavelet_projection_left
-                    + projection[:, i+2] @ self._wavelet_projection_right)
-            output_matrix.append(new_entry)
-        return np.transpose(np.array(output_matrix))
+        return 0.5 * (self._wavelet_projection_left.T @ projection[:, 1:-1] +
+                      self._wavelet_projection_right.T @ projection[:, 2:])
 
     def _select_degree(self, wavelet_matrix):
         """Select degree of wavelet coefficients for troubled cell detection.