                     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);
+                    last_score = __shfl_up_sync(0xffffffff << 1, score3, 1);
                     if (thread_idx == 32)
                     {
-                        last_score = first_element_prev_score[0];
+                        last_score = first_element_prev_score;
                     }
                     __syncwarp();
 

        //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 || thread_idx == 32)
        {
            first_element_prev_score[thread_idx / 32] = scores[i * CUDAPOA_MAX_SEQUENCE_SIZE];
        }
        uint16_t out_edge_count = outgoing_edge_count_global[node_id];



    //__shared__ int16_t score_i[1024];
    //__shared__ int16_t score_prev_i[1024];
    __shared__ int16_t first_element_prev_score;

    uint32_t thread_idx = threadIdx.x;

