     //__shared__ int16_t score_i[1024];
     //__shared__ int16_t score_prev_i[1024];
 
-    __shared__ int16_t prev_score[1];
-
     uint32_t thread_idx = threadIdx.x;
 
     long long int start = clock64();

        uint16_t i = graph_pos + 1;
        //int32_t* scores_i = &scores[i * CUDAPOA_MAX_MATRIX_DIMENSION];

        int16_t init_score = scores[i * CUDAPOA_MAX_SEQUENCE_SIZE];
        uint16_t out_edge_count = outgoing_edge_count_global[node_id];

        uint16_t pred_count = incoming_edge_count[node_id];

            //if (thread_idx < 32)
            //for(uint8_t warp = 0; warp < num_warps; warp++)
            //{
            //uint32_t first_warp_thread_idx = warp * WARP_SIZE;
            //uint32_t last_warp_thread_idx = (warp + 1) * WARP_SIZE - 1;

            // 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.
            // The any_sync warp primitive lets us easily check if any of the threads had an update.
            bool loop = true;
            //uint16_t loop = 31;
            //uint16_t thread_id_to_process = 1;
            while(__any_sync(0xffffffff, loop))
            {

                // To increase instruction level parallelism, we compute the scores
                // in reverse order. And then check if any of the scores had an update,
                // and if there's an update then we rerun the loop to capture the effects
                // of the change in the next loop.
                loop = false;
                // The shfl_up lets us grab a value from the lane below.
                //printf("thread %d line %d\n", thread_idx, __LINE__);
                int16_t last_score = __shfl_up_sync(0xffffffff >> 1, score3, 1);
                if (thread_idx == 0)
                {
                    last_score = first_element_prev_score;
                }
                __syncwarp();

                //printf("thread %d line %d\n", thread_idx, __LINE__);
                //if (thread_idx == thread_id_to_process)
                //{
                bool check3 = false;
                int16_t tscore = max(score2 + GAP, score3);
                if (tscore > score3)
                {
                    score3 = tscore;
                    check3 = true;
                }

                bool check2 = false;
                tscore = max(score1 + GAP, score2);
                if (tscore > score2)
                {
                    score2 = tscore;
                    check2 = true;
                }

                bool check1 = false;
                tscore = max(score0 + GAP, score1);
                if (tscore > score1)
                {
                    score1 = tscore;
                    check1 = true;
                }

                bool check0 = false;
                tscore = max(last_score + GAP, score0);
                if (tscore > score0)
                {
                    score0 = tscore;
                    check0 = true;
                }

                loop = check0 || check1 || check2 || check3;
            }

            //printf("score after shuffle operations for thread %d location %d is %d\n", thread_idx, j, score);

            // Copy over the last element score of the last lane into a register of first lane
            // which can be used to compute the first cell of the next warp.
            first_element_prev_score = __shfl_sync(0xffffffff, score3, 31);

            //if (thread_idx == 0)
            //{
