Now extracts undefined variables to function paramaters