Find entering and exiting variables