 typedef Wacky Aggregator;
 
 __host__ __device__ void zero(Aggregator* aggregator) {
-  aggregator.test = 0.0f;
+  aggregator->test = 0.0f;
 }
 
 __host__ __device__ void increment(Aggregator* aggregator, float input_x, float input_y, float weight) {
-  aggregator.test += weight * (input_x + input_y);
+  printf("before %g %g %g %g ", aggregator->test, weight, input_x, input_y);
+
+  aggregator->test += weight * (input_x + input_y);
+
+  printf("after %g\n", aggregator->test);
 }
 
 __host__ __device__ void combine(Aggregator* total, Aggregator* item) {
-  total.test += item.test;
+  total->test += item->test;
 }
 
 //////

}

extern __shared__ unsigned char sharedMemory[];

__global__ void initialize(int sharedMemoryOffset) {
  Aggregator* threadLocal = (Aggregator*)((size_t)sharedMemory + sharedMemoryOffset + threadId()*sizeof(Aggregator));


// the input fields are auto-generated
__global__ void fillAll(int sharedMemoryOffset, float* input_x, float* input_y, float* weight) {
  printf("here %g %g %g\n", input_x[0], input_y[0], weight[0]);

  int id = threadId();
  fill(sharedMemoryOffset, input_x[id], input_y[id], weight[id]);
}

__global__ void extractFromBlock(int sharedMemoryOffset, int numThreadsPerBlock, Aggregator* sumOverBlock) {
  Aggregator *blockLocal = &sumOverBlock[blockIdx.x + blockIdx.y * gridDim.x + gridDim.x * gridDim.y * blockIdx.z];
  zero(sumOverBlock);
  for (int thread = 0;  thread < numThreadsPerBlock;  ++thread) {
    Aggregator* singleAggregator = (Aggregator*)((size_t)sharedMemory + sharedMemoryOffset + thread*sizeof(Aggregator));
