private static double calProxiScore(PostingNode a, PostingNode b, int avgDocLength) {
		ArrayList<Integer> aPosList = a.getPosList();
		ArrayList<Integer> bPosList = b.getPosList();

		int i = 0, j = 0;
		double sum = 0.0;

		while (i < aPosList.size() && j < bPosList.size()) {
			int diff = bPosList.get(j) - aPosList.get(i); // a in front of b

			if (diff > 0 && diff <= 5) {
				// in range, cal culate score
				sum += 1 / (diff * diff);
				i++;
			} else if (diff <= 0) {
				// now b is in front of a, so b++
				j++;
			} else {
				// a is 5 words+ in front of b, so a++
				i++;
			}
		}

		// return the normalized score
		return (k1 + 1)
				* (sum / (K(avgDocLength, a.getDoc().getLength()) + sum));
	}