Implemented Alternating Inference Chains.