public void paintComponent(Graphics g) {
		
		updateScale();
		
		System.out.println("Canvas size actually is: " +this.getSize().width +", "+this.getSize().height);
		System.out.println("Trying to paint Canvas of size: "+thisSize.width +", "+thisSize.height);
		
		super.paintComponent(g);
		Graphics2D g2d = (Graphics2D) g;
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
				 RenderingHints.VALUE_ANTIALIAS_ON);
		
		g2d.setPaint(Color.white);   // !!!!!!! hacky fix for bug below
		g2d.fill(new Rectangle2D.Float(0, 0, 10000, 10000));
		
		//g2d.setColor(Color.black);
		g2d.setPaint(Color.black);
		
		g2d.setStroke(new BasicStroke(circleStroke));
		
		/*for (Ellipse2D.Float eli : agentsv) {
			g2d.draw(eli);
		}*/
		
		//update(g);
		if (foundSolution) {
			System.out.println("drew lines");

			double maxPhero = getMaxPhero();
			for (int i = 0; i < pheroLines.length; i++) {
				for (int j = 0; j < pheroLines[i].length; j++) {
					g2d.setPaint(Color.red);
					int d = computeStroke(i, j, maxPhero);
					if (d != 0) {
						BasicStroke strokeW = new BasicStroke(d);
						g2d.setStroke(strokeW);
						g2d.draw(pheroLines[i][j]);
					}
				}
			}
			
			g2d.setPaint(Color.black);
			g2d.setStroke(new BasicStroke(lineStroke));
			
			for (Line2D.Float line: lines) {
				g2d.draw(line);
			}
			
			g2d.setFont(new Font(null, Font.PLAIN, 30));
			g2d.drawString(minor_solution+", "+best_solution, thisSize.width*solutionPadPercent, thisSize.height*0.5f);

		}
		
		for (Ellipse2D.Float eli : tasksv) {
			g2d.draw(eli);
		}
		
		for (int i = 0; i < agentsv.length; i++) {
			System.out.println(new Double(capPercents[i]).floatValue());
			Color c = new Color(0.0f, 0.0f, 0.0f, new Double(1.0 - capPercents[i]).floatValue());
			g2d.setPaint(c);
			g2d.fill(agentsv[i]);
			
			g2d.setPaint(Color.black);
			g2d.draw(agentsv[i]);
		}
	}