private double signalContribution(double rssi1, double rssi2) {

		
		/*
		 * we take the reference value of the rssi as base for further
		 * computations
		 */
		double base = rssi1;

		
		log.log(loglevel, "  Base: " + base);

		/*
		 * in order that +20 and -20 dB are treated the same, the penalty
		 * function uses the difference of the rssi's.
		 */
		double diff = Math.abs(rssi1 - rssi2);

		
		log.log(loglevel, "  Diff: " + diff);

		/* get percentage of error */
		double x = diff / base;

		
		log.log(loglevel, "  Diff percents of base: " + x);

		/* prevent division by zero */
		if (x > 0.0) {
			/*
			 * small error should result in a high contribution, big error in a
			 * small -> reciprocate (1/x) MIN = 1, MAX = infinity
			 */
			double y = 1 / x;

			
			log.log(loglevel, "  Current Contribution: " + y);

			/*
			 * compute percentage of treshold regarding the current base
			 */
			double t = SIGNAL_PENALTY_THRESHOLD / base;

			/*
			 * shift down the resulting graph. the root (zero) will then be
			 * exactly at x = treshold for every base, e.g. measurement, and
			 * signal differences above the treshold will result in a negative
			 * contribution
			 */
			y -= 1 / t;

			/*
			 * graph increases fast, so that a difference of 15 still results in
			 * a maximal contribution. With this adjustment, the graph gets flat
			 * and this has also an impact on the penalty (difference to big)
			 */
			y = y * SIGNAL_GRAPH_LEVELING;

			
			log.log(loglevel, "  Shifted Contribution: " + y
						+ " (shifted by " + t + ")");

			if ((-1 * SIGNAL_CONTRIBUTION <= y)
					&& (y <= SIGNAL_CONTRIBUTION)) {
				
				log.log(loglevel, "  Returned: " + y);
				return y;
			} else {
				
				log.log(loglevel, "  Returned: "
							+ SIGNAL_CONTRIBUTION
							+ " (CUTOFF, y was " + y + ")");

				/* don't exceed the max possible credits/penalty */
				return SIGNAL_CONTRIBUTION;
			}
		} else {
			
			log.log(loglevel, "  Returned: "
						+ SIGNAL_CONTRIBUTION
						+ " (diff was zero)");
			return SIGNAL_CONTRIBUTION;
		}
	}