Exact Inference Through Variable Elimination