 
     start = clock64();
 
-    //int16_t max_score = SHRT_MIN;
-    //int16_t max_i = -1;
-    //int16_t max_j = -1;
-    int16_t max_score = maxscore[0];
-    int16_t max_i = maxi[0];
-    int16_t max_j = maxj[0];
+    int16_t max_score;
 
     long long int serial = 0;
 

                {
                    uint32_t val_thread = (read_count - 1) % 32;
                    max_score = __shfl_sync(0xffffffff, score, val_thread);
                    //printf("issued max score update from %d\n", val_thread);
                    max_i = __shfl_sync(0xffffffff, i, val_thread);
                    max_j = __shfl_sync(0xffffffff, j, val_thread);

                    if (thread_idx == 32)
                    {
                        maxscore[0] = max_score;
                        maxi[0] = max_i;
                        maxj[0] = max_j;
                    }
                }
            }


                    //printf("score for thread %d location %d is %d with prev_score %d\n", thread_idx, j, score, prev_score);
                }

                max_score = maxscore[thread_idx % 32];

                // While there are changes to the horizontal score values, keep updating the matrix.
                // So loop will only run the number of time there are corrections in the matrix.
