Added variable elimination code