public int divide(int[] tmpArray){
		int center = tmpArray[tmpArray.length-1];
		int j;
		int i = 0;
		if(tmpArray.length <= 2){
			if(tmpArray[0] < tmpArray[1]){
				j = -1;
			}else{
				j = -2;
			}
		}else{
			
			while((i < tmpArray.length-2)&&(tmpArray[i] <= center)){
				i++;
			}
			j = i;
			if(i < tmpArray.length-2){
				for(int l_i = i+1; l_i<tmpArray.length; l_i++){
					if(tmpArray[l_i] < center){
						int tmp = tmpArray[l_i];
						tmpArray[l_i] = tmpArray[j];
						tmpArray[j] = tmp;
						j++;
					}
				}
			}
		}
		return j;
	}