Chapter 4 Q4 & 5 (persiting variables with state) done