public void draw(Graphics2D g){
		// first, we get how big our drawing space is
		Rectangle r=null;
		if((r=g.getClipBounds())==null){
			throw new IllegalArgumentException();
		} else {
			g.setColor(Color.blue);
		}
		int w = r.width-2;
		int h = r.height-2;
		int leftoffset = 1;
		int topoffset = 1;
		double tilesize=0;
		// here we determine how far from the sides the board should be drawn
		// this is based upon the size of the draw area, and the aspect ratio of the board
		// this will also determine how large the tiles on the board are.
		if ((w/h)<aspectRatio){ // this is what happens if the drawable area is wider than the board
			// so we want the top offset to increase
			tilesize=(double)w/(double)this.width;
			topoffset = 1+(int)((double)h - (this.height*tilesize)) /2;
		} else { // this is what happens if the drawable area is taller  than the board
			// so we want the left offset to increase
			tilesize=(double)h/(double)this.height;
			leftoffset =1+ (int)((double)w - (this.width*tilesize)) /2;
		}
		
//		g.draw(r);
		// now we draw a black box around the drawing area, because we can
		g.setColor(Color.BLACK);
		g.drawRect(leftoffset-1, topoffset-1, (int)(this.width*tilesize)+1, (int)(this.height*tilesize)+1);
		
		for (int x=0; x<width; ++x){
			for (int y=0; y<height; ++y){
				Tile t = board[x][y].tile;
				if (t==startPos) {
					g.setColor(Color.GRAY);
				} else if (t instanceof Room){
					g.setColor(Color.YELLOW.brighter());
				} else if (t instanceof Wall){
					g.setColor(Color.BLACK);
				} else if (t instanceof Corridor){
					g.setColor(Color.WHITE);
				} else if (t instanceof Doorway){
					g.setColor(Color.ORANGE);
				}
				
				
//				g.setColor(Color.green.darker());
				g.fillRect((int)(x*tilesize)+leftoffset, (int)(y*tilesize)+topoffset, (int)(tilesize), (int)(tilesize));
				g.setColor(Color.LIGHT_GRAY);
				g.drawRect((int)(x*tilesize)+leftoffset, (int)(y*tilesize)+topoffset, (int)(tilesize), (int)(tilesize));
			}
		}
		
	}