 	double yMax = 30;
 	double zMin = -30;
 	double zMax = 30;
-	double rMin = 1;
-	double rMax = 20;
+	double rMin = .1;
+	double rMax = 1;
 
 	vector<Sphere> spheres;
 
 	Sphere sphere;
-	for(int i=0;i<numSpheres;i++)
-	{
-		sphere.pos = make_real3(getRandomNumber(xMin,xMax),getRandomNumber(yMin,yMax),getRandomNumber(zMin,zMax));
-		sphere.r = getRandomNumber(rMin,rMax);
+	for (int i = 0; i < numSpheres; i++) {
+		sphere.pos = make_real3(getRandomNumber(xMin, xMax), getRandomNumber(yMin, yMax), getRandomNumber(zMin, zMax));
+		sphere.r = getRandomNumber(rMin, rMax);
 		sphere.index = i;
 
 		//printf("Sphere %d pos = (%.3f, %.3f, %.3f), r = %.3f\n",i,sphere.pos.x,sphere.pos.y,sphere.pos.z,sphere.r);

	// Step 2: Generate aabb_data from spheres
	custom_vector<real3> aabb_data;

	for(int i=0;i<spheres.size();i++)
	{
		real3 temp = spheres[i].pos;
		temp.x-=spheres[i].r;
		temp.y-=spheres[i].r;
		temp.z-=spheres[i].r;
		aabb_data.push_back(temp);
	}
	for(int i=0;i<spheres.size();i++)
	{
		real3 temp = spheres[i].pos;
		temp.x+=spheres[i].r;
		temp.y+=spheres[i].r;
		temp.z+=spheres[i].r;
		aabb_data.push_back(temp);
	}
	// End Step 2

#include "Broadphase.cuh"

// Test to see if the list of potential collisions from broadphase includes all of the ACTUAL collisions.

double getRandomNumber(double min, double max) {
	// x is in [0,1[
	double x = rand() / static_cast<double>(RAND_MAX);

	// [0,1[ * (max - min) + min is in [min,max[
	double that = min + (x * (max - min));

	return that;
}

struct Sphere {
		double r;
		real3 pos;
		uint index;
};

bool isColliding(Sphere sA, Sphere sB) {
	double dist = pow(sA.pos.x - sB.pos.x, 2.0) + pow(sA.pos.y - sB.pos.y, 2.0) + pow(sA.pos.z - sB.pos.z, 2.0);
	if (dist < pow(sA.r + sB.r, 2.0))
		return true;
	return false;
}

int main(int argc, char** argv) {
	// Step 1: Generate random spheres
	uint numSpheres = 300;
	double xMin = -30;
