beginning of persistent variable handling