clear and free variables