Added remaining variables to remember state