     int *deviceMembership;
     int *deviceIntermediates;
 //  int *deviceNewClusterSize;
+
+    malloc2D(dimObjects, numCoords, numObjs, float)
+    for (i = 0; i < numCoords; i++) {
+        for (j = 0; j < numObjs; j++) {
+            dimObjects[i][j] = objects[j][i];
+        }
+    }
 
     /* allocate a 2D space for returning variable clusters[] (coordinates
        of cluster centers) */

    int     *newClusterSize; /* [numClusters]: no. objects assigned in each
                                new cluster */
    float    delta;          /* % of objects change their clusters */
    float  **clusters;       /* out: [numClusters][numCoords] */
    float  **newClusters;    /* [numClusters][numCoords] */


    checkCuda(cudaMalloc(&deviceIntermediates, numReductionThreads*sizeof(unsigned int)));
//  checkCuda(cudaMalloc(&deviceNewClusterSize, numClusters*sizeof(int)));

    checkCuda(cudaMemcpy(deviceObjects, dimObjects[0],
              numObjs*numCoords*sizeof(float), cudaMemcpyHostToDevice));
    checkCuda(cudaMemcpy(deviceMembership, membership,
              numObjs*sizeof(int), cudaMemcpyHostToDevice));
