private int extractSlot(byte[] schedule, int slot) {
		// since 8 is divisible by bitsPerSlot, we know that
		// one slot will never span more than one byte.

		// relevant byte:
		byte b = schedule[(slot * bitsPerSlot) / 8];
		int startBit = (slot * bitsPerSlot) % 8;
		b >>= startBit;
		b &= (1 << bitsPerSlot) - 1;
		return (int) b;
	}