public static ArrayList<InveList> andOperate (ArrayList<InveList>result, ArrayList<InveList>ret){
		//this function can execute "#AND" operator
		int i = 0;
		int j = 0;
		//two pointers for two inverted list of two documents
		ArrayList<InveList> tempResult = new ArrayList<InveList>();

		while ((i < result.size()) && (j < ret.size())) {
			int ID1 = result.get(i).getDocID();
			int ID2 = ret.get(j).getDocID();

			if (ID1 == ID2) {
				//if two pointers point to same document
				//add it into result (score should be smaller Tf)
				//move both pointer
				int newTf = Math.min(result.get(i).getTf(), ret.get(j).getTf());

				InveList tmp = new InveList(result.get(i).getDocID());
				tmp.setTf(newTf);
				tempResult.add(tmp);

				i++;
				j++;
			}
			else if (ID1 < ID2) {
				//if two pointers point to different document
				//move the smaller pointer
				i++;
			}
			else if (ID1 > ID2) {
				//if two pointers point to different document
				//move the smaller pointer
				j++;
			}
		}
		return tempResult;
	}