Use state for the last_optimize value.
Merge pull request #30 from md-systems/state

Use state for the last_optimize value.