Added variable elimination and fixed issues with the recursive enumeration method