private int paintStr()
	{

		//nothing to draw
		if (words.size() == 0 || words.get(0).getStart() > currentTime)
		{
			System.out.println("nothing to do at " + currentTime);
			return 0;
		}
		

		//already expires
		if (!words.get(0).exists(currentTime))
		{
//			System.out.println(words.get(0).getLabel().getStr() + " :expires brfoe drawing! " + words.get(0).getStart() + " + " + words.get(0).getLength() + " > " + currentTime);
			words.remove(0);
			return 1;
		}
		
		
		// Try to find an empty space of the string
		Point position = null;	
		Rectangle  bounds = null;
		Shape draw_word = null;
		AffineTransform tx = null;
		boolean found = false;
		Point[] str_vertex = new Point[4];
		
		//TODO::change
		int sides = 0;
		
		while (!found)
		{

			// Set the font
			try 
			{
				font = fontBase.deriveFont(Font.PLAIN, words.get(0).getMax());
			} 
			catch (Exception ex)
			{
				ex.printStackTrace();
			}
			g.setFont(font);
			TextShape textshape = new TextShape(font,words.get(0).getLabel().getStr());
			draw_word=textshape.getShape();
			tx = new AffineTransform();
			bounds = draw_word.getBounds();
			str_vertex[0] = new Point(bounds.x, bounds.y);
			str_vertex[1] = new Point(bounds.x, bounds.y + bounds.height);
			str_vertex[2] = new Point(bounds.x + bounds.width, bounds.y + bounds.height);
			str_vertex[3] = new Point(bounds.x + bounds.width, bounds.y);
			
			bounds = draw_word.getBounds();
			for (int j = sides; j > -1; j--)
			{
				//rotate it 4 times to fit space
				for(int k = 0; k < 3; k++) {

					position = searchSpace(bounds, j);
					if (position != null)
					{
						found = true;
						j = -1;
						break;
					} else {
						AffineTransform ax = new AffineTransform();
						ax.rotate(Math.PI/4*Math.random() ,0,0);
						ax.transform(str_vertex, 0, str_vertex, 0, 4);
						draw_word=ax.createTransformedShape(draw_word);
						bounds = draw_word.getBounds();
					}
				}
			}
			
			if (!found) // no space, try to make the word smaller
			{
				System.out.println("No space available at " + currentTime);
				return 0;	
			}

		}
		
		setColor(position);// Set the color of the string which is related to its position
		// Draw the string
		int x = (int) (position.x - bounds.getMinX());
		int y = (int) (position.y - bounds.getMinY());
		
		tx.setToTranslation(x, y);
		tx.transform(str_vertex, 0, str_vertex, 0, 4);
		draw_word=tx.createTransformedShape(draw_word);
		g.fill(draw_word);
		words.get(0).setPoint(x, y);
		int[] str_x = {(int)str_vertex[0].x, (int)str_vertex[1].x, (int)str_vertex[2].x, (int)str_vertex[3].x};
		int[] str_y = {(int)str_vertex[0].y, (int)str_vertex[1].y, (int)str_vertex[2].y, (int)str_vertex[3].y};
		words.get(0).setBounds(new Polygon(str_x, str_y, 4));
//		if (update) observer.imageUpdate(img, ImageObserver.ALLBITS, position.x, position.y, bounds.width, bounds.height);
		//copy from words to current
		current.add(words.get(0));
		words.remove(0);
		

		return 1;	
	}