added function to collect the set of free variables in an expression.