Made getAllVars recursive