             //    printf("previous score for thread %d is %d\n", thread_idx, prev_score);
             //}
 
-            // Index into score matrix.
-            scores[i * CUDAPOA_MAX_SEQUENCE_SIZE + j0] = score0;
-            scores[i * CUDAPOA_MAX_SEQUENCE_SIZE + j1] = score1;
-            scores[i * CUDAPOA_MAX_SEQUENCE_SIZE + j2] = score2;
-            scores[i * CUDAPOA_MAX_SEQUENCE_SIZE + j3] = score3;
-            serial += (clock64() - temp);
-
             __syncthreads();
-            //__syncwarp();
 
             if (thread_idx >= 32)
             {
                 loop = true;
                 //uint16_t loop = 31;
                 //uint16_t thread_id_to_process = 1;
+                    //if (thread_idx == 32)
+                    //{
+                    //    last_score = first_element_prev_score;
+                    //}
                 while(__any_sync(0xffffffff, loop))
                 {
 

            //int16_t ls = __shfl_sync(0xffffffff, score3, 31);
            if (thread_idx == 31)
            {
                first_element_prev_score[0] = score3;
                //first_element_prev_score[1] = score3;
            }

            //if (thread_idx == 0)

        //int32_t* scores_i = &scores[i * CUDAPOA_MAX_MATRIX_DIMENSION];

        //int16_t first_element_prev_score = scores[i * CUDAPOA_MAX_SEQUENCE_SIZE];
        if (thread_idx == 0)
        {
            first_element_prev_score = scores[i * CUDAPOA_MAX_SEQUENCE_SIZE];
        }
        uint16_t out_edge_count = outgoing_edge_count_global[node_id];

