     sum[pat][state] = 0;
     
     // TODO: Assumes matrixCount < LIKE_PATTERN_BLOCK_SIZE * 4
-    if (pat * LIKE_PATTERN_BLOCK_SIZE + state < matrixCount) {
-        matrixProp[pat * LIKE_PATTERN_BLOCK_SIZE + state] = dWeights[pat * 4 + state];
+    if (pat * 4 + state < matrixCount) {
+        matrixProp[pat * 4 + state] = dWeights[pat * 4 + state];
     }
 
     __syncthreads();

    sum[pat][state] = 0;
    
    // TODO: Assumes matrixCount < LIKE_PATTERN_BLOCK_SIZE * 4
    if (pat * LIKE_PATTERN_BLOCK_SIZE + state < matrixCount) {
        matrixProp[pat * LIKE_PATTERN_BLOCK_SIZE + state] = dWeights[pat * 4 + state];
    }

    __syncthreads();

    sumD2[pat][state] = 0;
    
    // TODO: Assumes matrixCount < LIKE_PATTERN_BLOCK_SIZE * 4
    if (pat * 4 + state < matrixCount) {
        matrixProp[pat * 4 + state] = dWeights[pat * 4 + state];
    }

    __syncthreads();
