finish initial get-variables function