Save state functionality

:+1: :dog: