added heuristics to variable elimination.