First working version of freeVars