private void subdivide() {
		DCoord c1 = new DCoord(this.c1.x, this.c1.y);
		DCoord c2 = new DCoord((this.c1.x+this.c2.x)/2, this.c1.y);
		DCoord c3 = new DCoord(this.c1.x, (this.c1.y+this.c3.y)/2);
		DCoord c4 = new DCoord((this.c1.x+this.c2.x)/2, (this.c1.y+this.c3.y)/2);
		
		//picking out intensities, passing smaller array of pixel data to the lower level quad
		int[] newIntensities = new int[(int) Math.pow((int)(Math.sqrt(intensities.length)/2), 2)];
		for(int i = 0, j=0; i < (int)(Math.sqrt(intensities.length)/2)*Math.sqrt(intensities.length); i++){
			if(i % Math.sqrt(intensities.length)+1 < Math.sqrt(intensities.length)/2){
				newIntensities[j] = intensities[i];
				j++;
			}
		}
		topLeft = new Quad(QuadType.TopLeft, c1, c2, c3, c4, depth+1, newIntensities);
		topLeft.setParent(this);
		
		c1 = new DCoord((this.c1.x+this.c2.x)/2, this.c1.y);
		c2 = new DCoord(this.c2.x, this.c2.y);
		c3 = new DCoord((this.c1.x+this.c2.x)/2, (this.c1.y+this.c3.y)/2);
		c4 = new DCoord(this.c2.x, (this.c1.y+this.c3.y)/2);
		//picking out intensities
				for(int i = 0, j=0; i < (int)(Math.sqrt(intensities.length)/2)*Math.sqrt(intensities.length); i++){
					if(i % Math.sqrt(intensities.length) > Math.sqrt(intensities.length)/2){
						newIntensities[j] = intensities[i];
						j++;
					}
				}
		topRight = new Quad(QuadType.TopRight, c1, c2, c3, c4, depth+1, newIntensities);
		topRight.setParent(this);

		
		c1 = new DCoord(this.c1.x, (this.c1.y+this.c3.y)/2);
		c2 = new DCoord((this.c1.x+this.c2.x)/2, (this.c1.y+this.c3.y)/2);
		c3 = new DCoord(this.c3.x, this.c3.y);
		c4 = new DCoord((this.c1.x+this.c2.x)/2, this.c3.y);
		//picking out intensities
				for(int i = (int) (((int)(Math.sqrt(intensities.length)/2)+1)*Math.sqrt(intensities.length)), j=0; i < intensities.length; i++){
					if(i % Math.sqrt(intensities.length)+1 < Math.sqrt(intensities.length)/2){;
						newIntensities[j] = intensities[i];
						j++;
					}
				}
		bottomLeft = new Quad(QuadType.BottomLeft, c1, c2, c3, c4, depth+1, newIntensities);
		bottomLeft.setParent(this);

		
		c1 = new DCoord((this.c1.x+this.c2.x)/2, (this.c1.y+this.c3.y)/2);
		c2 = new DCoord(this.c2.x, (this.c1.y+this.c3.y)/2);
		c3 = new DCoord((this.c1.x+this.c2.x)/2, this.c3.y);
		c4 = new DCoord(this.c4.x, this.c4.y);
		//picking out intensities
		for(int i = (int) (((int)(Math.sqrt(intensities.length)/2)+1)*Math.sqrt(intensities.length)), j=0; i < intensities.length; i++){
			if(i % Math.sqrt(intensities.length) > Math.sqrt(intensities.length)/2){
				newIntensities[j] = intensities[i];
				j++;
			}
		}
		bottomRight = new Quad(QuadType.BottomRight, c1, c2, c3, c4, depth+1, newIntensities);	
		bottomRight.setParent(this);

		
		children.add(topLeft);
		children.add(topRight);
		children.add(bottomLeft);
		children.add(bottomRight);
	}