short convertEncodedMad(int size) {
		if (size == 0)
			return 0;
		if (size == -1000) { // temperature
			int diameter = getBfactor100() * 10 * 2;
			if (diameter > 4000)
				diameter = 4000;
			size = diameter;
		}
		else if (size == -1001) // ionic
			size = (getBondingMar() * 2);
		else if (size < 0) {
			size = -size;
			if (size > 200)
				size = 200;
			size = // we are going from a radius to a diameter
			(int) (size / 100f * getVanderwaalsMar() * 2);
		}
		else if (size >= 10000) {
			// radiusAngstroms = vdw + x, where size = (x*2)*1000 + 10000
			// and vdwMar = vdw * 1000
			// we want mad = diameterAngstroms * 1000 = (radiusAngstroms *2)*1000
			// = (vdw * 2 * 1000) + x * 2 * 1000
			// = vdwMar * 2 + (size - 10000)
			size = size - 10000 + getVanderwaalsMar() * 2;
		}
		return (short) size;
	}