 	//Points the 4 children nodes to the right parent for advice
 	//Be careful of integer division if trying to simplify this.
 	//TODO: simplify this
+	int parent_node_id = blockIdx.x / 2 + (blockIdx.y /2 ) * (gridDim.x / 2) ;
 	//TODO: could make one thread pull from global memory into shared memory, instead of all threads pulling
-	int parent_node_id = blockIdx.x / 2 + (blockIdx.y /2 ) * (gridDim.x / 2) ;
 	const int advice = dParentsInputAdvice==NULL ? 0 : dParentsInputAdvice[parent_node_id];
 
 	const int s2 = states * states;

	//multiply the two parts of the belief update equation numerator together, Pr(o|s') by Sum[ Pr(s'|s,c)*b(S) ]
	//The cache[sp * states] is the Pr(s'|s,c)*b(S)  vector

     //we launched with a 2d block of threads now only dealing with 1d arrays, so convert this back to 1d so we waste fewer threads
	int sp_start  = threadIdx.y * blockDim.x + threadIdx.x; 
        int n_threads = blockDim.x * blockDim.y;

    //transform it from a column into a row
	for(int sp = sp_start ; sp < states ; sp += n_threads ){
		//dNewBeliefs[i] = dPOS[i] * cache[sp * states];
		pssc_b_vector[sp] = cache[sp * states] *= dPOS[bid * states + sp];

        tid += blockDim.x;
    }
}

/**
 * UpdateBeliefs - Performs the P(s'|s,a)*b(s) calculations of the DeSTIN belief update rule.
