          return 1;
       }
    }
-   
+
    // Print out GPU Details
    printDeviceProps();
-  
+
    // OpenGL / GLUT Initialization
    GLInit(argc, argv);
-   
+
    // Create VBO
    createVBO(&positionsVBO, &positionsVBO_CUDA, cudaGraphicsMapFlagsWriteDiscard);
 
    // Run initial CUDA step
    cudaGLSetGLDevice(0);
-   runCUDA(&positionsVBO_CUDA); 
-   
+   //runCUDA(&positionsVBO_CUDA);
+
    // Start GLUT Loop
+   fprintf(stdout, "   starting main loop\n");
    glutMainLoop();
-   
+
    //onGLUTExit();
 
   return 0;
 }
-

  glViewport(0, 0, window_width, window_height);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0, (double)mesh_width / (double)mesh_height, 1.0, 200.0);
}

__host__ void printDeviceProps() {

__host__ void launchKernel(float4* positions, unsigned int width, unsigned int height, float t) {
  dim3 dimBlock(16, 16, 1);
  dim3 dimGrid(width / dimBlock.x, height / dimBlock.y, 1);
  fprintf(stdout, "   launching kernel\n");
  kernel<<<dimGrid, dimBlock>>>(positions, width, height, t);
  fprintf(stdout, "   exiting kernel\n");
}

__host__ void runCUDA(struct cudaGraphicsResource** vbo_resource) {
  fprintf(stdout, "   running cuda\n");
  // Map VBO to GL with CUDA
  float4* positions;
  checkCudaErrors( cudaGraphicsMapResources(1, vbo_resource, 0) );
