external function for getting table vars