Finishing touches to variable elimination