 	
 	if (lid == 0)
 	{
-		blocksums[gl_WorkGroupID.x] = temp[n - 1];
-		temp[n - 1] = 0;
+		blocksums[gl_WorkGroupID.x] = temp[n - 1 + CONFLICT_FREE_OFFSET(n-1)];
+		temp[n - 1 + CONFLICT_FREE_OFFSET(n-1)] = 0;
 	}
 	
 	for (int d = 1; d < n; d *= 2)

	int lid = int (gl_LocalInvocationIndex);
	int offset = 1;
	
	temp[2 * lid] = data[2 * gid];
	temp[2 * lid + 1] = data[2 * gid + 1];
	
	for (int d = n >> 1; d > 0; d >>= 1)
	{

		{
			int ai = offset * (2 * lid + 1) - 1;
			int bi = offset * (2 * lid + 2) - 1;
			ai += CONFLICT_FREE_OFFSET(ai);
			bi += CONFLICT_FREE_OFFSET(bi);
			
			temp[bi] += temp[ai]; 
		}
