+#pragma once
+
+#ifdef __INTELLISENSE__
+
+#include <cuda.h>
+#include <cuda_runtime.h>
+#include <device_launch_parameters.h>
+
+#define __CUDACC__
+
+#include <device_functions.h>
+
+#endif
+
+//#include <cuda.h>
+// CUDA runtime
+//#include "cuda_runtime.h"
+//#include "device_launch_parameters.h"
+
+// nvcc does not seem to like variadic macros, so we have to define
+// one for each kernel parameter list:
+#ifdef __CUDACC__
+#define KERNEL_ARGS2(grid, block) <<< grid, block >>>
+#define KERNEL_ARGS3(grid, block, sh_mem) <<< grid, block, sh_mem >>>
+#define KERNEL_ARGS4(grid, block, sh_mem, stream) <<< grid, block, sh_mem, stream >>>
+#else
+#define KERNEL_ARGS2(grid, block)
+#define KERNEL_ARGS3(grid, block, sh_mem)
+#define KERNEL_ARGS4(grid, block, sh_mem, stream)
+#endif
+
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
 #include <time.h>
+#include "monkey_even_odd.h"
 //#include <thrust/sort.h>
+
+// Now launch your kernel using the appropriate macro:
+//kernel KERNEL_ARGS2(dim3(nBlockCount), dim3(nThreadCount)) (param1);
+//https://stackoverflow.com/a/27992604/5241172
 
 /*
 nvcc -O3 -arch=sm_30 -o even_odd_cuda_monkey monkey_even_odd.cu

  //cudamemset can be used for initializing data (say, all zeros). 10 times faster than cudaMemcpy zero array because it is done on the gpu directly.
  cudaMemset(d_solutions, 0, SIZE*sizeof(unsigned int));

  // Start timer
  start = clock();

  // Run the loop 
  for (unsigned int sailors=2; sailors<max_sailors+1;sailors++){

    printf("Running %u sailors, %u monkeys\n", sailors, monkeys);


}


__global__ 
void monkey(unsigned int *tot, unsigned long long int extra, unsigned int *the_solutions, unsigned int *found, unsigned int sailors, unsigned int monkeys, unsigned int n)
{
  if (found[0] == 0){

    for (unsigned int i = blockIdx.x * blockDim.x + threadIdx.x; i<n; i+=blockDim.x*gridDim.x){

	  unsigned char j;
	  const unsigned long long int rExtra = extra;
	  unsigned int rCoconuts = tot[i] + rExtra;
	  const unsigned int rSailors = sailors;
	  const unsigned int rMonkeys = monkeys;

      // Go through the number of sailors
      for (j=0; j<rSailors;j++){
        // One for each monkey
		  rCoconuts -= rMonkeys;
        if (rCoconuts % rSailors != 0){
          break;
        }     
		rCoconuts -= rCoconuts/ rSailors;
      }
      if (rCoconuts % rSailors == 0){
        found[0] = 1;
        the_solutions[i] = i;
/*
