public void paintPage(JPanel panel, int first, int last){
		Graphics canvas = panel.getGraphics();
		canvas.setPaintMode();
		
		//while in bounds
		int maxX = paint.getWidth();
		int maxY = paint.getHeight();
		
		PDFTextStripper stripper;
		try {
			stripper = new PDFTextStripper();
	        stripper.setStartPage(first);
	        stripper.setEndPage(last);
	        
	        ArrayList< ArrayList<Tuple> > pageParse = sp.parseText(stripper.getText(book));

			int xShift = maxX/pageParse.size()+1; //we define how large our bars are
			int curX = 0;
			
	        for (ArrayList<Tuple> senParse : pageParse){
	        	int senLength = 0;
	        	for (Tuple phrase : senParse){
	        		senLength+= phrase.getCnt();
	        	}
	        	int yShift = Math.round((float)maxY/senLength);
	        	int curY = 0;
	        	
	        	for (Tuple phrase : senParse){
	        		int wc = phrase.getCnt()*yShift;

					int[] xs = {curX, curX, curX+xShift, curX+xShift}; 
					int[] ys = {curY, curY+wc,curY+wc, curY};
									
					canvas.setColor(phrase.getColor() );
					canvas.fillPolygon(xs, ys, 4);
					curY+=wc;
	        	};
	        curX+=xShift; 
	        };
		} catch (IOException e1) {};
	};