Introduce reference counting for variables.