private SimilarityCoefficient computeSimilarityCoefficient(
			HashMap<String, DBObject> reviewArray,
			HashMap<String, DBObject> reviewArray2, String exceptBusinessId) {
		Set<String> keySet = reviewArray.keySet();
		Iterator<String> itr = keySet.iterator();
		int count = 0;
		int totalX = 0;
		int totalY = 0;
		ArrayList<Integer> xArr = new ArrayList<Integer>();
		ArrayList<Integer> yArr = new ArrayList<Integer>();
		while (itr.hasNext()) {
			String key = itr.next();
			/* ignore the reviews of the business id */
			if (key.equals(exceptBusinessId))
				continue;
			if (reviewArray2.containsKey(key)) {
				/* found reviews of the same business in both user 1 and user 2 */
				count++;
				/* get stars of user 1 */
				int x = getReviewStarFromHashMap(reviewArray, key);
				/* get stars of user 2 */
				int y = getReviewStarFromHashMap(reviewArray2, key);
				totalX += x;
				totalY += y;
				xArr.add(x);
				yArr.add(y);
			} // if
		}
		if (count < MINIMUM_COMMON_REVIEW_COUNT) {
			/*
			 * There needs to be at least 2 for pcc to be computable. We may
			 * increase this minimum to a higher number for better accuracy
			 */
			return null;
		} else {
			Double averageX = Double.valueOf(totalX) / count;
			Double averageY = Double.valueOf(totalY) / count;
			/* covariance is the numerator */
			Double covariance = 0.0;
			/* variance are the denominator */
			Double varianceX = 0.0;
			Double varianceY = 0.0;
			for (int i = 0; i < count; i++) {
				int xi = xArr.get(i);
				int yi = yArr.get(i);
				Double deltaX = xi - averageX;
				Double deltaY = yi - averageY;
				covariance += deltaX * deltaY;
				varianceX += deltaX * deltaX;
				varianceY += deltaY * deltaY;
				/*
				 * System.out.println("x=" + xi + " y=" + yi + " deltaX=" +
				 * deltaX + " deltaY=" + deltaY);
				 */
			} // for
			/*
			 * System.out.println(xArr); System.out.println(yArr);
			 * System.out.println("covariance=" + covariance + " averageX=" +
			 * averageX + " averageY=" + averageY + " varianceX=" + varianceX +
			 * " varianceY=" + varianceY);
			 */

			/*
			 * both the number of data points and the pcc are returned so they
			 * can considered in user selection
			 */
			SimilarityCoefficient coefficient = new SimilarityCoefficient();
			coefficient.count = count;
			coefficient.meanX = averageX;
			coefficient.meanY = averageY;
			coefficient.xIsConstant = (varianceX == 0);
			coefficient.yIsConstant = (varianceY == 0);
			if (coefficient.xIsConstant || coefficient.yIsConstant) {
				/*
				 * if the x or the y all have the same value then variance can
				 * be zero
				 */
				if (covariance > 0) {
					coefficient.pcc = 1.0;
				} else if (covariance < 0) {
					coefficient.pcc = -1.0;
				} else {
					coefficient.pcc = 0.0;
				}
			} else {
				coefficient.pcc = covariance
						/ (Math.sqrt(varianceX) * Math.sqrt(varianceY));
				/*
				 * System.out.println("pcc=" + coefficient.pcc);
				 */
			}
			return coefficient;
		} // else
	} // computeSimilarityCoefficient