public static ArrayList<InveList> orOperate (ArrayList<InveList>result , ArrayList<InveList>ret){
		//this function can execute "#OR" 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())) {

			//for the situation that either inverted lists has not reach its end
			//but the other has not

			if ((i == result.size()) && (j < ret.size())){
				while (j < ret.size()){
					InveList tmp = new InveList(ret.get(j).getDocID());
					tmp.setTf(ret.get(j).getTf());
					tempResult.add(tmp);
					j++;
				}
			}
			else if ((i < result.size()) && (j == ret.size())){
				while (i < result.size()){
					InveList tmp = new InveList(result.get(i).getDocID());
					tmp.setTf(result.get(i).getTf());
					tempResult.add(tmp);
					i++;
				}
			}
			if ((i == result.size()) && (j == ret.size()))
				break;

			int ID1 = result.get(i).getDocID();
			int ID2 = ret.get(j).getDocID();

			//for the current situation
			//if two pointers point to same document
			//add it into result (score should be bigger Tf)
			//move both pointer
			if (ID1 == ID2) {
				InveList tmp = new InveList(result.get(i).getDocID());
				tmp.setTf(Math.max(result.get(i).getTf(), ret.get(j).getTf()));
				tempResult.add(tmp);

				i++;
				j++;
			}
			else if (ID1 < ID2) {
				//if two pointers point to different document
				//add it into result (score should be Tf)
				//move the smaller pointer
				InveList tmp = new InveList(result.get(i).getDocID());
				tmp.setTf(result.get(i).getTf());
				tempResult.add(tmp);

				i++;
			}
			else if (ID1 > ID2) {
				//if two pointers point to different document
				//add it into result (score should be Tf)
				//move the smaller pointe
				InveList tmp = new InveList(ret.get(j).getDocID());
				tmp.setTf(ret.get(j).getTf());
				tempResult.add(tmp);

				j++;
			}
		}
		return tempResult;
	}