Adding dump state functionality.