add defvars macro and test