public ArrayList<ArrayList<Integer>> rangeCombine(int startN, int endN,
			int k) {
		ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
		int countInRange = endN - startN + 1;

		if (startN > endN || countInRange < k)
			return result;

		// count in range same as k, only one comb
		if (countInRange == k) {
			ArrayList<Integer> newList = new ArrayList<Integer>();
			for (int i = startN; i <= endN; i++) {
				newList.add(new Integer(i));
			}
			result.add(newList);
			return result;
		}

		// choose one, then every data in range should form one list
		if (k == 1) {
			for (int i = startN; i <= endN; i++) {
				ArrayList<Integer> newList = new ArrayList<Integer>();
				newList.add(new Integer(i));
				result.add(newList);
			}
			return result;
		}

		for (int i = startN; i <= endN; i++) {
			ArrayList<ArrayList<Integer>> restComb = rangeCombine(i + 1, endN,
					k - 1);

			System.out.println("For node " + i + " Rest Combos are:");
			printCombs(restComb);

			for (int j = 0; j < restComb.size(); j++) {
				ArrayList<Integer> curRestComb = restComb.get(j);
				ArrayList<Integer> newComb = new ArrayList<Integer>();
				// add cur in the first place
				newComb.add(new Integer(i));
				for (int m = 0; m < curRestComb.size(); m++) {
					newComb.add(curRestComb.get(m));
				}
				result.add(newComb);
			}
		}

		System.out.println("For node [" + startN + "," + endN
				+ "] All combos are:");
		printCombs(result);

		return result;
	}