public int getMinIndex(int[] ext){
		int min = 2147483647;
    	int index = -1;
    	for (int i = 0; i < ext.length; i++) {
			if(ext[i] != -1 && ext[i] < min){
				min = ext[i];
				index = i;
			}
		}
    	return index;
    }