Find free variables defined in functions