public boolean initialiseWithLines(ArrayList<StringBuffer> lines, ProcessingOptions options) throws UnsupportedEncodingException {

		//remove blank rows at the bottom
		boolean done = false;
		int i;
		for(i = lines.size() - 1; !done; i--){
			StringBuffer row = lines.get(i);
			if(!StringUtils.isBlank(row.toString())) done = true;
		}
		rows = new ArrayList<StringBuffer>(lines.subList(0, i + 2));

		if(options != null) fixTabs(options.getTabSize());
		else fixTabs(options.DEFAULT_TAB_SIZE);


		// make all lines of equal length
		// add blank outline around the buffer to prevent fill glitch
		// convert tabs to spaces (or remove them if setting is 0)
		
		int blankBorderSize = 2;
		
		int maxLength = 0;
		int index = 0;
		
		String encoding = null;
		//if(options != null) encoding = options.getCharacterEncoding();
		
		Iterator<StringBuffer> it = rows.iterator();
		while(it.hasNext()){
			String row = it.next().toString();
			if(encoding != null){
				byte[] bytes = row.getBytes();
				row = new String(bytes, encoding);
			}
			if(row.length() > maxLength) maxLength = row.length();
			rows.set(index, new StringBuffer(row));
			index++;
		}

		it = rows.iterator();
		ArrayList<StringBuffer> newRows = new ArrayList<StringBuffer>();
		//TODO: make the following depend on blankBorderSize
		
		StringBuffer topBottomRow =
			new StringBuffer(StringUtils.repeatString(" ", maxLength + blankBorderSize * 2));
		
		newRows.add(topBottomRow);
		newRows.add(topBottomRow);
		while(it.hasNext()){
			StringBuffer row = it.next();
			
			if(row.length() < maxLength) {
				String borderString = StringUtils.repeatString(" ", blankBorderSize);
				StringBuffer newRow = new StringBuffer();
				
				newRow.append(borderString);
				newRow.append(row);
				newRow.append(StringUtils.repeatString(" ", maxLength - row.length()));
				newRow.append(borderString);
				
				newRows.add(newRow);
			} else { //TODO: why is the following line like that?
				newRows.add(new StringBuffer("  ").append(row).append("  "));
			}
		}
		//TODO: make the following depend on blankBorderSize
		newRows.add(topBottomRow);
		newRows.add(topBottomRow);
		rows = newRows;
		
		replaceBullets();
		replaceHumanColorCodes();
		
		return true;
	}