private static void offsetsToVariables(int[] allOffsets, TemplatePosition[] variables) {
private static void offsetsToVariables(int[] allOffsets, TemplatePosition[] variables, int start) {
	private static void offsetsToVariables(int[] allOffsets, TemplatePosition[] variables) {		int[] currentIndices= new int[variables.length];		for (int i= 0; i != currentIndices.length; i++)			currentIndices[i]= 0;		int[][] offsets= new int[variables.length][];				for (int i= 0; i != variables.length; i++)			offsets[i]= variables[i].getOffsets();				for (int i= 0; i != allOffsets.length; i++) {			int min= Integer.MAX_VALUE;			int minVariableIndex= -1;			for (int j= 0; j != variables.length; j++) {			    int currentIndex= currentIndices[j];			    			    // determine minimum				if (currentIndex == offsets[j].length)					continue;									int offset= offsets[j][currentIndex];				if (offset < min) {				    min= offset;					minVariableIndex= j;				}					}			offsets[minVariableIndex][currentIndices[minVariableIndex]]= allOffsets[i];			currentIndices[minVariableIndex]++;		}		for (int i= 0; i != variables.length; i++)			variables[i].setOffsets(offsets[i]);		}