define vars at the top of the function