Changed slightly for analog support.